function addCustomTagsToDocument($tags) { if (empty($tags)) return ; $content = ''; if (AriJoomlaUtils::isJoomla15()) { $content = JResponse::getBody(); } else { $content = @ob_get_contents(); @ob_clean(); } $content = preg_replace('/(<\/head\s*>)/i', join('', $tags) . '$1', $content); if (AriJoomlaUtils::isJoomla15()) { JResponse::setBody($content); } else { echo $content; } }
function getLink($link, $xhtml = false, $clearItemId = true) { if (!AriJoomlaUtils::isJoomla15()) { if (function_exists('sefRelToAbs')) $link = sefRelToAbs($link); if (!$xhtml) $link = str_replace('&', '&', $link); } else { $app = &JFactory::getApplication(); $router = &$app->getRouter(); if($router->getMode() == JROUTER_MODE_SEF && $clearItemId) { $itemidPos = strpos($link, 'Itemid'); if ($itemidPos !== false) { $link = preg_replace('/Itemid(?:=[^&;]*)?/', '', $link); } } $link = JRoute::_($link, $xhtml); } return $link; }