private function _getContentChild() { $model = $this->getOwnModel(); $masterChild = $this->getData()->chained->getComponent()->getContentChild(); $c = Kwc_Chained_Trl_Component::getChainedByMaster($masterChild, $this->getData()); $page = $this->getData(); while ($c && (!$c->hasContent() || $this->_getSetting('hasVisible') && $c->parent->getComponent()->getRow() && !$c->parent->getComponent()->getRow()->visible)) { while ($page && !$page->inherits) { $page = $page->parent; if ($page instanceof Kwf_Component_Data_Root) { break; } } if (!isset($page->chained)) { $c = null; break; } $masterChild = $page->chained->getChildComponent('-' . $this->getData()->id)->getChildComponent(array('generator' => 'child')); $c = Kwc_Chained_Trl_Component::getChainedByMaster($masterChild, $this->getData()); if ($page instanceof Kwf_Component_Data_Root) { break; } $page = $page->parent; } return $c; }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); $ret['paypalButton'] = $this->_getPaypalButton(); $ret['options'] = array('controllerUrl' => Kwc_Admin::getInstance($this->getData()->componentClass)->getControllerUrl() . '/json-confirm-order', 'params' => array('paymentComponentId' => $this->getData()->parent->componentId)); return $ret; }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); $ret['workingPosition'] = $this->_getRow()->working_position; $ret['vcard'] = $this->getData()->getChildComponent('_vcard'); return $ret; }
public static function getSettings($masterComponentClass = null) { $ret = parent::getSettings($masterComponentClass); $ret['ownModel'] = 'Kwf_Component_FieldModel'; $ret['generators']['mail'] = array('class' => 'Kwf_Component_Generator_Static', 'component' => 'Kwc_Mail_Trl_Mail_Component.' . $masterComponentClass); return $ret; }
public function getTemplateVars() { $ret = parent::getTemplateVars(); $page = $this->getData()->getPage(); $ret['childPages'] = $page->getChildPages(); return $ret; }
public function getTemplateVars() { $ret = parent::getTemplateVars(); $menu = array(); $masterMenu = $this->getData()->chained->getComponent()->getMenuData(null, array('ignoreVisible' => true)); foreach ($masterMenu as $m) { $component = Kwc_Chained_Trl_Component::getChainedByMaster($m['data'], $this->getData()); if ($component) { $m['submenu'] = array(); $masterSubMenu = $this->getData()->chained->getComponent()->getMenuData($m['data'], array('ignoreVisible' => true), 'Kwc_Menu_Expanded_EditableItems_Component'); foreach ($masterSubMenu as $sm) { $sComponent = Kwc_Chained_Trl_Component::getChainedByMaster($sm['data'], $this->getData()); if ($sComponent) { $sm['data'] = $sComponent; $sm['text'] = $sComponent->name; $m['submenu'][] = $sm; } } $this->_attachEditableToMenuData($m['submenu']); $m['data'] = $component; $m['text'] = $component->name; $menu[] = $m; } } $ret['menu'] = $menu; return $ret; }
public final function getLinkedData() { if (!isset($this->_data)) { $masterLinkData = $this->chained->getLinkedData(array('ignoreVisible' => true)); if (!$masterLinkData) { $this->_data = false; } if ($masterLinkData) { if (is_null($this->_type)) { throw new Kwf_Exception("_type may not be null"); } if ($this->_type == 'Trl') { $linkComponent = Kwc_Chained_Trl_Component::getChainedByMaster($masterLinkData, $this); } else { if ($this->_type == 'Cc') { $linkComponent = Kwc_Chained_Cc_Component::getChainedByMaster($masterLinkData, $this); } } if (!$linkComponent) { $this->_data = false; //kann offline sein } else { $this->_data = $linkComponent; } } } return $this->_data; }
public function getTemplateVars() { $ret = parent::getTemplateVars(); $ret['imageUrl'] = $this->getImageUrl(); $ret['imagePage'] = $this->getData()->getChildComponent('_imagePage'); return $ret; }
public final function getLinkedData() { if (!isset($this->_data)) { $masterLinkData = $this->chained->getLinkedData(array('ignoreVisible' => true)); if (!$masterLinkData) { $this->_data = false; } if ($masterLinkData) { if (is_null($this->_type)) { throw new Kwf_Exception("_type may not be null"); } if ($this->_type == 'Trl') { $linkComponent = Kwc_Chained_Trl_Component::getChainedByMaster($masterLinkData, $this); } else { if ($this->_type == 'Cc') { $linkComponent = Kwc_Chained_Cc_Component::getChainedByMaster($masterLinkData, $this); } } if (!$linkComponent) { $this->_data = false; //kann offline sein } else { $this->_data = $linkComponent; } } } $m = Kwc_Abstract::createModel($this->chained->componentClass); $result = $m->fetchColumnsByPrimaryId(array('anchor'), $this->chained->dbId); if ($result['anchor']) { $this->_anchor = $result['anchor']; } return $this->_data; }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); $ret['imageUrl'] = $this->getImageUrl(); $ret['imagePage'] = $this->getData()->getChildComponent('_imagePage'); return $ret; }
public static function getSettings($masterComponent) { $ret = parent::getSettings($masterComponent); $ret['ownModel'] = new Kwf_Model_FnF(array('primaryKey' => 'component_id')); $ret['componentName'] = 'Test Trl'; return $ret; }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); $page = $this->getData()->getPage(); $ret['childPages'] = $page->getChildPages(); return $ret; }
public static function getSettings($masterComponentClass) { $ret = parent::getSettings($masterComponentClass); $ret['generators']['page']['class'] = 'Kwc_Root_Category_Trl_Generator'; $ret['generators']['page']['model'] = 'Kwc_Root_Category_Trl_GeneratorModel'; return $ret; }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); $ret['headline1'] = $this->_getRow()->headline1; $ret['headline2'] = $this->_getRow()->headline2; return $ret; }
public function getTemplateVars() { $ret = parent::getTemplateVars(); $children = $this->getData()->getChildComponents($this->getData()->chained->getComponent()->getSelect()); // children ist die alte methode, bleibt drin wegen kompatibilität $ret['children'] = $children; // das hier ist die neue variante und ist besser, weil man leichter mehr daten // zurückgeben kann, bzw. in der übersetzung überschreiben kann // zB: Breite bei übersetzung von Columns $ret['listItems'] = array(); $i = 0; foreach ($children as $child) { $class = 'listItem '; if ($i == 0) { $class .= 'kwcFirst '; } if ($i == count($children) - 1) { $class .= 'kwcLast '; } if ($i % 2 == 0) { $class .= 'kwcEven '; } else { $class .= 'kwcOdd '; } $class = trim($class); $i++; $ret['listItems'][] = array('data' => $this->getData()->chained->getComponent()->getItemComponent($child), 'class' => $class, 'style' => ''); } return $ret; }
public function getTemplateVars() { $ret = parent::getTemplateVars(); $ret['headline1'] = $this->_getRow()->headline1; $ret['headline2'] = $this->_getRow()->headline2; return $ret; }
public function getTemplateVars() { $ret = parent::getTemplateVars(); $ret['workingPosition'] = $this->_getRow()->working_position; $ret['vcard'] = $this->getData()->getChildComponent('_vcard'); return $ret; }
public function attachEditableToMenuData(&$menuData) { foreach ($menuData as $k => &$m) { if (isset($m['editable']) && $m['editable']) { $m['editable'] = Kwc_Chained_Trl_Component::getChainedByMaster($m['editable'], $this->getData()); } } }
public function onMasterMediaCacheChanged(Kwf_Events_Event_Media_Changed $e) { foreach (Kwc_Chained_Trl_Component::getAllChainedByMaster($e->component, 'Trl') as $chained) { if (!$chained->getComponent()->getRow()->own_download) { $this->fireEvent(new Kwf_Events_Event_Media_Changed($this->_class, $chained)); } } }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); $ret['link1'] = Kwc_Chained_Trl_Component::getChainedByMaster($ret['link1'], $this->getData()); $ret['link4'] = Kwc_Chained_Trl_Component::getChainedByMaster($ret['link4'], $this->getData()); $ret['link5'] = Kwc_Chained_Trl_Component::getChainedByMaster($ret['link5'], $this->getData()); return $ret; }
public function getTemplateVars() { $ret = parent::getTemplateVars(); $ret['link1'] = Kwc_Chained_Trl_Component::getChainedByMaster($ret['link1'], $this->getData()); $ret['link4'] = Kwc_Chained_Trl_Component::getChainedByMaster($ret['link4'], $this->getData()); $ret['link5'] = Kwc_Chained_Trl_Component::getChainedByMaster($ret['link5'], $this->getData()); return $ret; }
public static function duplicated(Kwf_Component_Data $source, Kwf_Component_Data $new) { $chained = Kwf_Component_Data_Root::getInstance()->getComponentsByClass('Kwc_Root_TrlRoot_Chained_Component', array('ignoreVisible' => true)); //bySameClass wenn fkt nicht mehr static (todo oben erledigt) $sourceChained = array(); foreach ($chained as $c) { $subRootAboveTrl = $c; //eg. domain while ($subRootAboveTrl = $subRootAboveTrl->parent) { if (Kwc_Abstract::getFlag($subRootAboveTrl->componentClass, 'subroot')) { break; } } if (!$subRootAboveTrl) { $subRootAboveTrl = Kwf_Component_Data_Root::getInstance(); } $d = $source; while ($d = $d->parent) { if ($d->componentId == $subRootAboveTrl->componentId) { $sourceChained[$c->getLanguage()] = $c; } } } $targetChained = array(); foreach ($chained as $c) { $subRootAboveTrl = $c; //eg. domain while ($subRootAboveTrl = $subRootAboveTrl->parent) { if (Kwc_Abstract::getFlag($subRootAboveTrl->componentClass, 'subroot')) { break; } } if (!$subRootAboveTrl) { $subRootAboveTrl = Kwf_Component_Data_Root::getInstance(); } $d = $new; while ($d = $d->parent) { if ($d->componentId == $subRootAboveTrl->componentId) { if (isset($sourceChained[$c->getLanguage()])) { //only if there is a source language $targetChained[] = array('targetChained' => $c, 'sourceChained' => $sourceChained[$c->getLanguage()]); } } } } foreach ($targetChained as $c) { $sourceChained = Kwc_Chained_Trl_Component::getChainedByMaster($source, $c['sourceChained'], array('ignoreVisible' => true)); $newChained = Kwc_Chained_Trl_Component::getChainedByMaster($new, $c['targetChained'], array('ignoreVisible' => true)); if (!$sourceChained || $source->componentId == $sourceChained->componentId) { continue; //wenn sourceChained nicht gefunden handelt es sich zB um ein MasterAsChild - was ignoriert werden muss } if (!$newChained) { throw new Kwf_Exception("can't find chained components"); } Kwc_Admin::getInstance($newChained->componentClass)->duplicate($sourceChained, $newChained); } }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); $c = $this->getData()->parent->chained->componentClass; if (!is_instance_of($c, 'Kwc_Shop_Cart_Checkout_Payment_None_Component')) { $ret['paymentTypeText'] = $this->getData()->trlStaticExecute(Kwc_Abstract::getSetting($c, 'componentName')); } return $ret; }
public function getTemplateVars() { $ret = parent::getTemplateVars(); if ($this->getRow()->own_flash) { $tvars = $this->getData()->getChildComponent('-flash')->getComponent()->getTemplateVars(); $ret['flash'] = $tvars['flash']; } return $ret; }
public static function getSettings($masterComponentClass) { $ret = parent::getSettings($masterComponentClass); $ret['ownModel'] = 'Kwf_Component_FieldModel'; $ret['flags']['formField'] = true; $ret['viewCache'] = false; $ret['extConfig'] = 'Kwf_Component_Abstract_ExtConfig_Form'; return $ret; }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); if ($this->getRow()->own_flash) { $tvars = $this->getData()->getChildComponent('-flash')->getComponent()->getTemplateVars($renderer); $ret['flash'] = $tvars['flash']; } return $ret; }
protected function _createData($parentData, $row, $select) { $ret = parent::_createData($parentData, $row, $select); $ret->targetPage = Kwc_Chained_Trl_Component::getChainedByMaster($row->targetPage, $parentData, array('ignoreVisible' => $select->getPart(Kwf_Component_Select::IGNORE_VISIBLE))); if (!$ret->targetPage) { return null; } return $ret; }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); if ($renderer && $renderer instanceof Kwf_Component_Renderer_Mail) { $order = $renderer->getRecipient(); $ret['items'] = $order->getProductsDataWithProduct($this->getData()); } return $ret; }
public function hasContent() { if ($this->getRow()->own_url) { if (Kwc_Advanced_CommunityVideo_Component::getVideoUrl($this->getRow()->url, $this->getData()->chained->getComponent()->getRow())) { return true; } return false; } return parent::hasContent(); }
public function getTemplateVars(Kwf_Component_Renderer_Abstract $renderer) { $ret = parent::getTemplateVars($renderer); $ret['target'] = self::getChainedByMaster($ret['target'], $this->getData()); $ret['listHtml'] = ''; if ($ret['target']) { $ret['listHtml'] = Kwc_Advanced_Sitemap_Component::getListHtml($renderer, $ret['target'], 0, $ret['levels'], $this->getData()->componentClass); } return $ret; }