예제 #1
0
 public function Render()
 {
     include_once 'libs/smartylibs/Smarty.class.php';
     $smarty = new Smarty();
     $smarty->template_dir = 'components/templates';
     $smarty->assign_by_ref('Page', $this);
     $users = $this->tableBasedGrantsManager->GetAllUsersAsJson();
     $smarty->assign_by_ref('Users', $users);
     $localizerCaptions = $this->GetLocalizerCaptions();
     $smarty->assign_by_ref('Captions', $localizerCaptions);
     /* $roles = $this->tableBasedGrantsManager->GetAllRolesAsJson();
        $smarty->assign_by_ref('Roles', $roles); */
     $headerString = 'Content-Type: text/html';
     if ($this->GetContentEncoding() != null) {
         StringUtils::AddStr($headerString, 'charset=' . $this->GetContentEncoding(), ';');
     }
     header($headerString);
     $pageInfos = GetPageInfos();
     $pageListViewData = array('Pages' => array(), 'CurrentPageOptions' => array());
     foreach ($pageInfos as $pageInfo) {
         $pageListViewData['Pages'][] = array('Caption' => $this->RenderText($pageInfo['caption']), 'Hint' => $this->RenderText($pageInfo['short_caption']), 'Href' => $pageInfo['filename'], 'GroupName' => $this->RenderText($pageInfo['group_name']), 'BeginNewGroup' => $pageInfo['add_separator']);
     }
     $pageGroups = GetPageGroups();
     foreach ($pageGroups as &$pageGroup) {
         $pageGroup = $this->RenderText($pageGroup);
     }
     $pageListViewData['Groups'] = $pageGroups;
     $smarty->assign_by_ref('PageList', $pageListViewData);
     $authenticationViewData = $this->GetAuthenticationViewData();
     $smarty->assign_by_ref('Authentication', $authenticationViewData);
     $smarty->display('admin_panel.tpl');
 }
 /**
  * @param int $userId
  * @param string $pageName
  * @param string $grant
  */
 public function AdminRemoveUserGrant($userId, $pageName, $grant)
 {
     $this->CheckAdminGrant();
     $this->tableBasedGrantsManager->RemoveUserGrant($userId, $pageName, $grant);
 }
 public function GetAllUsersAsJson()
 {
     return $this->tableBasedGrantsManager->GetAllUsersAsJson();
 }