yellow-externallinks/externallinks.php
2026-05-28 09:20:04 +02:00

22 lines
No EOL
737 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 onParsePageExtra($page, $name) {
$output = null;
if ($name == "header") {
$assetLocation = $this->yellow->system->get("coreServerBase") . $this->yellow->system->get("coreAssetLocation");
$output .= "<script type=\"text/javascript\" defer=\"defer\" src=\"{$assetLocation}externallinks.js\"></script>\n";
}
return $output;
}
}