getUserSvc(); $usr = $usrSvc->getUser(); if (is_null($usr) || ( ( !$usrSvc->userHasPriv($usr,$system->getSiteId(),$activeInstance,'manage') ) )) throw new AccessDeniedException('not privileged'); return true; } // action helper for updateLink /** * Access check (manage) * @param string $activeInstance * instance name * @return boolean * true on success * @throws AccessDeniedException * on check fail */ protected function _updateLinkCheckPerm0($activeInstance) { $system = System::getInstance(); $usrSvc = $system->getUserSvc(); $usr = $usrSvc->getUser(); if (is_null($usr) || ( ( !$usrSvc->userHasPriv($usr,$system->getSiteId(),$activeInstance,'manage') ) )) throw new AccessDeniedException('not privileged'); return true; } // view helper for index // view helper for editCat /** * Access check (manage) * @param string $activeInstance * instance name * @return boolean * true on success * @throws AccessDeniedException * on check fail */ protected function _editCatCheckPerm0($activeInstance) { $system = System::getInstance(); $usrSvc = $system->getUserSvc(); $usr = $usrSvc->getUser(); if (is_null($usr) || ( ( !$usrSvc->userHasPriv($usr,$system->getSiteId(),$activeInstance,'manage') ) )) throw new AccessDeniedException('not privileged'); return true; } /** * Puts form code in the template based on a Category model. * * @param object $template * the target template instance * @param object $form * the source form builder instance * @param array $labels * the form field labels */ protected function _editCatFillForm0($template, $form, array $labels = array()) { $template->setParam('formstart',$form->genStart()); $template->setParam('label_id', isset($labels['label_id']) ? $labels['label_id'] : 'Id'); $template->setParam('form_id',$form->genElement('id')); $template->setParam('label_site_id', isset($labels['label_site_id']) ? $labels['label_site_id'] : 'Site_id'); $template->setParam('form_site_id',$form->genElement('site_id')); $template->setParam('label_instance', isset($labels['label_instance']) ? $labels['label_instance'] : 'Instance'); $template->setParam('form_instance',$form->genElement('instance')); $template->setParam('label_name', isset($labels['label_name']) ? $labels['label_name'] : 'Name'); $template->setParam('form_name',$form->genElement('name')); $template->setParam('label_desc', isset($labels['label_desc']) ? $labels['label_desc'] : 'Desc'); $template->setParam('form_desc',$form->genElement('desc')); $template->setParam('label_links', isset($labels['label_links']) ? $labels['label_links'] : 'Links'); $template->setParam('form_links',$form->genElement('links')); $template->setParam('submit',$form->genSubmit()); $template->setParam('formend',$form->genEnd()); } // view helper for editLink /** * Access check (manage) * @param string $activeInstance * instance name * @return boolean * true on success * @throws AccessDeniedException * on check fail */ protected function _editLinkCheckPerm0($activeInstance) { $system = System::getInstance(); $usrSvc = $system->getUserSvc(); $usr = $usrSvc->getUser(); if (is_null($usr) || ( ( !$usrSvc->userHasPriv($usr,$system->getSiteId(),$activeInstance,'manage') ) )) throw new AccessDeniedException('not privileged'); return true; } /** * Puts form code in the template based on a Link model. * * @param object $template * the target template instance * @param object $form * the source form builder instance * @param array $labels * the form field labels */ protected function _editLinkFillForm0($template, $form, array $labels = array()) { $template->setParam('formstart',$form->genStart()); $template->setParam('label_id', isset($labels['label_id']) ? $labels['label_id'] : 'Id'); $template->setParam('form_id',$form->genElement('id')); $template->setParam('label_cat_id', isset($labels['label_cat_id']) ? $labels['label_cat_id'] : 'Cat_id'); $template->setParam('form_cat_id',$form->genElement('cat_id')); $template->setParam('label_url', isset($labels['label_url']) ? $labels['label_url'] : 'Url'); $template->setParam('form_url',$form->genElement('url')); $template->setParam('label_desc', isset($labels['label_desc']) ? $labels['label_desc'] : 'Desc'); $template->setParam('form_desc',$form->genElement('desc')); $template->setParam('submit',$form->genSubmit()); $template->setParam('formend',$form->genEnd()); } }