protected function _render($includeMaster, &$hasDynamicParts) { header('X-Robots-Tag: noindex'); $domain = 'http' . (isset($_SERVER['HTTPS']) ? 's' : '') . '://' . $_SERVER['HTTP_HOST']; $ret = parent::_render($includeMaster, $hasDynamicParts); $ret = preg_replace('#(href|src)=(["\'])(/[^/])#', '$1=$2' . $domain . '$3', $ret); $up = Kwf_Config::getValue('uniquePrefix'); $up = $up ? $up . '-' : ''; $class = str_replace('kwfUp-', $up, Kwf_Component_Abstract::formatRootElementClass($this->_data->componentClass, '') . 'Master'); $ret = preg_replace('#<body class="([^"]+)"#', '<body class="\\1 ' . $class . '" data-' . $up . 'base-url="' . $domain . '" ', $ret); return $ret; }
private function _getKwcClass() { $kwcClass = Kwf_Component_Abstract::formatRootElementClass($this->_componentClass, ''); if ($this->_isMaster) { $kwcClass .= 'Master'; } if (Kwf_Config::getValue('application.uniquePrefix')) { $kwcClass = str_replace('kwfUp-', Kwf_Config::getValue('application.uniquePrefix') . '-', $kwcClass); } else { $kwcClass = str_replace('kwfUp-', '', $kwcClass); } return $kwcClass; }
public function getTemplateVars() { $ret = parent::getTemplateVars(); $ret['paragraphs'] = array(); foreach ($this->getData()->getChildComponents(array('generator' => 'paragraphs')) as $paragraph) { $cssClass = $this->_getBemClass('kwcParagraphItem'); $row = $paragraph->getRow(); if ($this->_getSetting('useMobileBreakpoints') && $row->device_visible) { $cssClass .= ' ' . $this->_getBemClass($row->device_visible); } $cssClass .= ' ' . $this->_getBemClass('outer' . ucfirst($paragraph->row->component), 'outer' . ucfirst(Kwf_Component_Abstract::formatRootElementClass($paragraph->componentClass, ''))); $ret['paragraphs'][] = array('data' => $paragraph, 'class' => $cssClass); } return $ret; }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); $ret['paragraphs'] = array(); foreach ($this->getData()->getChildComponents(array('generator' => 'paragraphs')) as $paragraph) { $cssClass = $this->_getBemClass('kwcParagraphItem'); $row = $paragraph->getRow(); if ($this->_getSetting('useMobileBreakpoints') && $row->device_visible) { $cssClass .= ' ' . $this->_getBemClass($row->device_visible); } $cssClass .= ' ' . $this->_getBemClass('outer' . ucfirst($paragraph->row->component), 'outer' . ucfirst(substr(Kwf_Component_Abstract::formatRootElementClass($paragraph->componentClass, ''), 6))); $preHtml = ''; $postHtml = ''; foreach (Kwf_Component_Data_Root::getInstance()->getPlugins('Kwf_Component_PluginRoot_Interface_MaskComponent') as $plugin) { $mask = $plugin->getMaskCode($paragraph); $preHtml = $mask['begin'] . $preHtml; $postHtml = $postHtml . $mask['end']; } $ret['paragraphs'][] = array('data' => $paragraph, 'class' => $cssClass, 'preHtml' => $preHtml, 'postHtml' => $postHtml); } return $ret; }
/** * Returns the processed rootElementClass used in various places for a component * * @param string|Kwf_Component_Data * @return string */ public static function getRootElementClass($component) { if (!is_string($component)) { $component = $component->getData()->componentClass; } $ret = ''; if (self::hasSetting($component, 'rootElementClass')) { $ret .= self::getSetting($component, 'rootElementClass') . ' '; } $ret .= Kwf_Component_Abstract::formatRootElementClass($component, ''); return $ret; }