/** * Fix link in the canonical metatag * It works only with * - item * - category */ public function canonicalFix() { if (!$this->_jbrequest->is('option', 'com_zoo')) { return null; } $this->_jbdebug->mark('jbzoo-sef::canonicalFix::start'); $flags = array($this->_jbrequest->getWord('task'), $this->_jbrequest->getWord('view'), $this->_jbrequest->getWord('layout')); $newCanUrl = null; if (in_array('item', $flags)) { $itemId = $this->_jbrequest->getSystem('item'); $newCanUrl = $this->_getUrl($this->_itemTable->get($itemId), 'item'); } else { if (in_array('category', $flags)) { $categoryId = $this->_jbrequest->getSystem('category'); $newCanUrl = $this->_getUrl($this->_catTable->get($categoryId), 'category'); } } if ($newCanUrl) { // remove all canocical link $headData = $this->_joomlaDoc->getHeadData(); $canKey = array_search(array('relation' => 'canonical', 'relType' => 'rel', 'attribs' => array()), $headData['links']); unset($headData['links'][$canKey]); $this->_joomlaDoc->setHeadData($headData); // set new url $baseUrl = $this->_jbrouter->getHostUrl(); $this->_joomlaDoc->addHeadLink($baseUrl . $newCanUrl, 'canonical'); } $this->_jbdebug->mark('jbzoo-sef::canonicalFix::finish'); }
/** * @param Application $app */ public function __construct($app) { parent::__construct($app); return; // for debug only if (JFactory::getApplication()->isSite() && self::$_jbdump === null) { if (class_exists('jbdump')) { // jbdump plugin self::$_jbdump = JBDump::i($this->_jbdumpParams); } } }
/** * @param Application $app */ public function __construct($app) { parent::__construct($app); return; // for debug only if (self::$_jbdump === null) { // Joomla standart profiler if (JDEBUG) { self::$_jbdump = JProfiler::getInstance('Application'); } // jbdump plugin if (class_exists('jbdump')) { self::$_jbdump = JBDump::i($this->_jbdumpParams); } } }