yellow-externallinks/externallinks.php
2026-05-28 08:43:32 +02:00

22 lines
No EOL
669 B
PHP

<?php
// External links in a new tab, https://codeberg.org/simonpipe/yellow-externallinks
class YellowExternallinks {
const VERSION = "0.9.1";
public $yellow; // access to API
// Initialize extension
public function onLoad($yellow) {
$this->yellow = $yellow;
}
// Insert script into header
public function onExtra($name) {
$output = "";
if ($name == "header") {
$location = $this->yellow->system->get("coreServerBase") . "system/workers/externallinks.js";
$output .= "<script type=\"text/javascript\" src=\"{$location}\" async></script>\n";
}
return $output;
}
}