public function managerAction() { /** * Check permission */ if (false == $this->checkPermission('see_permission')) { $this->_forwardToNoPermissionPage(); return; } $this->view->headTitle(Vi_Language::translate('Permission manager')); $this->view->menu = array('usergroup', 'permissionmanager'); $config = Vi_Registry::getConfig(); /** * Load all groups */ $objGroup = new Models_Group(); /** * Set values for tempalte */ $this->view->allGroups = $objGroup->getAll(array('sorting ASC', 'group_id ASC'))->toArray(); /** * Get all applications */ $allApps = Vi_Folder::getFolders('applications'); foreach ($allApps as $index => $app) { if (!is_dir("applications/{$app}")) { unset($allApps[$index]); } } $this->view->allApps = $allApps; /** * Get all modules */ $allModules = Vi_Folder::getFolders('modules'); foreach ($allModules as $index => $module) { if (!is_dir("modules/{$module}")) { unset($allModules[$index]); } } $this->view->allModules = $allModules; $this->view->permissionMessage = $this->session->permissionMessage; $this->session->permissionMessage = null; }
/** * ###################################### GROUP FUNCTIONS ############################################## */ public function groupManagerAction() { /** * Check permission */ if (false == $this->checkPermission('see_group')) { $this->_forwardToNoPermissionPage(); return; } $this->view->headTitle(Vi_Language::translate('Group manager')); $this->view->menu = array('usergroup', 'groupmanager'); $config = Vi_Registry::getConfig(); $numRowPerPage = Vi_Registry::getConfig("defaultNumberRowPerPage"); $currentPage = $this->_getParam("page", 1); $displayNum = $this->_getParam('displayNum', false); /** * Get number of groups per page */ if (false === $displayNum) { $displayNum = $this->session->groupDisplayNum; } else { $this->session->groupDisplayNum = $displayNum; } if (null != $displayNum) { $numRowPerPage = $displayNum; } /** * Load all groups */ $objGroup = new Models_Group(); $allGroups = $objGroup->getAll('sorting ASC')->toArray(); /** * Count all groups */ $count = count($allGroups); /** * Load all groups */ /** * Set values for tempalte */ $this->setPagination($numRowPerPage, $currentPage, $count); $this->view->allGroups = $allGroups; $this->view->groupMessage = $this->session->groupMessage; $this->session->groupMessage = null; $this->view->displayNum = $numRowPerPage; }