22 lines
No EOL
737 B
PHP
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.2";
|
|
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;
|
|
}
|
|
} |