public function init() { parent::init(); $tabs = $this->getTabs(); $type = $this->getType(); if (in_array(ucfirst($type), $this->globalTypes)) { $ltype = strtolower($type); $tabs->add('overview', array('url' => 'director', 'label' => $this->translate('Overview'))); foreach ($this->globalTypes as $tabType) { $ltabType = strtolower($tabType); $tabs->add($ltabType, array('label' => $this->translate(ucfirst($ltabType) . 's'), 'url' => sprintf('director/%ss', $ltabType))); } $tabs->activate($ltype); return; } $object = $this->dummyObject(); if ($object->isGroup()) { $type = substr($type, 0, -5); } $tabs = $this->getTabs()->add('objects', array('url' => sprintf('director/%ss', strtolower($type)), 'label' => $this->translate(ucfirst($type) . 's'))); if ($object->supportsGroups() || $object->isGroup()) { $tabs->add('objectgroups', array('url' => sprintf('director/%sgroups', $type), 'label' => $this->translate('Groups'))); } $tabs->add('tree', array('url' => sprintf('director/%ss/templatetree', $type), 'label' => $this->translate('Tree'))); }
/** * Initialize the controller and collect all tabs for it from the application and its modules * * @see ActionController::init() */ public function init() { parent::init(); $this->view->tabs = ControllerTabCollector::collectControllerTabs('PreferenceController'); }
/** * Init function. * Only administrators have access to the module. */ public function init() { parent::init(); $this->accessGranted(User::ROLE_ADMIN); }