public function indexAction() { $statisticMapper = new StatisticMapper(); $moduleMapper = new ModuleMapper(); $this->getLayout()->getHmenu()->add($this->getTranslator()->trans('menuStatistic'), array('action' => 'index')); $date = new \Ilch\Date(); $this->getView()->set('dateCmsInstalled', $this->getConfig()->get('date_cms_installed')); $this->getView()->set('registUserCount', $statisticMapper->getRegistUserCount()); $this->getView()->set('registNewUser', $statisticMapper->getRegistNewUser()); $this->getView()->set('articlesCount', $statisticMapper->getArticlesCount()); $this->getView()->set('commentsCount', $statisticMapper->getCommentsCount()); $this->getView()->set('modulesCount', $statisticMapper->getModulesCount()); $this->getView()->set('CMSVersion', $this->getConfig()->get('version')); $this->getView()->set('modules', $moduleMapper->getModules()); $this->getView()->set('visitsToday', $statisticMapper->getVisitsCount($date->format('Y-m-d'))); $this->getView()->set('visitsMonth', $statisticMapper->getVisitsMonthCount()); $this->getView()->set('visitsYear', $statisticMapper->getVisitsYearCount()); $this->getView()->set('visitsTotal', $statisticMapper->getVisitsCount($date->format('Y-m-d'))); $this->getView()->set('visitsYearTotal', $statisticMapper->getVisitsCount('', $date->format('Y'))); $this->getView()->set('visitsAllTotal', $statisticMapper->getVisitsCount()); $this->getView()->set('statisticHourList', $statisticMapper->getVisitsHour()); $this->getView()->set('statisticDayList', $statisticMapper->getVisitsDay()); $this->getView()->set('statisticYearMonthDayList', $statisticMapper->getVisitsYearMonthDay($date->format('Y', true), $date->format('m', true))); $this->getView()->set('statisticYearMonthList', $statisticMapper->getVisitsYearMonth()); $this->getView()->set('statisticYearList', $statisticMapper->getVisitsYear()); $this->getView()->set('statisticBrowserList', $statisticMapper->getVisitsBrowser()); $this->getView()->set('statisticLanguageList', $statisticMapper->getVisitsLanguage()); $this->getView()->set('statisticOSList', $statisticMapper->getVisitsOS()); }
public function deleteAction() { $modules = new ModuleMapper(); $key = $this->getRequest()->getParam('key'); if ($this->getRequest()->isSecure()) { $configClass = '\\Modules\\' . ucfirst($key) . '\\Config\\config'; $config = new $configClass($this->getTranslator()); $config->uninstall(); $modules->delete($key); removeDir(APPLICATION_PATH . '/modules/' . $this->getRequest()->getParam('key')); $this->addMessage('deleteSuccess'); } $this->redirect(array('action' => 'index')); }
/** * 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); }