protected function _getParentResource(Kwf_Acl $acl, $type) { if (!$acl->has('kwc_newsletter')) { $acl->add(new Kwf_Acl_Resource_MenuDropdown('kwc_newsletter', array('text' => trlKwfStatic('Newsletter'), 'icon' => 'email_open_image.png')), 'kwf_component_root'); } return 'kwc_newsletter'; }
public function addResources(Kwf_Acl $acl) { if (!$acl->has('kwc_shop')) { $acl->add(new Kwf_Acl_Resource_MenuDropdown('kwc_shop', array('text' => trlKwfStatic('Shop'), 'icon' => 'cart.png')), 'kwf_component_root'); } $acl->add(new Kwf_Acl_Resource_ComponentClass_MenuUrl($this->_class, array('text' => trlKwfStatic('Vouchers'), 'icon' => 'application_view_list.png'), Kwc_Admin::getInstance($this->_class)->getControllerUrl('Vouchers')), 'kwc_shop'); }
public function addResources(Kwf_Acl $acl) { $masterCls = $this->_getSetting('masterComponentClass'); if (Kwc_Abstract::hasSetting($this->_class, 'componentNameShort')) { $name = Kwc_Abstract::getSetting($this->_class, 'componentNameShort'); } else { $name = Kwc_Abstract::getSetting($this->_class, 'componentName'); } $icon = Kwc_Abstract::getSetting($this->_class, 'componentIcon'); // **** create dropdown $dropdownName = 'kwc_' . $masterCls; if (!$acl->has($dropdownName)) { $acl->addResource(new Kwf_Acl_Resource_MenuDropdown($dropdownName, array('text' => $name, 'icon' => $icon)), $this->_getParentResource($acl)); } // **** modify master component $masterComponents = Kwf_Component_Data_Root::getInstance()->getComponentsBySameClass($masterCls, array('ignoreVisible' => true)); //add language name to menu text foreach ($masterComponents as $c) { $resource = $acl->get('kwc_' . $c->dbId); $mc = $resource->getMenuConfig(); $mc['text'] .= ' (' . $c->getBaseProperty('language') . ')'; $resource->setMenuConfig($mc); } if (count($masterComponents) > 1) { //already in dropdown } else { if (count($masterComponents) == 1) { //just one, move into dropdown $c = $masterComponents[0]; $resource = $acl->get('kwc_' . $c->dbId); $acl->remove($resource); $acl->addResource($resource, $dropdownName); } } // *** add own $components = Kwf_Component_Data_Root::getInstance()->getComponentsBySameClass($this->_class, array('ignoreVisible' => true)); foreach ($components as $c) { $t = $c->getTitle(); if (!$t) { $t = $name; } if ($domain = $c->getParentByClass('Kwc_Root_DomainRoot_Domain_Component')) { $t .= " ({$domain->name})"; } $t .= ' (' . $c->getBaseProperty('language') . ')'; $acl->add(new Kwf_Acl_Resource_Component_MenuUrl($c, array('text' => $t, 'icon' => $icon)), $dropdownName); } }
public function addResources(Kwf_Acl $acl) { if (!$acl->has('kwc_shop')) { $acl->add(new Kwf_Acl_Resource_MenuDropdown('kwc_shop', array('text' => trlKwf('Shop'), 'icon' => 'cart.png')), 'kwf_component_root'); } $components = Kwf_Component_Data_Root::getInstance()->getComponentsBySameClass($this->_class, array('ignoreVisible' => true)); $icon = Kwc_Abstract::getSetting($this->_class, 'componentIcon'); foreach ($components as $c) { $text = Kwc_Abstract::getSetting($this->_class, 'componentName'); if (count($components) > 1) { if ($domain = $c->getParentByClass('Kwc_Root_DomainRoot_Domain_Component')) { $text .= " ({$domain->name})"; } } $acl->add(new Kwf_Acl_Resource_Component_MenuUrl($c, array('text' => $text, 'icon' => $icon), Kwc_Admin::getInstance($c->componentClass)->getControllerUrl('Orders') . '?componentId=' . $c->dbId), 'kwc_shop'); } }
public function addResources(Kwf_Acl $acl) { $components = Kwf_Component_Data_Root::getInstance()->getComponentsBySameClass($this->_class, array('ignoreVisible' => true)); if (Kwc_Abstract::hasSetting($this->_class, 'componentNameShort')) { $name = Kwc_Abstract::getSetting($this->_class, 'componentNameShort'); } else { $name = Kwc_Abstract::getSetting($this->_class, 'componentName'); } $icon = Kwc_Abstract::getSetting($this->_class, 'componentIcon'); if (count($components)) { $dropdownName = 'kwc_' . $this->_class; if (!$acl->has($dropdownName)) { $dropDown = new Kwf_Acl_Resource_MenuDropdown($dropdownName, array('text' => $name, 'icon' => $icon)); $dropDown->setCollapseIfSingleChild(true); $acl->add($dropDown, $this->_getParentResource($acl)); } foreach ($components as $c) { $t = $this->_getResourceText($c); $acl->add(new Kwf_Acl_Resource_Component_MenuUrl($c, array('text' => $t, 'icon' => $icon)), $dropdownName); } } }
public function addResources(Kwf_Acl $acl) { if (!$acl->has('kwc_Kwc_Editable')) { $acl->add(new Kwc_Editable_AdminResource($this->_class, array('text' => trlKwf('Texts'), 'icon' => 'page_white_text.png'), Kwc_Admin::getInstance($this->_class)->getControllerUrl('Components')), 'kwf_component_root'); } }