$settings['description'], 'keywords' => $settings['keywords'] ]; } if (isset(self::$pageMeta[$name])) { self::$pageMeta[$name] .= ",".$addition; } } /** * Add content to the html head * * @param string $tag */ public static function addToHead($tag = "") { if (!\stristr(self::$pageHeadTags, $tag)) { self::$pageHeadTags .= $tag."\n"; } } /** * Add content to the footer * * @param string $tag */ public static function addToFooter($tag = "") { if (!stristr(self::$pageFooterTags, $tag)) { self::$pageFooterTags .= $tag."\n"; } } /** * Replace something in the output using regexp * * @param string $target Regexp pattern without delimiters * @param string $replace The new content * @param string $modifiers Regexp modifiers */ public static function replaceInOutput($target, $replace, $modifiers = "") { self::$outputHandlers[] = function ($output) use ($target, $replace, $modifiers) { return preg_replace('^'.preg_quote($target, "^").'^'.$modifiers, $replace, $output); }; } /** * Add a new output handler function * * @param callback $callback The name of a function or other callable object */ public static function addHandler($callback) { if (is_callable($callback)) { self::$outputHandlers[] = $callback; } } /** * Add javascript source code to the output * * @param string $tag */ public static function addToJQuery($tag = "") { self::$jqueryTags .= $tag; } /** * Add css code to the output * * @param string $tag */ public static function addToCss($tag = "") { self::$cssTags .= $tag; } /** * Get Current Page Title */ public static function getTitle() { if (!empty(self::$pageTitle)) { return self::$pageTitle; } return ""; } /** * Execute the output handlers * * @global array $locale * * @param string $output * * @return string */ public static function handleOutput($output) { $locale = fusion_get_locale(); $settings = fusion_get_settings(); if (!empty(self::$pageHeadTags)) { $output = preg_replace("##", self::$pageHeadTags."", $output, 1); } if (!empty(self::$cssTags)) { if ($settings['devmode'] == 0) { $minifier = new Minify\CSS(self::$cssTags); $css = $minifier->minify(); } else { $css = self::$cssTags; } $output = preg_replace("##", "", $output, 1); } if (self::$pageTitle != $settings['sitename']) { $output = preg_replace("#