public function getContentSpans() { if ($this->_hasSetting('contentSpans')) { return $this->_getSetting('contentSpans'); } if ($this->getData()->isPage) { $componentWithMaster = Kwf_Component_View_Helper_Master::getComponentsWithMasterTemplate($this->getData()); $last = array_pop($componentWithMaster); if ($last && $last['type'] == 'master') { $p = $last['data']; } else { $p = Kwf_Component_Data_Root::getInstance(); // for tests } return $p->getComponent()->_getMasterChildContentSpans($this->getData()); } else { if (!$this->getData()->parent) { throw new Kwf_Exception("Can't detect contentSpans, use contentSpans setting for '" . $this->getData()->componentClass . "'"); } return $this->getData()->parent->getComponent()->_getChildContentSpans($this->getData()); } }
public function getContentWidth(Kwf_Component_Data $data) { if ($this->_hasSetting('contentWidth')) { return $this->_getSetting('contentWidth'); } if ($data->isPage || isset($data->box)) { $componentWithMaster = Kwf_Component_View_Helper_Master::getComponentsWithMasterTemplate($data); $last = array_pop($componentWithMaster); if ($last && $last['type'] == 'master') { $p = $last['data']; } else { $p = Kwf_Component_Data_Root::getInstance(); // for tests } return Kwf_Component_MasterLayout_Abstract::getInstance($p->componentClass)->getContentWidth($data); } else { if (!$data->parent) { throw new Kwf_Exception("Can't detect contentWidth, use contentWidth setting for '" . $data->componentClass . "'"); } return self::getInstance($data->parent->componentClass)->getChildContentWidth($data->parent, $data); } }