Ejemplo n.º 1
0
 /**
  * Shows a table with all groups.
  */
 public function indexAction()
 {
     $this->getLayout()->getAdminHmenu()->add($this->getTranslator()->trans('menuAccess'), array('action' => 'index'));
     $postData = $this->getRequest()->getPost();
     $groupMapper = new GroupMapper();
     $groups = $groupMapper->getGroupList();
     $this->getView()->set('activeGroupId', 0);
     $this->getView()->set('activeGroup', null);
     foreach ($groups as $key => $group) {
         if ($group->getId() == 1) {
             unset($groups[$key]);
         }
     }
     $this->getView()->set('groups', $groups);
     if (isset($postData['groupId'])) {
         $groupId = (int) $postData['groupId'];
         $_SESSION['user']['accessGroup'] = $groupId;
     } elseif (isset($_SESSION['user']['accessGroup'])) {
         $groupId = (int) $_SESSION['user']['accessGroup'];
     } else {
         $groupId = 0;
     }
     if ($groupId) {
         $groupAccessList = $groupMapper->getGroupAccessList($groupId);
         $activeGroup = $groupMapper->getGroupById($groupId);
         $this->getView()->set('groupAccessList', $groupAccessList);
         $this->getView()->set('activeGroupId', $groupId);
         $this->getView()->set('activeGroup', $activeGroup);
     }
     $moduleMapper = new ModuleMapper();
     $modules = $moduleMapper->getModules();
     $pageMapper = new PageMapper();
     $pages = $pageMapper->getPageList();
     $articleMapper = new ArticleMapper();
     $articles = $articleMapper->getArticles();
     $boxMapper = new BoxMapper();
     $boxes = $boxMapper->getBoxList($this->getTranslator()->getLocale());
     $accessTypes = array('module' => $modules, 'page' => $pages, 'article' => $articles, 'box' => $boxes);
     $this->getView()->set('accessTypes', $accessTypes);
 }
Ejemplo n.º 2
0
 public function indexAction()
 {
     $articleMapper = new ArticleMapper();
     $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuArticle'), array('action' => 'index'));
     $this->getView()->set('articles', $articleMapper->getArticles($this->locale));
 }