当前位置: 首页>>代码示例>>PHP>>正文


PHP DevblocksPlatform::redirect方法代码示例

本文整理汇总了PHP中DevblocksPlatform::redirect方法的典型用法代码示例。如果您正苦于以下问题:PHP DevblocksPlatform::redirect方法的具体用法?PHP DevblocksPlatform::redirect怎么用?PHP DevblocksPlatform::redirect使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DevblocksPlatform的用法示例。


在下文中一共展示了DevblocksPlatform::redirect方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: saveTab

 function saveTab()
 {
     @($id = DevblocksPlatform::importGPC($_POST['id'], 'integer', 0));
     @($name = trim(DevblocksPlatform::importGPC($_POST['name'], 'string', 'New Search Engine')));
     @($url = trim(DevblocksPlatform::importGPC($_POST['url'], 'string', '')));
     @($delete = DevblocksPlatform::importGPC($_POST['do_delete'], 'integer', 0));
     if (DEMO_MODE) {
         DevblocksPlatform::setHttpResponse(new DevblocksHttpResponse(array('config', 'wgm.google_cse')));
         return;
     }
     if (!empty($delete)) {
         DAO_WgmGoogleCse::delete($id);
     } else {
         // Data massaging
         $token = '';
         if (!empty($url)) {
             if (null != ($query_args = parse_url($url, PHP_URL_QUERY))) {
                 $args = array();
                 parse_str($query_args, $args);
                 $token = isset($args['cx']) ? $args['cx'] : '';
             }
         }
         $fields = array(DAO_WgmGoogleCse::NAME => !empty($name) ? $name : 'New Search Engine', DAO_WgmGoogleCse::URL => $url, DAO_WgmGoogleCse::TOKEN => $token);
         if (empty($id)) {
             // Create
             $id = DAO_WgmGoogleCse::create($fields);
         } else {
             // Edit
             DAO_WgmGoogleCse::update($id, $fields);
         }
     }
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('config', 'wgm.google_cse')));
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:33,代码来源:App.php

示例2: doTicketHistoryScopeAction

 function doTicketHistoryScopeAction()
 {
     @($ticket_id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer'));
     @($scope = DevblocksPlatform::importGPC($_REQUEST['scope'], 'string', ''));
     $visit = CerberusApplication::getVisit();
     $visit->set('display.history.scope', $scope);
     $ticket = DAO_Ticket::getTicket($ticket_id);
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('display', $ticket->mask, 'history')));
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:9,代码来源:display.php

示例3: saveTab

 function saveTab()
 {
     @($plugin_id = DevblocksPlatform::importGPC($_REQUEST['plugin_id'], 'string'));
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('config', 'watchers')));
     exit;
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:6,代码来源:App.php

示例4: writeResponse

 public function writeResponse(DevblocksHttpResponse $response)
 {
     $path = $response->path;
     // [JAS]: Ajax? // [TODO] Explore outputting whitespace here for Safari
     //	    if(empty($path))
     //			return;
     $tpl = DevblocksPlatform::getTemplateService();
     $session = DevblocksPlatform::getSessionService();
     $settings = CerberusSettings::getInstance();
     $translate = DevblocksPlatform::getTranslationService();
     $active_worker = CerberusApplication::getActiveWorker();
     $visit = $session->getVisit();
     $page_manifests = $this->_getAllowedPages();
     $controller = array_shift($path);
     // Default page [TODO] This is supposed to come from framework.config.php
     if (empty($controller)) {
         $controller = 'home';
     }
     // [JAS]: Require us to always be logged in for Cerberus pages
     if (empty($visit) && 0 != strcasecmp($controller, 'login')) {
         $query = array();
         if (!empty($response->path)) {
             $query = array('url' => urlencode(implode('/', $response->path)));
         }
         DevblocksPlatform::redirect(new DevblocksHttpRequest(array('login'), $query));
     }
     $page_id = $this->_getPageIdByUri($controller);
     @($page = DevblocksPlatform::getExtension($page_id, true));
     /* @var $page CerberusPageExtension */
     if (empty($page)) {
         header("Status: 404");
         return;
         // [TODO] 404
     }
     // [JAS]: Listeners (Step-by-step guided tour, etc.)
     $listenerManifests = DevblocksPlatform::getExtensions('devblocks.listener.http');
     foreach ($listenerManifests as $listenerManifest) {
         /* @var $listenerManifest DevblocksExtensionManifest */
         $inst = $listenerManifest->createInstance();
         /* @var $inst DevblocksHttpRequestListenerExtension */
         $inst->run($response, $tpl);
     }
     $tpl->assign('active_worker', $active_worker);
     $tour_enabled = false;
     if (!empty($visit) && !is_null($active_worker)) {
         $tour_enabled = intval(DAO_WorkerPref::get($active_worker->id, 'assist_mode', 1));
         if (DEMO_MODE) {
             $tour_enabled = 1;
         }
         // override for DEMO
         $keyboard_shortcuts = intval(DAO_WorkerPref::get($active_worker->id, 'keyboard_shortcuts', 1));
         $tpl->assign('pref_keyboard_shortcuts', $keyboard_shortcuts);
         $active_worker_memberships = $active_worker->getMemberships();
         $tpl->assign('active_worker_memberships', $active_worker_memberships);
         $unread_notifications = DAO_WorkerEvent::getUnreadCountByWorker($active_worker->id);
         $tpl->assign('active_worker_notify_count', $unread_notifications);
         DAO_Worker::logActivity($active_worker->id, $page->getActivity());
     }
     $tpl->assign('tour_enabled', $tour_enabled);
     // [JAS]: Variables provided to all page templates
     $tpl->assign('settings', $settings);
     $tpl->assign('session', $_SESSION);
     $tpl->assign('translate', $translate);
     $tpl->assign('visit', $visit);
     $tpl->assign('license', CerberusLicense::getInstance());
     $tpl->assign('page_manifests', $page_manifests);
     $tpl->assign('page', $page);
     $tpl->assign('response_uri', implode('/', $response->path));
     $core_tpl = DEVBLOCKS_PLUGIN_PATH . 'cerberusweb.core/templates/';
     $tpl->assign('core_tpl', $core_tpl);
     // Prebody Renderers
     $preBodyRenderers = DevblocksPlatform::getExtensions('cerberusweb.renderer.prebody', true);
     if (!empty($preBodyRenderers)) {
         $tpl->assign('prebody_renderers', $preBodyRenderers);
     }
     // Postbody Renderers
     $postBodyRenderers = DevblocksPlatform::getExtensions('cerberusweb.renderer.postbody', true);
     if (!empty($postBodyRenderers)) {
         $tpl->assign('postbody_renderers', $postBodyRenderers);
     }
     // Timings
     $tpl->assign('render_time', microtime(true) - DevblocksPlatform::getStartTime());
     if (function_exists('memory_get_usage') && function_exists('memory_get_peak_usage')) {
         $tpl->assign('render_memory', memory_get_usage() - DevblocksPlatform::getStartMemory());
         $tpl->assign('render_peak_memory', memory_get_peak_usage() - DevblocksPlatform::getStartPeakMemory());
     }
     $tpl->display($core_tpl . 'border.tpl');
     //		$cache = DevblocksPlatform::getCacheService();
     //		$cache->printStatistics();
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:90,代码来源:plugin.classes.php

示例5: doRecoverStep3Action

 function doRecoverStep3Action()
 {
     @($password = DevblocksPlatform::importGPC($_REQUEST['password'], 'string'));
     $email = $_SESSION[self::KEY_FORGOT_EMAIL];
     $sentcode = $_SESSION[self::KEY_FORGOT_SENTCODE];
     $code = $_SESSION[self::KEY_FORGOT_CODE];
     $worker_id = DAO_Worker::lookupAgentEmail($email);
     if (empty($email) || empty($code) || empty($worker_id)) {
         return;
     }
     if (0 == strcmp($sentcode, $code)) {
         // passed
         DAO_Worker::updateAgent($worker_id, array(DAO_Worker::PASSWORD => md5($password)));
         unset($_SESSION[self::KEY_FORGOT_EMAIL]);
         unset($_SESSION[self::KEY_FORGOT_CODE]);
         unset($_SESSION[self::KEY_FORGOT_SENTCODE]);
         DevblocksPlatform::redirect(new DevblocksHttpResponse(array('login')));
     } else {
         DevblocksPlatform::redirect(new DevblocksHttpResponse(array('login', 'forgot', 'step2')));
     }
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:21,代码来源:login.php

示例6: saveCommunityToolAction

 function saveCommunityToolAction()
 {
     @($code = DevblocksPlatform::importGPC($_POST['portal'], 'string'));
     @($name = DevblocksPlatform::importGPC($_POST['portal_name'], 'string', ''));
     @($iDelete = DevblocksPlatform::importGPC($_POST['do_delete'], 'integer', 0));
     UmPortalHelper::setCode($code);
     if (DEMO_MODE) {
         if ($iDelete) {
             DevblocksPlatform::redirect(new DevblocksHttpResponse(array('config', 'communities')));
         } else {
             self::getCommunityToolAction();
         }
         return;
     }
     if (null != ($instance = DAO_CommunityTool::getByCode($code))) {
         // Deleting?
         if (!empty($iDelete)) {
             $tool = DAO_CommunityTool::getByCode($code);
             /* @var $tool Model_CommunityTool */
             DAO_CommunityTool::delete($tool->id);
             DevblocksPlatform::redirect(new DevblocksHttpResponse(array('config', 'communities')));
             return;
         } else {
             $manifest = DevblocksPlatform::getExtension($instance->extension_id, false, true);
             $tool = $manifest->createInstance();
             /* @var $tool Extension_UsermeetTool */
             // Update the tool name if it has changed
             if (0 != strcmp($instance->name, $name)) {
                 DAO_CommunityTool::update($instance->id, array(DAO_CommunityTool::NAME => $name));
             }
             // Defer the rest to tool instances and extensions
             $tool->saveConfiguration();
         }
     }
     self::getCommunityToolAction();
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:36,代码来源:classes.php

示例7: viewDoCopyAction

 function viewDoCopyAction()
 {
     $translate = DevblocksPlatform::getTranslationService();
     $active_worker = CerberusApplication::getActiveWorker();
     $visit = CerberusApplication::getVisit();
     @($view_id = DevblocksPlatform::importGPC($_POST['view_id'], 'string'));
     $view = C4_AbstractViewLoader::getView($view_id);
     @($list_title = DevblocksPlatform::importGPC($_POST['list_title'], 'string', ''));
     @($workspace = DevblocksPlatform::importGPC($_POST['workspace'], 'string', ''));
     @($new_workspace = DevblocksPlatform::importGPC($_POST['new_workspace'], 'string', ''));
     if (empty($workspace) && empty($new_workspace)) {
         $new_workspace = $translate->_('mail.workspaces.new');
     }
     if (empty($list_title)) {
         $list_title = $translate->_('mail.workspaces.new_list');
     }
     $workspace_name = !empty($new_workspace) ? $new_workspace : $workspace;
     // Find the proper workspace source based on the class of the view
     $source_manifests = DevblocksPlatform::getExtensions(Extension_WorkspaceSource::EXTENSION_POINT, false);
     $source_manifest = null;
     if (is_array($source_manifests)) {
         foreach ($source_manifests as $mft) {
             if (is_a($view, $mft->params['view_class'])) {
                 $source_manifest = $mft;
                 break;
             }
         }
     }
     if (!is_null($source_manifest)) {
         // View params inside the list for quick render overload
         $list_view = new Model_WorkerWorkspaceListView();
         $list_view->title = $list_title;
         $list_view->num_rows = $view->renderLimit;
         $list_view->columns = $view->view_columns;
         $list_view->params = $view->params;
         $list_view->sort_by = $view->renderSortBy;
         $list_view->sort_asc = $view->renderSortAsc;
         // Save the new worklist
         $fields = array(DAO_WorkerWorkspaceList::WORKER_ID => $active_worker->id, DAO_WorkerWorkspaceList::WORKSPACE => $workspace_name, DAO_WorkerWorkspaceList::SOURCE_EXTENSION => $source_manifest->id, DAO_WorkerWorkspaceList::LIST_VIEW => serialize($list_view), DAO_WorkerWorkspaceList::LIST_POS => 99);
         $list_id = DAO_WorkerWorkspaceList::create($fields);
     }
     // Select the workspace tab
     $visit->set(CerberusVisit::KEY_HOME_SELECTED_TAB, 'w_' . $workspace_name);
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('home')));
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:45,代码来源:internal.php

示例8: deleteOppNoteAction

 function deleteOppNoteAction()
 {
     @($id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer', 0));
     @($opp_id = DevblocksPlatform::importGPC($_REQUEST['opp_id'], 'integer', 0));
     $active_worker = CerberusApplication::getActiveWorker();
     if (null != ($note = DAO_Note::get($id))) {
         if ($note->worker_id == $active_worker->id || $active_worker->is_superuser) {
             DAO_Note::delete($id);
         }
     }
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('crm', 'opp', $opp_id)));
 }
开发者ID:joegeck,项目名称:cerb4,代码行数:12,代码来源:App.php

示例9: importAction

 function importAction()
 {
     $this->import();
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('activity', 'forums')));
 }
开发者ID:rmiddle,项目名称:cerb4,代码行数:5,代码来源:App.php

示例10: createNewCustomerAction

 function createNewCustomerAction()
 {
     $active_worker = FegApplication::getActiveWorker();
     @($account_number = DevblocksPlatform::importGPC($_REQUEST['account_name'], 'string', ''));
     @($message_id = DevblocksPlatform::importGPC($_REQUEST['message_id'], 'integer', 0));
     if (!$active_worker->hasPriv('core.access.customer.create')) {
         return;
     }
     if (empty($account_number)) {
         $fields = array(DAO_CustomerAccount::IMPORT_SOURCE => 0, DAO_CustomerAccount::ACCOUNT_NAME => "", DAO_CustomerAccount::ACCOUNT_NUMBER => "", DAO_CustomerAccount::IS_DISABLED => 1);
     } else {
         $fields = array(DAO_CustomerAccount::IMPORT_SOURCE => 0, DAO_CustomerAccount::ACCOUNT_NAME => "Customer # " . $account_number, DAO_CustomerAccount::ACCOUNT_NUMBER => $account_number, DAO_CustomerAccount::IS_DISABLED => 1);
     }
     // Create a new Customer Recipients
     $account_id = DAO_CustomerAccount::create($fields);
     if ($message_id > 0) {
         ImportCron::importAccountReProcessMessage($message_id, $account_id);
     }
     //		DevblocksPlatform::setHttpResponse(new DevblocksHttpResponse(array('customer', $customer_id,'property')));
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('customer', $account_id, 'property')));
 }
开发者ID:rmiddle,项目名称:feg,代码行数:21,代码来源:customer_accounts.php

示例11: viewBuildRssAction

 function viewBuildRssAction()
 {
     @($view_id = DevblocksPlatform::importGPC($_POST['view_id']));
     @($source = DevblocksPlatform::importGPC($_POST['source']));
     @($title = DevblocksPlatform::importGPC($_POST['title']));
     $active_worker = CerberusApplication::getActiveWorker();
     $view = C4_AbstractViewLoader::getView($view_id);
     $hash = md5($title . $view_id . $active_worker->id . time());
     // Restrict to current worker groups
     $active_worker = CerberusApplication::getActiveWorker();
     $params = array('params' => $view->params, 'sort_by' => $view->renderSortBy, 'sort_asc' => $view->renderSortAsc);
     $fields = array(DAO_ViewRss::TITLE => $title, DAO_ViewRss::HASH => $hash, DAO_ViewRss::CREATED => time(), DAO_ViewRss::WORKER_ID => $active_worker->id, DAO_ViewRss::SOURCE_EXTENSION => $source, DAO_ViewRss::PARAMS => serialize($params));
     $feed_id = DAO_ViewRss::create($fields);
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('preferences', 'rss')));
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:15,代码来源:tickets.php

示例12: saveMacroPanelAction


//.........这里部分代码省略.........
                     break;
                     // Assign to worker
                 // Assign to worker
                 case 'cerberusweb.macros.action.assign':
                     @($worker_id = $value);
                     if (0 != strlen($worker_id)) {
                         $action = array('worker_id' => intval($worker_id));
                     }
                     break;
                     // Spam training
                 // Spam training
                 case 'spam':
                     @($is_spam = DevblocksPlatform::importGPC($_REQUEST['do_spam'], 'string', null));
                     if (0 != strlen($is_spam)) {
                         $action = array('is_spam' => !$is_spam ? 0 : 1);
                     }
                     break;
                     // Set status
                 // Set status
                 case 'cerberusweb.macros.action.status':
                     @($status = DevblocksPlatform::importGPC($_REQUEST['do_status'], 'string', null));
                     if (0 != strlen($status)) {
                         $action = array('is_waiting' => 3 == $status ? 1 : 0, 'is_closed' => 0 == $status || 3 == $status ? 0 : 1, 'is_deleted' => 2 == $status ? 1 : 0);
                     }
                     break;
                 default:
                     // ignore invalids
                     // Custom fields
                     if ("cf_" == substr($act, 0, 3)) {
                         $field_id = intval(substr($act, 3));
                         if (!isset($custom_fields[$field_id])) {
                             continue;
                         }
                         $action = array();
                         // [TODO] Operators
                         switch ($custom_fields[$field_id]->type) {
                             case 'S':
                                 // string
                             // string
                             case 'T':
                                 // clob
                             // clob
                             case 'D':
                                 // dropdown
                             // dropdown
                             case 'U':
                                 // URL
                             // URL
                             case 'W':
                                 // worker
                                 $value = DevblocksPlatform::importGPC($_REQUEST['do_cf_' . $field_id], 'string', '');
                                 $action['value'] = $value;
                                 break;
                             case 'M':
                                 // multi-dropdown
                             // multi-dropdown
                             case 'X':
                                 // multi-checkbox
                                 $in_array = DevblocksPlatform::importGPC($_REQUEST['do_cf_' . $field_id], 'array', array());
                                 $out_array = array();
                                 // Hash key on the option for quick lookup later
                                 if (is_array($in_array)) {
                                     foreach ($in_array as $k => $v) {
                                         $out_array[$v] = $v;
                                     }
                                 }
                                 $action['value'] = $out_array;
                                 break;
                             case 'E':
                                 // date
                                 $value = DevblocksPlatform::importGPC($_REQUEST['do_cf_' . $field_id], 'string', '');
                                 $action['value'] = $value;
                                 break;
                             case 'N':
                                 // number
                             // number
                             case 'C':
                                 // checkbox
                                 $value = DevblocksPlatform::importGPC($_REQUEST['do_cf_' . $field_id], 'string', '');
                                 $action['value'] = intval($value);
                                 break;
                         }
                     } else {
                         continue;
                     }
                     break;
             }
             $actions[$act] = $action;
         }
     }
     $fields = array(DAO_Macro::NAME => $name, DAO_Macro::SOURCE_EXTENSION_ID => $source_ext_id, DAO_Macro::ACTIONS_SER => serialize($actions));
     // Create
     if (empty($id)) {
         $id = DAO_Macro::create($fields);
         // Update
     } else {
         DAO_Macro::update($id, $fields);
     }
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('config', 'macros')));
 }
开发者ID:sluther,项目名称:cerb5-macros,代码行数:101,代码来源:App.php

示例13: doStopTourAction

 function doStopTourAction()
 {
     //		$request = DevblocksPlatform::getHttpRequest();
     $worker = PortSensorApplication::getActiveWorker();
     DAO_WorkerPref::set($worker->id, 'assist_mode', 0);
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('home')));
     //		DevblocksPlatform::redirect(new DevblocksHttpResponse($request->path, $request->query));
 }
开发者ID:jstanden,项目名称:portsensor,代码行数:8,代码来源:internal.php

示例14: saveViewAction

 function saveViewAction()
 {
     @($row_ids = DevblocksPlatform::importGPC($_REQUEST['row_ids'], 'array', array()));
     @($translations = DevblocksPlatform::importGPC($_REQUEST['translations'], 'array', array()));
     // Save the form strings
     if (is_array($row_ids)) {
         foreach ($row_ids as $idx => $row_id) {
             $fields = array(DAO_Translation::STRING_OVERRIDE => $translations[$idx]);
             DAO_Translation::update($row_id, $fields);
         }
     }
     self::_clearCache();
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('setup', 'translations')));
 }
开发者ID:jstanden,项目名称:portsensor,代码行数:14,代码来源:App.php

示例15: saveImportTemplatesPeekAction

 function saveImportTemplatesPeekAction()
 {
     @($view_id = DevblocksPlatform::importGPC($_REQUEST['view_id'], 'string', ''));
     @($portal = DevblocksPlatform::importGPC($_REQUEST['portal'], 'string', ''));
     @($import_file = $_FILES['import_file']);
     DAO_DevblocksTemplate::importXmlFile($import_file['tmp_name'], 'portal_' . $portal);
     // Clear template cache
     $tpl = DevblocksPlatform::getTemplateService();
     $tpl->clear_compiled_tpl();
     DevblocksPlatform::redirect(new DevblocksHttpResponse(array('community', $portal, 'templates')));
 }
开发者ID:Hildy,项目名称:cerb5,代码行数:11,代码来源:classes.php


注:本文中的DevblocksPlatform::redirect方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。