本文整理汇总了PHP中PHPWS_Core::reroute方法的典型用法代码示例。如果您正苦于以下问题:PHP PHPWS_Core::reroute方法的具体用法?PHP PHPWS_Core::reroute怎么用?PHP PHPWS_Core::reroute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PHPWS_Core
的用法示例。
在下文中一共展示了PHPWS_Core::reroute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: forceLogin
public function forceLogin()
{
if (!$this->force_login) {
return;
}
PHPWS_Core::reroute($this->login_link);
}
示例2: my_page
/**
* @version $Id$
* @author Matthew McNaney <mcnaney at gmail dot com>
*/
function my_page()
{
$title = $content = $message = NULL;
if (isset($_SESSION['Layout_User_Message'])) {
$message = $_SESSION['Layout_User_Message'];
unset($_SESSION['Layout_User_Message']);
}
if (isset($_SESSION['Reset_Layout'])) {
unset($_SESSION['Reset_Layout']);
Layout::reset();
}
if (isset($_REQUEST['lo_command'])) {
$lo_command = $_REQUEST['lo_command'];
} else {
$lo_command = 'user_form';
}
switch ($lo_command) {
case 'user_form':
$title = dgettext('layout', 'Display settings');
$content = Layout_User_Settings::user_form();
break;
case 'save_settings':
Layout_User_Settings::save_settings();
$_SESSION['Reset_Layout'] = 1;
$_SESSION['Layout_User_Message'] = dgettext('layout', 'Settings saved');
PHPWS_Core::reroute('index.php?module=users&action=user&tab=layout');
break;
}
$tpl['TITLE'] = $title;
$tpl['CONTENT'] = $content;
$tpl['MESSAGE'] = $message;
return PHPWS_Template::process($tpl, 'layout', 'main.tpl');
}
示例3: check_cookie
function check_cookie()
{
$cookie = PHPWS_Cookie::read('cookie_enabled');
if (!$cookie) {
if (!isset($_GET['cc'])) {
PHPWS_Cookie::write('cookie_enabled', 'y');
PHPWS_Core::reroute('index.php?cc=1');
} else {
$tpl['MESSAGE'] = dgettext('layout', 'This site requires you to enable cookies on your browser.');
$message = PHPWS_Template::process($tpl, 'layout', 'no_cookie.tpl');
Layout::nakedDisplay($message);
}
}
}
示例4: adminMenu
function adminMenu()
{
if (!Current_User::allow('whatsnew')) {
Current_User::disallow();
}
$this->loadPanel();
$javascript = false;
$this->loadMessage();
switch ($_REQUEST['aop']) {
case 'menu':
if (!isset($_GET['tab'])) {
$this->loadForm('settings');
} else {
$this->loadForm($_GET['tab']);
}
break;
case 'post_settings':
if (!Current_User::authorized('whatsnew')) {
Current_User::disallow();
}
if ($this->postSettings()) {
$this->forwardMessage(dgettext('whatsnew', 'Whatsnew settings saved.'));
PHPWS_Core::reroute('index.php?module=whatsnew&aop=menu');
} else {
$this->loadForm('settings');
}
break;
case 'flush_cache':
if (!Current_User::authorized('whatsnew')) {
Current_User::disallow();
}
if ($this->flushCache()) {
$this->forwardMessage(dgettext('whatsnew', 'Cache flushed.'));
PHPWS_Core::reroute('index.php?module=whatsnew&aop=menu');
} else {
$this->loadForm('settings');
}
break;
}
$tpl['TITLE'] = $this->title;
$tpl['CONTENT'] = $this->content;
$tpl['MESSAGE'] = $this->message;
if ($javascript) {
Layout::nakedDisplay(PHPWS_Template::process($tpl, 'whatsnew', 'main_admin.tpl'));
} else {
$this->panel->setContent(PHPWS_Template::process($tpl, 'whatsnew', 'main_admin.tpl'));
Layout::add(PHPWS_ControlPanel::display($this->panel->display()));
}
}
示例5: post
public function post(\Request $request)
{
$factory = new Factory();
$view = new \View\JsonView(array('success' => true));
$response = new \Response($view);
if (!$request->isVar('command')) {
throw new \Exception('Bad command');
}
switch ($request->getVar('command')) {
case 'save':
$factory->postSettings();
break;
}
\PHPWS_Core::reroute('tailgate/Admin/');
}
示例6: post
public function post(\Request $request)
{
$factory = new Factory();
$view = new \View\JsonView(array('success' => true));
$response = new \Response($view);
if (!$request->isVar('command')) {
throw new \Exception('Bad command');
}
switch ($request->getVar('command')) {
case 'createNewAccount':
$factory->postNewStudent(\Current_User::getId());
\PHPWS_Core::reroute('tailgate/');
break;
}
return $response;
}
示例7: execute
public function execute()
{
// Make sure an 'internship_id' key is set on the request
if (!isset($_REQUEST['internship_id'])) {
\NQ::simple('intern', NotifyUI::ERROR, 'No internship ID was given.');
\NQ::close();
\PHPWS_Core::reroute('index.php');
}
// Load the Internship
try {
$intern = InternshipFactory::getInternshipById($_REQUEST['internship_id']);
} catch (\Intern\Exception\InternshipNotFoundException $e) {
\NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'Could not locate an internship with the given ID.');
return;
}
if ($intern === false) {
\NQ::simple('intern', \Intern\UI\NotifyUI::ERROR, 'Could not locate an internship with the given ID.');
//TODO redirect to the search interface
return;
}
// Load a fresh copy of the student data from the web service
try {
$student = StudentProviderFactory::getProvider()->getStudent($intern->getBannerId(), $intern->getTerm());
} catch (\Intern\Exception\StudentNotFoundException $e) {
$studentId = $intern->getBannerId();
$student = null;
\NQ::simple('intern', \Intern\UI\NotifyUI::WARNING, "We couldn't find a student with an ID of {$studentId} in Banner. This probably means this person is not an active student.");
}
// Load the WorkflowState
$wfState = $intern->getWorkflowState();
// Load the agency
$agency = AgencyFactory::getAgencyById($intern->getAgencyId());
// Load the documents
$docs = $intern->getDocuments();
if ($docs === null) {
$docs = array();
// if no docs, setup an empty array
}
$view = new InternshipView($intern, $student, $wfState, $agency, $docs);
return $view->display();
}
示例8: my_page
function my_page()
{
if (isset($_REQUEST['subcommand'])) {
$subcommand = $_REQUEST['subcommand'];
} else {
$subcommand = 'updateSettings';
}
$user = $_SESSION['User'];
$template['TITLE'] = dgettext('users', 'Change my Settings');
switch ($subcommand) {
case 'updateSettings':
if (isset($_GET['save'])) {
$template['MESSAGE'] = dgettext('users', 'User settings updated.');
}
$content = User_Settings::userForm($user);
break;
case 'postUser':
User_Settings::setTZ();
User_Settings::rememberMe();
User_Settings::setCP();
$result = User_Action::postUser($user, FALSE);
if (is_array($result)) {
$content = User_Settings::userForm($user, $result);
} else {
if (PHPWS_Error::logIfError($user->save())) {
$content = dgettext('users', 'An error occurred while updating your user account.');
} else {
$_SESSION['User'] = $user;
PHPWS_Core::reroute('index.php?module=users&action=user&tab=users&save=1');
}
}
break;
}
$template['CONTENT'] = $content;
return PHPWS_Template::process($template, 'users', 'my_page/main.tpl');
}
示例9: show
public static function show($start_date = null, $end_date = null)
{
if (!Blog_User::allowView()) {
return null;
}
$db = new PHPWS_DB('blog_entries');
if ($start_date) {
$db->addWhere('publish_date', $start_date, '>=', 'and', 2);
}
if ($end_date) {
$db->addWhere('publish_date', $end_date, '<=', 'and', 2);
}
$db->addWhere('approved', 1);
$db->addWhere('publish_date', time(), '<');
$db->addWhere('expire_date', time(), '>', 'and', 1);
$db->addWhere('expire_date', 0, '=', 'or', 1);
$db->setGroupConj(1, 'and');
Key::restrictView($db, 'blog');
$total_entries = Blog_User::totalEntries($db);
$limit = PHPWS_Settings::get('blog', 'blog_limit');
if (isset($_GET['page'])) {
$page = $_GET['page'];
} else {
$page = 0;
}
if (!is_numeric($page) || $page < 2) {
$offset = $page = 0;
} else {
$offset = ($page - 1) * $limit;
}
Layout::addStyle('blog');
$result = Blog_User::getEntries($db, $limit, $offset);
if ($page > 0 && empty($result)) {
PHPWS_Core::reroute('blog/action/view/page/1');
}
if (PHPWS_Error::isError($result)) {
PHPWS_Error::log($result);
return NULL;
}
if (empty($result)) {
if (Current_User::allow('blog')) {
MiniAdmin::add('blog', PHPWS_Text::secureLink(dgettext('blog', 'Create first blog entry!'), 'blog', array('action' => 'admin', 'command' => 'new')));
}
return NULL;
}
if ($page < 2) {
$past_entries = PHPWS_Settings::get('blog', 'past_entries');
if ($past_entries) {
$db->setLimit($past_entries, $limit);
$past = $db->getObjects('Blog');
if (PHPWS_Error::isError($past)) {
PHPWS_Error::log($past);
} elseif ($past) {
Blog_User::showPast($past);
}
}
}
$rss = false;
foreach ($result as $blog) {
if (!$rss) {
if (PHPWS_Core::moduleExists('rss')) {
PHPWS_Core::initModClass('rss', 'RSS.php');
$key = new Key($blog->key_id);
RSS::showIcon($key);
$rss = true;
}
}
$view = $blog->view();
if (!empty($view)) {
$list[] = $view;
}
}
$page_vars['action'] = 'view';
if ($page > 1) {
$page_vars['page'] = $page - 1;
$tpl['PREV_PAGE'] = PHPWS_Text::moduleLink(dgettext('blog', 'Previous page'), 'blog', $page_vars);
if ($limit + $offset < $total_entries) {
$page_vars['page'] = $page + 1;
$tpl['NEXT_PAGE'] = PHPWS_Text::moduleLink(dgettext('blog', 'Next page'), 'blog', $page_vars);
}
} elseif ($limit + $offset < $total_entries) {
$page_vars['page'] = 2;
$tpl['NEXT_PAGE'] = PHPWS_Text::moduleLink(dgettext('blog', 'Next page'), 'blog', $page_vars);
}
$tpl['ENTRIES'] = implode('', $list);
$content = PHPWS_Template::process($tpl, 'blog', 'list_view.tpl');
if (Current_User::allow('blog', 'edit_blog')) {
Blog_User::miniAdminList();
$vars['action'] = 'admin';
$vars['command'] = 'new';
$link[] = PHPWS_Text::secureLink(dgettext('blog', 'Add new blog'), 'blog', $vars);
MiniAdmin::add('blog', $link);
}
return $content;
}
示例10: post
public function post()
{
$this->loadContact();
switch ($_POST['cop']) {
case 'login':
if ($this->login()) {
\PHPWS_Core::home();
// login successful, contact page
} else {
$this->contactLogin();
}
break;
case 'save_property':
$this->checkPermission();
$this->loadProperty($this->contact->id);
if ($this->property->post()) {
try {
$this->property->save();
$this->setCarryMessage('Property saved successfully.');
\PHPWS_Core::reroute($this->property->viewLink());
} catch (\Exception $e) {
$this->setCarryMessage($e->getMessage());
\PHPWS_Core::reroute('index.php?module=properties&cop=view_properties&k=' . $_SESSION['Contact_User']->getKey());
}
} else {
$this->editProperty($this->contact->id);
}
break;
case 'save_contact':
$this->checkPermission();
if ($this->contact->post()) {
try {
$this->contact->save();
$this->contact->errors = null;
\PHPWS_Core::home();
} catch (\Exception $e) {
$this->setCarryMessage($e->getMessage());
$this->editContact();
}
} else {
$this->editContact();
}
break;
case 'post_photo':
try {
$photo = new Photo();
$photo->post();
$this->setCarryMessage('Photo uploaded');
if (isset($_POST['v'])) {
$property = new Property($photo->pid);
$url = './properties/id/' . $photo->pid . '/photo/1';
} else {
$url = 'index.php?module=properties&cop=view_properties&k=' . $_SESSION['Contact_User']->getKey() . '&pid=' . $photo->pid;
}
\PHPWS_Core::reroute($url);
} catch (\Exception $e) {
$this->setCarryMessage($e->getMessage());
\PHPWS_Core::goBack();
}
break;
}
$this->display();
}
示例11: execute
public function execute()
{
PHPWS_Core::initModClass('intern', 'Internship.php');
PHPWS_Core::initModClass('intern', 'Agency.php');
PHPWS_Core::initModClass('intern', 'Department.php');
PHPWS_Core::initModClass('intern', 'Faculty.php');
/**************
* Sanity Checks
*/
// Required fields check
$missing = self::checkRequest();
if (!is_null($missing) && !empty($missing)) {
// checkRequest returned some missing fields.
$url = 'index.php?module=intern&action=edit_internship';
$url .= '&missing=' . implode('+', $missing);
// Restore the values in the fields the user already entered
foreach ($_POST as $key => $val) {
$url .= "&{$key}={$val}";
}
NQ::simple('intern', INTERN_ERROR, 'Please fill in the highlighted fields.');
NQ::close();
return PHPWS_Core::reroute($url);
}
// Sanity check the Banner ID
if (!preg_match('/^\\d{9}$/', $_REQUEST['banner'])) {
$url = 'index.php?module=intern&action=edit_internship&missing=banner';
// Restore the values in the fields the user already entered
foreach ($_POST as $key => $val) {
$url .= "&{$key}={$val}";
}
NQ::simple('intern', INTERN_ERROR, "The Banner ID you entered is not valid. No changes were saved. The student's Banner ID should be nine digits only (no letters, spaces, or punctuation).");
NQ::close();
return PHPWS_Core::reroute($url);
}
// Sanity check student email
if (isset($_REQUEST['student_email']) && preg_match("/@/", $_REQUEST['student_email'])) {
$url = 'index.php?module=intern&action=edit_internship&missing=student_email';
// Restore the values in the fields the user already entered
foreach ($_POST as $key => $val) {
$url .= "&{$key}={$val}";
}
NQ::simple('intern', INTERN_ERROR, "The student's email address is invalid. No changes were saved. Enter only the username portion of the student's email address. The '@appstate.edu' portion is not necessary.");
NQ::close();
return PHPWS_Core::reroute($url);
}
// Sanity check student zip
if (isset($_REQUEST['student_zip']) && $_REQUEST['student_zip'] != "" && (strlen($_REQUEST['student_zip']) != 5 || !is_numeric($_REQUEST['student_zip']))) {
$url = 'index.php?module=intern&action=edit_internship&missing=student_zip';
// Restore the values in the fields the user already entered
foreach ($_POST as $key => $val) {
$url .= "&{$key}={$val}";
}
NQ::simple('intern', INTERN_ERROR, "The student's zip code is invalid. No changes were saved. Zip codes should be 5 digits only (no letters, spaces, or punctuation).");
NQ::close();
return PHPWS_Core::reroute($url);
}
// Course start date must be before end date
if (!empty($_REQUEST['start_date']) && !empty($_REQUEST['end_date'])) {
$start = strtotime($_REQUEST['start_date']);
$end = strtotime($_REQUEST['end_date']);
if ($start > $end) {
$url = 'index.php?module=intern&action=edit_internship&missing=start_date+end_date';
// Restore the values in the fields the user already entered
unset($_POST['start_date']);
unset($_POST['end_date']);
foreach ($_POST as $key => $val) {
$url .= "&{$key}={$val}";
}
NQ::simple('intern', INTERN_WARNING, 'The internship start date must be before the end date.');
NQ::close();
return PHPWS_Core::reroute($url);
}
}
// Sanity check internship location zip
if (isset($_REQUEST['loc_zip']) && $_REQUEST['loc_zip'] != "" && (strlen($_REQUEST['loc_zip']) != 5 || !is_numeric($_REQUEST['loc_zip']))) {
$url = 'index.php?module=intern&action=edit_internship&missing=loc_zip';
// Restore the values in the fields the user already entered
foreach ($_POST as $key => $val) {
$url .= "&{$key}={$val}";
}
NQ::simple('intern', INTERN_ERROR, "The internship location's zip code is invalid. No changes were saved. Zip codes should be 5 digits only (no letters, spaces, or punctuation).");
NQ::close();
return PHPWS_Core::reroute($url);
}
// Sanity check agency zip
if (isset($_REQUEST['agency_zip']) && $_REQUEST['agency_zip'] != "" && (strlen($_REQUEST['agency_zip']) != 5 || !is_numeric($_REQUEST['agency_zip']))) {
$url = 'index.php?module=intern&action=edit_internship&missing=agency_zip';
// Restore the values in the fields the user already entered
foreach ($_POST as $key => $val) {
$url .= "&{$key}={$val}";
}
NQ::simple('intern', INTERN_ERROR, "The agency's zip code is invalid. No changes were saved. Zip codes should be 5 digits only (no letters, spaces, or punctuation).");
NQ::close();
return PHPWS_Core::reroute($url);
}
// Sanity check supervisor's zip
if (isset($_REQUEST['agency_sup_zip']) && $_REQUEST['agency_sup_zip'] != "" && (strlen($_REQUEST['agency_sup_zip']) != 5 || !is_numeric($_REQUEST['agency_sup_zip']))) {
$url = 'index.php?module=intern&action=edit_internship&missing=agency_sup_zip';
// Restore the values in the fields the user already entered
foreach ($_POST as $key => $val) {
//.........这里部分代码省略.........
示例12: admin
//.........这里部分代码省略.........
$this->page->loadTemplate();
$this->page->loadSections(true);
$this->killSaved($this->page->id);
$this->forms->editPage();
break;
case 'delete_page':
if (!Current_User::authorized('pagesmith', 'delete_page')) {
Current_User::disallow();
}
$this->loadPage();
$this->page->delete();
PHPWS_Cache::clearCache();
$this->loadForms();
$this->forms->pageList();
break;
case 'edit_page_header':
$this->loadPage();
$this->loadForms();
$this->forms->editPageHeader();
$javascript = true;
break;
case 'delete_section':
$this->deleteSection($_GET['sec_id']);
exit;
break;
case 'post_header':
$this->postHeader();
break;
case 'post_text':
$this->postText();
break;
case 'post_page':
$result = $this->postPage();
switch ($result) {
case -1:
$this->loadForms();
$this->page->loadSections(true);
$this->forms->editPage();
break;
case 0:
$this->message = dgettext('pagesmith', 'Not enough content to create a page.');
$this->loadForms();
$this->page->loadSections(true);
$this->forms->editPage();
break;
case 1:
$this->killSaved($this->page->id);
PHPWS_Cache::clearCache();
PHPWS_Core::reroute($this->page->url());
break;
}
break;
case 'front_page_toggle':
$db = \Database::newDB();
$db->addTable('ps_page')->addValue('front_page', 0);
$db->update();
$this->loadPage();
$this->page->front_page = (bool) $_GET['fp'];
$this->page->save();
PHPWS_Cache::clearCache();
$this->removeFromMenu();
$this->loadForms();
$this->forms->pageList();
break;
case 'shorten_links':
if (!Current_User::authorized('pagesmith', 'settings', null, null, true)) {
Current_User::disallow();
}
$this->shortenLinks();
PHPWS_Core::goBack();
break;
case 'lengthen_links':
if (!Current_User::authorized('pagesmith', 'settings', null, null, true)) {
Current_User::disallow();
}
$this->lengthenLinks();
PHPWS_Core::goBack();
break;
case 'post_settings':
if (!Current_User::authorized('pagesmith', 'settings', null, null, true)) {
Current_User::disallow();
}
$this->postSettings();
$this->message = dgettext('pagesmith', 'Settings saved');
$this->loadForms();
$this->forms->settings();
break;
default:
PHPWS_Core::errorPage('404');
break;
}
if ($javascript) {
$tpl['TITLE'] = $this->title;
$tpl['CONTENT'] = $this->content;
$tpl['MESSAGE'] = $this->message;
Layout::nakedDisplay(PHPWS_Template::process($tpl, 'pagesmith', 'admin_main.tpl'));
} else {
Layout::add(PHPWS_ControlPanel::display($this->panel->display($this->content, $this->title, $this->message)));
}
}
示例13: loadHeaderTags
public static function loadHeaderTags(&$template)
{
$page_metatags = null;
$theme = Layout::getCurrentTheme();
$key = Key::getCurrent();
if (Key::checkKey($key, false)) {
$page_metatags = Layout::getMetaPage($key->id);
if (PHPWS_Error::isError($page_metatags)) {
PHPWS_Error::log($page_metatags);
$page_metatags = null;
}
}
if (!isset($_SESSION['javascript_enabled'])) {
$jsHead[] = '<noscript><meta http-equiv="refresh" content="0;url=index.php?nojs=1&ret=' . urlencode(PHPWS_Core::getCurrentUrl()) . '"/></noscript>';
}
if (isset($_GET['nojs'])) {
$_SESSION['javascript_enabled'] = false;
PHPWS_Core::reroute(urldecode($_GET['ret']));
} elseif (!isset($_SESSION['javascript_enabled'])) {
$_SESSION['javascript_enabled'] = true;
}
if (isset($GLOBALS['Layout_JS'])) {
foreach ($GLOBALS['Layout_JS'] as $script => $javascript) {
$jsHead[] = $javascript['head'];
}
}
if (!empty($jsHead)) {
$template['JAVASCRIPT'] = implode("\n", $jsHead);
}
Layout::importStyleSheets();
Layout::submitHeaders($theme, $template);
if (!empty($GLOBALS['Layout_Links'])) {
$template['STYLE'] .= "\n" . implode("\n", $GLOBALS['Layout_Links']);
}
$template['METATAGS'] = Layout::getMetaTags($page_metatags);
if ($page_metatags) {
$template['PAGE_TITLE'] = $page_metatags['page_title'] . PAGE_TITLE_DIVIDER . $_SESSION['Layout_Settings']->getPageTitle(true);
} else {
$template['PAGE_TITLE'] = $_SESSION['Layout_Settings']->getPageTitle();
}
$template['ONLY_TITLE'] = $_SESSION['Layout_Settings']->getPageTitle(TRUE);
// Depricated
// The Site's Name, as set in Layout 'Meta Tags' interface.
$template['SITE_NAME'] = $_SESSION['Layout_Settings']->getPageTitle(TRUE);
$template['BASE'] = Layout::getBase();
$template['HTTP'] = PHPWS_Core::getHttp();
// 'http' or 'https'
// Complete URL of the site's home page
$template['HOME_URL'] = PHPWS_Core::getHomeHttp(true, true, true);
}
示例14: random
/**
* Gets random page from the database
*
* @author Greg Meiste <greg.meiste+github@gmail.com>
*/
function random()
{
$db = new PHPWS_DB('wiki_pages');
$db->addOrder('random');
$db->setLimit(1);
$db->addColumn('title');
$result = $db->select('col');
if (!PHPWS_Error::logIfError($result) && $result != NULL) {
PHPWS_Core::reroute(PHPWS_Text::linkAddress('wiki', array('page' => $result[0])));
}
PHPWS_Core::reroute(PHPWS_Text::linkAddress('wiki'));
}
示例15: admin
//.........这里部分代码省略.........
break;
case 'edit_folder':
$javascript = true;
$this->loadFolder();
// permission check in function below
$this->editFolder(true);
break;
case 'change_tn':
$javascript = true;
$this->changeTN();
break;
case 'post_thumbnail':
$javascript = true;
if ($this->postTN()) {
javascript('close_refresh');
} else {
$this->message = dgettext('filecabinet', 'Could not save thumbnail image.');
$this->changeTN();
}
break;
case 'post_folder':
if (!Current_User::authorized('filecabinet', 'edit_folders')) {
Current_User::disallow();
}
$this->loadFolder();
if ($this->folder->post()) {
if (!$this->folder->save()) {
self::setMessage(dgettext('filecabinet', 'Failed to create folder. Please check your logs.'));
}
} else {
self::setMessage(dgettext('filecabinet', 'Failed to create folder. Please check your logs.'));
}
if (filter_input(INPUT_POST, 'js') == 1) {
javascript('close_refresh');
} else {
PHPWS_Core::goBack();
}
break;
case 'post_allowed_files':
if (!Current_User::isDeity()) {
Current_User::disallow();
}
$this->loadForms();
$this->forms->postAllowedFiles();
$this->message = dgettext('filecabinet', 'File types saved.');
$this->title = dgettext('filecabinet', 'Allowed file types');
$this->content = $this->forms->fileTypes();
break;
case 'save_settings':
if (!Current_User::isDeity()) {
Current_User::disallow();
}
$this->loadForms();
$result = $this->forms->saveSettings();
if (is_array($result)) {
$this->message = implode('<br />', $result);
} else {
$this->message = dgettext('filecabinet', 'Settings saved.');
}
case 'settings':
if (!Current_User::isDeity()) {
Current_User::disallow();
}
$this->loadForms();
$this->title = dgettext('filecabinet', 'Settings');
$this->content = $this->forms->settings();
break;
case 'view_folder':
$this->viewFolder();
break;
case 'file_types':
if (!Current_User::isDeity()) {
Current_User::disallow();
}
$this->loadForms();
$this->title = dgettext('filecabinet', 'Allowed file types');
$this->content = $this->forms->fileTypes();
break;
case 'fix_document_dir':
if (!Current_User::isDeity() || !Current_User::verifyAuthKey()) {
Current_User::disallow();
}
if (strtolower($_GET['confirm']) == 'yes') {
$this->fixDocumentDirectories();
}
PHPWS_Core::reroute('index.php?module=filecabinet&tab=settings');
}
$template['TITLE'] =& $this->title;
$template['MESSAGE'] =& $this->message;
$template['CONTENT'] =& $this->content;
if ($javascript) {
$main = PHPWS_Template::process($template, 'filecabinet', 'javascript.tpl');
Layout::nakedDisplay($main);
} else {
$main = PHPWS_Template::process($template, 'filecabinet', 'main.tpl');
$this->panel->setContent($main);
$finalPanel = $this->panel->display();
Layout::add(PHPWS_ControlPanel::display($finalPanel));
}
}