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; }
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; }