yellow-externallinks/externallinks.php
2026-05-28 08:40:59 +02:00

22 lines
No EOL
730 B
PHP

<?php
// External links in a new tab, https://codeberg.org/simonpipe/yellow-externallinks
class YellowExternalLinks {
const VERSION = "0.9.0";
public $yellow; // access to API
// Initialize extension
public function onLoad($yellow) {
$this->yellow = $yellow;
}
public function onExtra($name) {
$output = "";
if ($name == "header") {
// Passt den Pfad dynamisch an das neue workers-Verzeichnis an
$location = $this->yellow->config->get("serverBase").$this->yellow->config->get("workerDir")."externallinks.js";
$output .= "<script type=\"text/javascript\" src=\"{$location}\" async></script>\n";
}
return $output;
}
}