Beispiel #1
0
 /**
  * Render the tag
  *
  * @param   array   $attribs Associative array of attributes
  * @param   string  $content The tag content
  * @return string
  */
 protected function _renderTag($attribs = array(), $content = null)
 {
     if ($this->getTemplate()->getParameters()->layout !== 'koowa') {
         $link = isset($attribs['src']) ? $attribs['src'] : false;
         $condition = isset($attribs['condition']) ? $attribs['condition'] : false;
         if (!$link) {
             $script = trim($content);
             $hash = md5($script . serialize($attribs));
             if (!isset($this->_loaded[$hash])) {
                 JFactory::getDocument()->addScriptDeclaration($script);
                 $this->_loaded[$hash] = true;
             }
         } else {
             if ($condition) {
                 $script = parent::_renderTag($attribs, $content);
                 JFactory::getDocument()->addCustomTag($script);
             } else {
                 unset($attribs['src']);
                 unset($attribs['condition']);
                 JFactory::getDocument()->addScript($link, 'text/javascript');
             }
         }
     } else {
         return parent::_renderTag($attribs, $content);
     }
 }