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


PHP DevblocksPlatform::strAlphaNumDash方法代码示例

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


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

示例1: actionAction

 /**
  * Proxy page actions from an extension's render() to the extension's scope.
  *
  */
 function actionAction()
 {
     @($extid = DevblocksPlatform::importGPC($_REQUEST['extid']));
     @($extid_a = DevblocksPlatform::strAlphaNumDash($_REQUEST['extid_a']));
     $action = $extid_a . 'Action';
     $reportMft = DevblocksPlatform::getExtension($extid);
     // If it's a value report extension, proxy the action
     if (null != ($reportInst = DevblocksPlatform::getExtension($extid, true)) && $reportInst instanceof Extension_Report) {
         // If we asked for a value method on the extension, call it
         if (method_exists($reportInst, $action)) {
             call_user_func(array(&$reportInst, $action));
         }
     }
     return;
 }
开发者ID:rmiddle,项目名称:feg,代码行数:19,代码来源:App.php

示例2: handleRequest

 function handleRequest(DevblocksHttpRequest $request)
 {
     if (!$this->isVisible()) {
         return;
     }
     $path = $request->path;
     $controller = array_shift($path);
     // timetracking
     @($action = DevblocksPlatform::strAlphaNumDash(array_shift($path)) . 'Action');
     switch ($action) {
         case NULL:
             // [TODO] Index/page render
             break;
         default:
             // Default action, call arg as a method suffixed with Action
             if (method_exists($this, $action)) {
                 call_user_func(array(&$this, $action));
             }
             break;
     }
 }
开发者ID:jsjohnst,项目名称:cerb4,代码行数:21,代码来源:App.php

示例3: handleRequest

 public function handleRequest(DevblocksHttpRequest $request)
 {
     $path = $request->path;
     $controller = array_shift($path);
     // [TODO] _getAllowedPages() should take over, but it currently blocks hidden stubs
     $page_id = $this->_getPageIdByUri($controller);
     $page = DevblocksPlatform::getExtension($page_id, true);
     /* @var $page FegPageExtension */
     if (empty($page)) {
         switch ($controller) {
             //	        	case "portal":
             //				    header("Status: 404");
             //	        		die(); // 404
             //	        		break;
             default:
                 return;
                 // default page
                 break;
         }
     }
     @($action = DevblocksPlatform::strAlphaNumDash(array_shift($path)) . 'Action');
     switch ($action) {
         case NULL:
             // [TODO] Index/page render
             break;
         default:
             // Default action, call arg as a method suffixed with Action
             if ($page->isVisible()) {
                 if (method_exists($page, $action)) {
                     call_user_func(array(&$page, $action));
                     // [TODO] Pass HttpRequest as arg?
                 }
             } else {
                 // if Ajax [TODO] percolate isAjax from platform to handleRequest
                 // die("Access denied.  Session expired?");
             }
             break;
     }
 }
开发者ID:rmiddle,项目名称:feg,代码行数:39,代码来源:plugin.classes.php

示例4: saveMailRoutingRuleAddAction

 function saveMailRoutingRuleAddAction()
 {
     $translate = DevblocksPlatform::getTranslationService();
     @($id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer', 0));
     @($active_worker = CerberusApplication::getActiveWorker());
     if (!$active_worker->is_superuser) {
         return;
     }
     /*****************************/
     @($name = DevblocksPlatform::importGPC($_POST['name'], 'string', ''));
     @($is_sticky = DevblocksPlatform::importGPC($_POST['is_sticky'], 'integer', 0));
     //		@$is_stackable = DevblocksPlatform::importGPC($_POST['is_stackable'],'integer',0);
     @($rules = DevblocksPlatform::importGPC($_POST['rules'], 'array', array()));
     @($do = DevblocksPlatform::importGPC($_POST['do'], 'array', array()));
     if (empty($name)) {
         $name = $translate->_('Mail Routing Rule');
     }
     $criterion = array();
     $actions = array();
     // Custom fields
     $custom_fields = DAO_CustomField::getAll();
     // Criteria
     if (is_array($rules)) {
         foreach ($rules as $rule) {
             $rule = DevblocksPlatform::strAlphaNumDash($rule);
             @($value = DevblocksPlatform::importGPC($_POST['value_' . $rule], 'string', ''));
             // [JAS]: Allow empty $value (null/blank checking)
             $criteria = array('value' => $value);
             // Any special rule handling
             switch ($rule) {
                 case 'dayofweek':
                     // days
                     $days = DevblocksPlatform::importGPC($_REQUEST['value_dayofweek'], 'array', array());
                     if (in_array(0, $days)) {
                         $criteria['sun'] = 'Sunday';
                     }
                     if (in_array(1, $days)) {
                         $criteria['mon'] = 'Monday';
                     }
                     if (in_array(2, $days)) {
                         $criteria['tue'] = 'Tuesday';
                     }
                     if (in_array(3, $days)) {
                         $criteria['wed'] = 'Wednesday';
                     }
                     if (in_array(4, $days)) {
                         $criteria['thu'] = 'Thursday';
                     }
                     if (in_array(5, $days)) {
                         $criteria['fri'] = 'Friday';
                     }
                     if (in_array(6, $days)) {
                         $criteria['sat'] = 'Saturday';
                     }
                     unset($criteria['value']);
                     break;
                 case 'timeofday':
                     $from = DevblocksPlatform::importGPC($_REQUEST['timeofday_from'], 'string', '');
                     $to = DevblocksPlatform::importGPC($_REQUEST['timeofday_to'], 'string', '');
                     $criteria['from'] = $from;
                     $criteria['to'] = $to;
                     unset($criteria['value']);
                     break;
                 case 'subject':
                     break;
                 case 'from':
                     break;
                 case 'tocc':
                     break;
                 case 'header1':
                 case 'header2':
                 case 'header3':
                 case 'header4':
                 case 'header5':
                     if (null != @($header = DevblocksPlatform::importGPC($_POST[$rule], 'string', null))) {
                         $criteria['header'] = strtolower($header);
                     }
                     break;
                 case 'body':
                     break;
                     //				case 'attachment':
                     //					break;
                 //				case 'attachment':
                 //					break;
                 default:
                     // ignore invalids // [TODO] Very redundant
                     // Custom fields
                     if ("cf_" == substr($rule, 0, 3)) {
                         $field_id = intval(substr($rule, 3));
                         if (!isset($custom_fields[$field_id])) {
                             continue;
                         }
                         switch ($custom_fields[$field_id]->type) {
                             case 'S':
                                 // string
                             // string
                             case 'T':
                                 // clob
                             // clob
                             case 'U':
//.........这里部分代码省略.........
开发者ID:Hildy,项目名称:cerb5,代码行数:101,代码来源:config.php

示例5: saveWatcherPanelAction

 function saveWatcherPanelAction()
 {
     $translate = DevblocksPlatform::getTranslationService();
     @($id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer', 0));
     @($active_worker = CerberusApplication::getActiveWorker());
     //	    if(!$active_worker->is_superuser)
     //	    	return;
     /*****************************/
     @($name = DevblocksPlatform::importGPC($_POST['name'], 'string', ''));
     @($is_disabled = DevblocksPlatform::importGPC($_POST['is_disabled'], 'integer', 0));
     @($worker_id = DevblocksPlatform::importGPC($_POST['worker_id'], 'integer', 0));
     @($rules = DevblocksPlatform::importGPC($_POST['rules'], 'array', array()));
     @($do = DevblocksPlatform::importGPC($_POST['do'], 'array', array()));
     if (empty($name)) {
         $name = $translate->_('Watcher Filter');
     }
     $criterion = array();
     $actions = array();
     // Custom fields
     $custom_fields = DAO_CustomField::getAll();
     // Criteria
     if (is_array($rules)) {
         foreach ($rules as $rule) {
             $rule = DevblocksPlatform::strAlphaNumDash($rule);
             @($value = DevblocksPlatform::importGPC($_POST['value_' . $rule], 'string', ''));
             // [JAS]: Allow empty $value (null/blank checking)
             $criteria = array('value' => $value);
             // Any special rule handling
             switch ($rule) {
                 case 'dayofweek':
                     // days
                     $days = DevblocksPlatform::importGPC($_REQUEST['value_dayofweek'], 'array', array());
                     if (in_array(0, $days)) {
                         $criteria['sun'] = 'Sunday';
                     }
                     if (in_array(1, $days)) {
                         $criteria['mon'] = 'Monday';
                     }
                     if (in_array(2, $days)) {
                         $criteria['tue'] = 'Tuesday';
                     }
                     if (in_array(3, $days)) {
                         $criteria['wed'] = 'Wednesday';
                     }
                     if (in_array(4, $days)) {
                         $criteria['thu'] = 'Thursday';
                     }
                     if (in_array(5, $days)) {
                         $criteria['fri'] = 'Friday';
                     }
                     if (in_array(6, $days)) {
                         $criteria['sat'] = 'Saturday';
                     }
                     unset($criteria['value']);
                     break;
                 case 'timeofday':
                     $from = DevblocksPlatform::importGPC($_REQUEST['timeofday_from'], 'string', '');
                     $to = DevblocksPlatform::importGPC($_REQUEST['timeofday_to'], 'string', '');
                     $criteria['from'] = $from;
                     $criteria['to'] = $to;
                     unset($criteria['value']);
                     break;
                 case 'event':
                     @($events = DevblocksPlatform::importGPC($_REQUEST['value_event'], 'array', array()));
                     if (is_array($events)) {
                         foreach ($events as $event) {
                             $criteria[$event] = true;
                         }
                     }
                     unset($criteria['value']);
                     break;
                 case 'groups':
                     @($groups = DevblocksPlatform::importGPC($_REQUEST['value_groups'], 'array', array()));
                     if (is_array($groups) && !empty($groups)) {
                         $criteria['groups'] = array();
                         foreach ($groups as $group_id) {
                             @($all = DevblocksPlatform::importGPC($_REQUEST['value_group' . $group_id . '_all'], 'integer', 0));
                             // Did we only want to watch specific buckets in this group?
                             $bucket_ids = array();
                             if (!$all) {
                                 @($bucket_ids = DevblocksPlatform::importGPC($_REQUEST['value_group' . $group_id . '_buckets'], 'array', array()));
                             }
                             // Add to criteria (key=group id, val=array of bucket ids)
                             $criteria['groups'][$group_id] = $bucket_ids;
                         }
                     }
                     unset($criteria['value']);
                     break;
                 case 'next_worker_id':
                     break;
                 case 'subject':
                     break;
                 case 'from':
                     break;
                     //				case 'tocc':
                     //					break;
                 //				case 'tocc':
                 //					break;
                 case 'header1':
                 case 'header2':
//.........这里部分代码省略.........
开发者ID:Hildy,项目名称:cerb5,代码行数:101,代码来源:App.php

示例6: saveTabInboxAddAction

 function saveTabInboxAddAction()
 {
     $translate = DevblocksPlatform::getTranslationService();
     @($id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer', 0));
     @($group_id = DevblocksPlatform::importGPC($_REQUEST['group_id'], 'integer'));
     @($view_id = DevblocksPlatform::importGPC($_REQUEST['view_id'], 'string', ''));
     @($active_worker = CerberusApplication::getActiveWorker());
     if (!$active_worker->isTeamManager($group_id) && !$active_worker->is_superuser) {
         return;
     }
     /*****************************/
     @($name = DevblocksPlatform::importGPC($_POST['name'], 'string', ''));
     @($is_sticky = DevblocksPlatform::importGPC($_POST['is_sticky'], 'integer', 0));
     @($is_stackable = DevblocksPlatform::importGPC($_POST['is_stackable'], 'integer', 0));
     @($rules = DevblocksPlatform::importGPC($_POST['rules'], 'array', array()));
     @($do = DevblocksPlatform::importGPC($_POST['do'], 'array', array()));
     if (empty($name)) {
         $name = $translate->_('mail.inbox_filter');
     }
     $criterion = array();
     $actions = array();
     // Custom fields
     $custom_fields = DAO_CustomField::getAll();
     // Criteria
     if (is_array($rules)) {
         foreach ($rules as $rule) {
             $rule = DevblocksPlatform::strAlphaNumDash($rule);
             @($value = DevblocksPlatform::importGPC($_POST['value_' . $rule], 'string', ''));
             // [JAS]: Allow empty $value (null/blank checking)
             $criteria = array('value' => $value);
             // Any special rule handling
             switch ($rule) {
                 case 'dayofweek':
                     // days
                     $days = DevblocksPlatform::importGPC($_REQUEST['value_dayofweek'], 'array', array());
                     if (in_array(0, $days)) {
                         $criteria['sun'] = 'Sunday';
                     }
                     if (in_array(1, $days)) {
                         $criteria['mon'] = 'Monday';
                     }
                     if (in_array(2, $days)) {
                         $criteria['tue'] = 'Tuesday';
                     }
                     if (in_array(3, $days)) {
                         $criteria['wed'] = 'Wednesday';
                     }
                     if (in_array(4, $days)) {
                         $criteria['thu'] = 'Thursday';
                     }
                     if (in_array(5, $days)) {
                         $criteria['fri'] = 'Friday';
                     }
                     if (in_array(6, $days)) {
                         $criteria['sat'] = 'Saturday';
                     }
                     unset($criteria['value']);
                     break;
                 case 'timeofday':
                     $from = DevblocksPlatform::importGPC($_REQUEST['timeofday_from'], 'string', '');
                     $to = DevblocksPlatform::importGPC($_REQUEST['timeofday_to'], 'string', '');
                     $criteria['from'] = $from;
                     $criteria['to'] = $to;
                     unset($criteria['value']);
                     break;
                 case 'subject':
                     break;
                 case 'from':
                     break;
                 case 'tocc':
                     break;
                 case 'header1':
                 case 'header2':
                 case 'header3':
                 case 'header4':
                 case 'header5':
                     if (null != @($header = DevblocksPlatform::importGPC($_POST[$rule], 'string', null))) {
                         $criteria['header'] = strtolower($header);
                     }
                     break;
                 case 'body':
                     break;
                 case 'attachment':
                     break;
                 default:
                     // ignore invalids
                     // Custom fields
                     if ("cf_" == substr($rule, 0, 3)) {
                         $field_id = intval(substr($rule, 3));
                         if (!isset($custom_fields[$field_id])) {
                             continue;
                         }
                         // [TODO] Operators
                         switch ($custom_fields[$field_id]->type) {
                             case 'S':
                                 // string
                             // string
                             case 'T':
                                 // clob
                             // clob
//.........这里部分代码省略.........
开发者ID:Hildy,项目名称:cerb5,代码行数:101,代码来源:groups.php

示例7: saveAddInboxRulePanelAction

 function saveAddInboxRulePanelAction()
 {
     $translate = DevblocksPlatform::getTranslationService();
     @($view_id = DevblocksPlatform::importGPC($_REQUEST['view_id'], 'string', ''));
     @($group_id = DevblocksPlatform::importGPC($_REQUEST['group_id'], 'integer'));
     $view = C4_AbstractViewLoader::getView('C4_TicketView', $view_id);
     /* @var $view C4_TicketView */
     if (empty($group_id)) {
         $view->render();
         exit;
     }
     @($name = DevblocksPlatform::importGPC($_POST['name'], 'string', ''));
     @($rules = DevblocksPlatform::importGPC($_POST['rules'], 'array', array()));
     @($do = DevblocksPlatform::importGPC($_POST['do'], 'array', array()));
     if (empty($name)) {
         $name = $translate->_('mail.inbox_filter');
     }
     $criterion = array();
     $actions = array();
     // Criteria
     if (is_array($rules)) {
         foreach ($rules as $rule) {
             $rule = DevblocksPlatform::strAlphaNumDash($rule);
             @($value = DevblocksPlatform::importGPC($_POST['value_' . $rule], 'string', ''));
             // [JAS]: Allow empty $value (null/blank checking)
             $criteria = array('value' => $value);
             // Any special rule handling
             switch ($rule) {
                 case 'subject':
                     break;
                 case 'from':
                     break;
                 case 'tocc':
                     break;
                 case 'header1':
                 case 'header2':
                 case 'header3':
                 case 'header4':
                 case 'header5':
                     if (null != @($header = DevblocksPlatform::importGPC($_POST[$rule], 'string', null))) {
                         $criteria['header'] = strtolower($header);
                     }
                     break;
                 case 'body':
                     break;
                 case 'attachment':
                     break;
                 default:
                     // ignore invalids
                     continue;
                     break;
             }
             $criterion[$rule] = $criteria;
         }
     }
     // Actions
     if (is_array($do)) {
         foreach ($do as $act) {
             $action = array();
             switch ($act) {
                 // Move group/bucket
                 case 'move':
                     @($move_code = DevblocksPlatform::importGPC($_REQUEST['do_move'], 'string', null));
                     if (0 != strlen($move_code)) {
                         list($g_id, $b_id) = CerberusApplication::translateTeamCategoryCode($move_code);
                         $action = array('group_id' => intval($g_id), 'bucket_id' => intval($b_id));
                     }
                     break;
                     // Assign to worker
                 // Assign to worker
                 case 'assign':
                     @($worker_id = DevblocksPlatform::importGPC($_REQUEST['do_assign'], 'string', null));
                     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 'status':
                     @($status = DevblocksPlatform::importGPC($_REQUEST['do_status'], 'string', null));
                     if (0 != strlen($status)) {
                         $action = array('is_closed' => 0 == $status ? 0 : 1, 'is_deleted' => 2 == $status ? 1 : 0);
                     }
                     break;
                 default:
                     // ignore invalids
                     continue;
                     break;
             }
             $actions[$act] = $action;
         }
     }
//.........这里部分代码省略.........
开发者ID:joegeck,项目名称:cerb4,代码行数:101,代码来源:tickets.php

示例8: saveTabPreParserAction

 function saveTabPreParserAction()
 {
     @($id = DevblocksPlatform::importGPC($_POST['id'], 'integer', 0));
     @($name = DevblocksPlatform::importGPC($_POST['name'], 'string', ''));
     @($rules = DevblocksPlatform::importGPC($_POST['rules'], 'array', array()));
     @($do = DevblocksPlatform::importGPC($_POST['do'], 'array', array()));
     if (DEMO_MODE) {
         DevblocksPlatform::setHttpResponse(new DevblocksHttpResponse(array('config', 'preparser')));
         return;
     }
     $criterion = array();
     $actions = array();
     // Criteria
     if (is_array($rules)) {
         foreach ($rules as $rule) {
             $rule = DevblocksPlatform::strAlphaNumDash($rule);
             @($value = DevblocksPlatform::importGPC($_POST['value_' . $rule], 'string', ''));
             // [JAS]: Allow empty $value (null/blank checking)
             $criteria = array('value' => $value);
             // Any special rule handling
             switch ($rule) {
                 case 'type':
                     break;
                 case 'from':
                     break;
                 case 'to':
                     break;
                 case 'header1':
                 case 'header2':
                 case 'header3':
                 case 'header4':
                 case 'header5':
                     if (null != @($header = DevblocksPlatform::importGPC($_POST[$rule], 'string', null))) {
                         $criteria['header'] = strtolower($header);
                     }
                     break;
                 case 'body':
                     break;
                 case 'body_encoding':
                     break;
                 case 'attachment':
                     break;
                 default:
                     // ignore invalids
                     continue;
                     break;
             }
             $criterion[$rule] = $criteria;
         }
     }
     // Actions
     if (is_array($do)) {
         foreach ($do as $act) {
             $action = array();
             switch ($act) {
                 case 'blackhole':
                     $action = array();
                     break;
                 case 'redirect':
                     if (null != @($to = DevblocksPlatform::importGPC($_POST['do_redirect'], 'string', null))) {
                         $action = array('to' => $to);
                     }
                     break;
                 case 'bounce':
                     if (null != @($msg = DevblocksPlatform::importGPC($_POST['do_bounce'], 'string', null))) {
                         $action = array('message' => $msg);
                     }
                     break;
                 default:
                     // ignore invalids
                     continue;
                     break;
             }
             $actions[$act] = $action;
         }
     }
     if (!empty($criterion) && !empty($actions)) {
         if (empty($id)) {
             $fields = array(DAO_PreParseRule::NAME => $name, DAO_PreParseRule::CRITERIA_SER => serialize($criterion), DAO_PreParseRule::ACTIONS_SER => serialize($actions), DAO_PreParseRule::POS => 0);
             $id = DAO_PreParseRule::create($fields);
         } else {
             $fields = array(DAO_PreParseRule::NAME => $name, DAO_PreParseRule::CRITERIA_SER => serialize($criterion), DAO_PreParseRule::ACTIONS_SER => serialize($actions));
             DAO_PreParseRule::update($id, $fields);
         }
     }
     DevblocksPlatform::setHttpResponse(new DevblocksHttpResponse(array('config', 'preparser')));
 }
开发者ID:Hildy,项目名称:cerb4,代码行数:87,代码来源:config.php

示例9: saveAlertPeekAction

 function saveAlertPeekAction()
 {
     $translate = DevblocksPlatform::getTranslationService();
     @($id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer', 0));
     @($view_id = DevblocksPlatform::importGPC($_POST['view_id'], 'string'));
     @($active_worker = PortSensorApplication::getActiveWorker());
     /*****************************/
     @($name = DevblocksPlatform::importGPC($_POST['name'], 'string', ''));
     @($is_disabled = DevblocksPlatform::importGPC($_POST['is_disabled'], 'integer', 0));
     @($worker_id = DevblocksPlatform::importGPC($_POST['worker_id'], 'integer', 0));
     @($rules = DevblocksPlatform::importGPC($_POST['rules'], 'array', array()));
     @($do = DevblocksPlatform::importGPC($_POST['do'], 'array', array()));
     @($delete = DevblocksPlatform::importGPC($_POST['do_delete'], 'integer', 0));
     if (!empty($id) && !empty($delete)) {
         DAO_Alert::delete($id);
     } else {
         if (empty($name)) {
             $name = $translate->_('Alert');
         }
         $criterion = array();
         $actions = array();
         // Custom fields
         $custom_fields = DAO_CustomField::getAll();
         $alert_criteria_exts = DevblocksPlatform::getExtensions('portsensor.alert.criteria', false);
         // Criteria
         if (is_array($rules)) {
             foreach ($rules as $rule) {
                 $rule = DevblocksPlatform::strAlphaNumDash($rule);
                 @($value = DevblocksPlatform::importGPC($_POST['value_' . $rule], 'string', ''));
                 // [JAS]: Allow empty $value (null/blank checking)
                 $criteria = array('value' => $value);
                 // Any special rule handling
                 switch ($rule) {
                     case 'dayofweek':
                         // days
                         $days = DevblocksPlatform::importGPC($_REQUEST['value_dayofweek'], 'array', array());
                         if (in_array(0, $days)) {
                             $criteria['sun'] = 'Sunday';
                         }
                         if (in_array(1, $days)) {
                             $criteria['mon'] = 'Monday';
                         }
                         if (in_array(2, $days)) {
                             $criteria['tue'] = 'Tuesday';
                         }
                         if (in_array(3, $days)) {
                             $criteria['wed'] = 'Wednesday';
                         }
                         if (in_array(4, $days)) {
                             $criteria['thu'] = 'Thursday';
                         }
                         if (in_array(5, $days)) {
                             $criteria['fri'] = 'Friday';
                         }
                         if (in_array(6, $days)) {
                             $criteria['sat'] = 'Saturday';
                         }
                         unset($criteria['value']);
                         break;
                     case 'timeofday':
                         $from = DevblocksPlatform::importGPC($_REQUEST['timeofday_from'], 'string', '');
                         $to = DevblocksPlatform::importGPC($_REQUEST['timeofday_to'], 'string', '');
                         $criteria['from'] = $from;
                         $criteria['to'] = $to;
                         unset($criteria['value']);
                         break;
                     case 'event':
                         @($events = DevblocksPlatform::importGPC($_REQUEST['value_event'], 'array', array()));
                         if (is_array($events)) {
                             foreach ($events as $event) {
                                 $criteria[$event] = true;
                             }
                         }
                         unset($criteria['value']);
                         break;
                     case 'alert_last_ran':
                         @($from = DevblocksPlatform::importGPC($_REQUEST['value_alert_last_ran_from'], 'string', ''));
                         @($to = DevblocksPlatform::importGPC($_REQUEST['value_alert_last_ran_to'], 'string', ''));
                         $criteria['from'] = $from;
                         $criteria['to'] = $to;
                         unset($criteria['value']);
                         break;
                     case 'sensor_name':
                         break;
                     case 'sensor_fail_count':
                         $oper = DevblocksPlatform::importGPC($_REQUEST['oper_sensor_fail_count'], 'string', '=');
                         $criteria['oper'] = $oper;
                         break;
                     case 'sensor_type':
                         @($types = DevblocksPlatform::importGPC($_REQUEST['value_sensor_types'], 'array', array()));
                         if (is_array($types)) {
                             foreach ($types as $type) {
                                 $criteria[$type] = true;
                             }
                         }
                         unset($criteria['value']);
                         break;
                     default:
                         // ignore invalids // [TODO] Very redundant
                         // Custom fields
//.........这里部分代码省略.........
开发者ID:jstanden,项目名称:portsensor,代码行数:101,代码来源:preferences.php

示例10: saveTabInboxAddAction

 function saveTabInboxAddAction()
 {
     $translate = DevblocksPlatform::getTranslationService();
     @($id = DevblocksPlatform::importGPC($_REQUEST['id'], 'integer', 0));
     @($group_id = DevblocksPlatform::importGPC($_REQUEST['group_id'], 'integer'));
     @($active_worker = CerberusApplication::getActiveWorker());
     if (!$active_worker->isTeamManager($group_id) && !$active_worker->is_superuser) {
         return;
     }
     /*****************************/
     @($name = DevblocksPlatform::importGPC($_POST['name'], 'string', ''));
     @($is_sticky = DevblocksPlatform::importGPC($_POST['is_sticky'], 'integer', 0));
     @($is_stackable = DevblocksPlatform::importGPC($_POST['is_stackable'], 'integer', 0));
     @($rules = DevblocksPlatform::importGPC($_POST['rules'], 'array', array()));
     @($do = DevblocksPlatform::importGPC($_POST['do'], 'array', array()));
     if (empty($name)) {
         $name = $translate->_('mail.inbox_filter');
     }
     $criterion = array();
     $actions = array();
     // Custom fields
     $custom_fields = DAO_CustomField::getAll();
     // Criteria
     if (is_array($rules)) {
         foreach ($rules as $rule) {
             $rule = DevblocksPlatform::strAlphaNumDash($rule);
             @($value = DevblocksPlatform::importGPC($_POST['value_' . $rule], 'string', ''));
             // [JAS]: Allow empty $value (null/blank checking)
             $criteria = array('value' => $value);
             // Any special rule handling
             switch ($rule) {
                 case 'subject':
                     break;
                 case 'from':
                     break;
                 case 'tocc':
                     break;
                 case 'header1':
                 case 'header2':
                 case 'header3':
                 case 'header4':
                 case 'header5':
                     if (null != @($header = DevblocksPlatform::importGPC($_POST[$rule], 'string', null))) {
                         $criteria['header'] = strtolower($header);
                     }
                     break;
                 case 'body':
                     break;
                 case 'attachment':
                     break;
                 default:
                     // ignore invalids
                     // Custom fields
                     if ("cf_" == substr($rule, 0, 3)) {
                         $field_id = intval(substr($rule, 3));
                         if (!isset($custom_fields[$field_id])) {
                             continue;
                         }
                         // [TODO] Operators
                         switch ($custom_fields[$field_id]->type) {
                             case 'S':
                                 // string
                             // string
                             case 'T':
                                 // clob
                                 $oper = DevblocksPlatform::importGPC($_REQUEST['value_cf_' . $field_id . '_oper'], 'string', 'regexp');
                                 $criteria['oper'] = $oper;
                                 break;
                             case 'D':
                                 // dropdown
                             // dropdown
                             case 'M':
                                 // multi-dropdown
                             // multi-dropdown
                             case 'X':
                                 // multi-checkbox
                                 $in_array = DevblocksPlatform::importGPC($_REQUEST['value_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;
                                     }
                                 }
                                 $criteria['value'] = $out_array;
                                 break;
                             case 'E':
                                 // date
                                 $from = DevblocksPlatform::importGPC($_REQUEST['value_cf_' . $field_id . '_from'], 'string', '0');
                                 $to = DevblocksPlatform::importGPC($_REQUEST['value_cf_' . $field_id . '_to'], 'string', 'now');
                                 $criteria['from'] = $from;
                                 $criteria['to'] = $to;
                                 unset($criteria['value']);
                                 break;
                             case 'N':
                                 // number
                                 $oper = DevblocksPlatform::importGPC($_REQUEST['value_cf_' . $field_id . '_oper'], 'string', '=');
                                 $criteria['oper'] = $oper;
                                 $criteria['value'] = intval($value);
                                 break;
//.........这里部分代码省略.........
开发者ID:joegeck,项目名称:cerb4,代码行数:101,代码来源:groups.php


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