Пример #1
0
 public static function getInstance($path, $params)
 {
     $page = parent::getInstance($path, $params);
     $page->userId = $params['user'];
     $page->deleteMode = isset($params['delete']) && $params['delete'];
     return $page;
 }
Пример #2
0
 public static function getInstance($path, $params)
 {
     $page = parent::getInstance($path, $params);
     $page->groupId = $params['group'];
     $page->editMode = isset($params['edit']) && $params['edit'];
     return $page;
 }
Пример #3
0
 public function init($params)
 {
     Page::requireNonce();
     Authorization::logout();
     self::redirectTo('login');
     exit;
 }
Пример #4
0
 public static function getInstance($path, $params)
 {
     $page = parent::getInstance($path, $params);
     $page->uid = isset($params['user']) ? $params['user'] : false;
     $page->confirmed = isset($params['confirmed']);
     $page->revert = isset($params['revert']);
     return $page;
 }
Пример #5
0
 public static function getInstance($path, $params)
 {
     $page = parent::getInstance($path, $params);
     $page->page = isset($params['offset']) ? intval($params['offset']) : 1;
     if ($page->page <= 0) {
         $page->page = 1;
     }
     return $page;
 }
Пример #6
0
 public function init($params)
 {
     Page::requireNonce();
     Page::requirePermission('group.add_groups');
     $dbc = Application::dbConnection();
     $group_id = $dbc->groups()->addGroup('New Group');
     self::redirectTo('groups/details', array('group' => $group_id, 'edit' => 1));
     exit;
 }
Пример #7
0
 private static function initWebRenderer($options)
 {
     $renderer = new WebRenderer($options);
     $renderer->provide('pageURL', function ($path, $params = array()) {
         return Page::getURL($path, $params)->build();
     });
     $renderer->provide('theUser', Authorization::user());
     $renderer->provide('theNonce', Authorization::getNonce());
     return $renderer;
 }
Пример #8
0
 public static function getInstance($path, $params)
 {
     Page::requirePermission('settings.change_site_settings');
     if (!count($path)) {
         self::redirectTo('settings/site/general');
         exit;
     }
     $sname = $path[0];
     $path = self::nextPath($path);
     switch ($sname) {
         case 'general':
             $page = Site\GeneralSettingsPage::getInstance($path, $params);
             break;
         case 'links':
             $page = Site\LinksSettingsPage::getInstance($path, $params);
             break;
         case 'users':
             $page = Site\UsersSettingsPage::getInstance($path, $params);
             break;
         default:
             $page = NotFoundPage::getInstance($path, $params);
     }
     return $page;
 }
Пример #9
0
 public static function getInstance($path, $params)
 {
     $page = parent::getInstance($path, $params);
     $page->linkId = $params['link'];
     $page->editMode = isset($params['edit']) && $params['edit'];
     $page->deleteMode = isset($params['delete']) && $params['delete'];
     return $page;
 }