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 board // view helper for boardEdit /** * Access check (manage) * @param string $activeInstance * instance name * @return boolean * true on success * @throws AccessDeniedException * on check fail */ protected function _boardEditCheckPerm0($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 field code in the template based on a Board model. * Ignored fields: id,site_id,instance,postVoting,postAttachments,topicCount,postCount * @param object $template * the target template instance * @param object $form * the source form builder instance * @param array $labels * the form field labels */ protected function _boardEditFillForm0($template, $form, array $labels = array()) { $template->setParam('label_category_id', isset($labels['label_category_id']) ? $labels['label_category_id'] : 'Category_id'); $template->setParam('form_category_id',$form->genElement('category_id')); $template->setParam('label_acc_public', isset($labels['label_acc_public']) ? $labels['label_acc_public'] : 'Acc_public'); $template->setParam('form_acc_public',$form->genElement('acc_public')); $template->setParam('label_acc_user', isset($labels['label_acc_user']) ? $labels['label_acc_user'] : 'Acc_user'); $template->setParam('form_acc_user',$form->genElement('acc_user')); $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')); } // view helper for boardACL /** * Access check (manage) * @param string $activeInstance * instance name * @return boolean * true on success * @throws AccessDeniedException * on check fail */ protected function _boardACLCheckPerm0($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 topic // view helper for topicNew // view helper for topicEdit /** * Puts form code in the template based on a Topic 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 _topicEditFillForm0($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_board_id', isset($labels['label_board_id']) ? $labels['label_board_id'] : 'Board_id'); $template->setParam('form_board_id',$form->genElement('board_id')); $template->setParam('label_state', isset($labels['label_state']) ? $labels['label_state'] : 'State'); $template->setParam('form_state',$form->genElement('state')); $template->setParam('label_title', isset($labels['label_title']) ? $labels['label_title'] : 'Title'); $template->setParam('form_title',$form->genElement('title')); $template->setParam('label_desc', isset($labels['label_desc']) ? $labels['label_desc'] : 'Desc'); $template->setParam('form_desc',$form->genElement('desc')); $template->setParam('label_created_by_id', isset($labels['label_created_by_id']) ? $labels['label_created_by_id'] : 'Created_by_id'); $template->setParam('form_created_by_id',$form->genElement('created_by_id')); $template->setParam('label_created_by_name', isset($labels['label_created_by_name']) ? $labels['label_created_by_name'] : 'Created_by_name'); $template->setParam('form_created_by_name',$form->genElement('created_by_name')); $template->setParam('label_created_at', isset($labels['label_created_at']) ? $labels['label_created_at'] : 'Created_at'); $template->setParam('form_created_at',$form->genElement('created_at')); $template->setParam('label_update_count', isset($labels['label_update_count']) ? $labels['label_update_count'] : 'Update_count'); $template->setParam('form_update_count',$form->genElement('update_count')); $template->setParam('label_last_updated_at', isset($labels['label_last_updated_at']) ? $labels['label_last_updated_at'] : 'Last_updated_at'); $template->setParam('form_last_updated_at',$form->genElement('last_updated_at')); $template->setParam('label_last_updated_by_id', isset($labels['label_last_updated_by_id']) ? $labels['label_last_updated_by_id'] : 'Last_updated_by_id'); $template->setParam('form_last_updated_by_id',$form->genElement('last_updated_by_id')); $template->setParam('label_readcount', isset($labels['label_readcount']) ? $labels['label_readcount'] : 'Readcount'); $template->setParam('form_readcount',$form->genElement('readcount')); $template->setParam('label_answers', isset($labels['label_answers']) ? $labels['label_answers'] : 'Answers'); $template->setParam('form_answers',$form->genElement('answers')); $template->setParam('submit',$form->genSubmit()); $template->setParam('formend',$form->genEnd()); } /** * Puts form code in the template based on a Post 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 _topicEditFillForm1($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_topic_id', isset($labels['label_topic_id']) ? $labels['label_topic_id'] : 'Topic_id'); $template->setParam('form_topic_id',$form->genElement('topic_id')); $template->setParam('label_created_by_id', isset($labels['label_created_by_id']) ? $labels['label_created_by_id'] : 'Created_by_id'); $template->setParam('form_created_by_id',$form->genElement('created_by_id')); $template->setParam('label_created_by_name', isset($labels['label_created_by_name']) ? $labels['label_created_by_name'] : 'Created_by_name'); $template->setParam('form_created_by_name',$form->genElement('created_by_name')); $template->setParam('label_created_at', isset($labels['label_created_at']) ? $labels['label_created_at'] : 'Created_at'); $template->setParam('form_created_at',$form->genElement('created_at')); $template->setParam('label_update_count', isset($labels['label_update_count']) ? $labels['label_update_count'] : 'Update_count'); $template->setParam('form_update_count',$form->genElement('update_count')); $template->setParam('label_last_updated_at', isset($labels['label_last_updated_at']) ? $labels['label_last_updated_at'] : 'Last_updated_at'); $template->setParam('form_last_updated_at',$form->genElement('last_updated_at')); $template->setParam('label_last_updated_by_id', isset($labels['label_last_updated_by_id']) ? $labels['label_last_updated_by_id'] : 'Last_updated_by_id'); $template->setParam('form_last_updated_by_id',$form->genElement('last_updated_by_id')); $template->setParam('label_post', isset($labels['label_post']) ? $labels['label_post'] : 'Post'); $template->setParam('form_post',$form->genElement('post')); $template->setParam('submit',$form->genSubmit()); $template->setParam('formend',$form->genEnd()); } // view helper for postNew // view helper for postEdit }