protected function checkAllowed() { $valid = Kwf_Media_Output_Component::isValid($this->_data->componentId); if ($valid == Kwf_Media_Output_IsValidInterface::ACCESS_DENIED) { // send non pdf content to show login-plugin $contentSender = new Kwf_Component_Abstract_ContentSender_Default($this->_data); $contentSender->sendContent(true); return false; } else { if ($valid == Kwf_Media_Output_IsValidInterface::INVALID) { throw new Kwf_Exception_NotFound(); } } return $valid; }
public function getLinkDataAttributes() { $ret = parent::getLinkDataAttributes(); $config = array('componentId' => $this->_data->componentId, 'viewComponentId' => $this->_data->getChildComponent('-view')->componentId); $ret['kwc-view-ajax-filter'] = json_encode($config); return $ret; }
public function sendContent($includeMaster) { //show content only in preview, else a 404 if (!Kwf_Component_Data_Root::getShowInvisible()) { throw new Kwf_Exception_NotFound(); } parent::sendContent($includeMaster); }
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; }
protected function _render($includeMaster, &$hasDynamicParts) { $component = $this->_data->parent->getComponent(); $largeContent = $component->getLargeComponent($this->_data); if ($includeMaster) { $plugin = Kwf_Component_Plugin_Abstract::getInstance('Kwc_List_Switch_LargeContentPlugin', $this->_data->parent->componentId); $plugin->setCurrentItem($largeContent); $plugin->setCurrentPreview($component->getPreviewComponent($this->_data)); //render parent, will include largeContent $data = $this->_data->getParentPage(); } else { //render large $data = $largeContent; } if ($data == $this->_data) { return parent::_render($includeMaster, $hasDynamicParts); } else { $parentContentSender = Kwc_Abstract::getSetting($data->componentClass, 'contentSender'); $parentContentSender = new $parentContentSender($data); return $parentContentSender->_render($includeMaster, $hasDynamicParts); } }
public function getLinkDataAttributes() { $ret = parent::getLinkDataAttributes(); $ret['kwc-lightbox'] = json_encode((object) $this->_getOptions()); return $ret; }
public function testRemoveContainsProcessInput() { $c = $this->_root->getComponentById('4'); $pi = Kwf_Component_Abstract_ContentSender_Default::__getProcessInputComponents($c); $this->assertEquals(2, count($pi)); $m = Kwf_Model_Abstract::getInstance('Kwf_Component_Cache_ProcessInput_Paragraphs_TestModel'); $row = $m->getRow(2); $row->delete(); $this->_process(); $c = $this->_root->getComponentById('4'); $pi = Kwf_Component_Abstract_ContentSender_Default::__getProcessInputComponents($c); $this->assertEquals(1, count($pi)); $pi = array_values($pi); $this->assertEquals('4-1', $pi[0]->componentId); }