public function myGroupList() { $userId = OW::getUser()->getId(); if (empty($userId)) { throw new AuthenticateException(); } $language = OW::getLanguage(); OW::getDocument()->setHeading($language->text('groups', 'group_list_heading')); OW::getDocument()->setHeadingIconClass('ow_ic_files'); OW::getDocument()->setTitle($language->text('groups', 'my_list_page_title')); if (!$this->service->isCurrentUserCanViewList()) { $this->assign('permissionMessage', $language->text('groups', 'view_no_permission')); $templatePath = OW::getPluginManager()->getPlugin('groups')->getCtrlViewDir() . 'no_permission.html'; $this->setTemplate($templatePath); return; } $page = !empty($_GET['page']) && intval($_GET['page']) > 0 ? $_GET['page'] : 1; $perPage = 20; $first = ($page - 1) * $perPage; $count = $perPage; $dtoList = $this->service->findMyGroups($userId, $first, $count); $listCount = $this->service->findMyGroupsCount($userId); $paging = new BASE_CMP_Paging($page, ceil($listCount / $perPage), 5); $menu = $this->getGroupListMenu(); $menu->getElement('my')->setActive(true); $this->displayGroupList($dtoList, $paging, $menu); }
public function myGroupList() { $userId = OW::getUser()->getId(); if (empty($userId)) { throw new AuthenticateException(); } $language = OW::getLanguage(); OW::getDocument()->setHeading($language->text('groups', 'group_list_heading')); OW::getDocument()->setHeadingIconClass('ow_ic_files'); OW::getDocument()->setTitle($language->text('groups', 'my_list_page_title')); if (!$this->service->isCurrentUserCanViewList()) { $status = BOL_AuthorizationService::getInstance()->getActionStatus('groups', 'view'); throw new AuthorizationException($status['msg']); } $page = !empty($_GET['page']) && intval($_GET['page']) > 0 ? $_GET['page'] : 1; $perPage = 20; $first = ($page - 1) * $perPage; $count = $perPage; $dtoList = $this->service->findMyGroups($userId, $first, $count); $listCount = $this->service->findMyGroupsCount($userId); $paging = new BASE_CMP_Paging($page, ceil($listCount / $perPage), 5); $menu = $this->getGroupListMenu(); $menu->getElement('my')->setActive(true); $this->assign('listType', 'my'); $this->displayGroupList($dtoList, $paging, $menu); }