當前位置: 首頁>>代碼示例>>PHP>>正文


PHP CRM_Core_Key::valid方法代碼示例

本文整理匯總了PHP中CRM_Core_Key::valid方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Core_Key::valid方法的具體用法?PHP CRM_Core_Key::valid怎麽用?PHP CRM_Core_Key::valid使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在CRM_Core_Key的用法示例。


在下文中一共展示了CRM_Core_Key::valid方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: qfKey

 static function qfKey($key)
 {
     return $key ? CRM_Core_Key::valid($key) : FALSE;
 }
開發者ID:archcidburnziso,項目名稱:civicrm-core,代碼行數:4,代碼來源:Rule.php

示例2: setContext

 function setContext()
 {
     $qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
     $context = CRM_Utils_Request::retrieve('context', 'String', $this, FALSE, 'search');
     $compContext = CRM_Utils_Request::retrieve('compContext', 'String', $this);
     //swap the context.
     if ($context == 'search' && $compContext) {
         $context = $compContext;
     } else {
         $compContext = NULL;
     }
     // make sure we dont get tricked with a bad key
     // so check format
     if (!CRM_Core_Key::valid($qfKey)) {
         $qfKey = NULL;
     }
     $session = CRM_Core_Session::singleton();
     switch ($context) {
         case 'user':
             $url = CRM_Utils_System::url('civicrm/user', 'reset=1');
             break;
         case 'dashboard':
             $url = CRM_Utils_System::url('civicrm/contribute', 'reset=1');
             break;
         case 'pledgeDashboard':
             $url = CRM_Utils_System::url('civicrm/pledge', 'reset=1');
             break;
         case 'contribution':
             $url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&force=1&cid={$this->_contactId}&selectedChild=contribute");
             break;
         case 'search':
         case 'advanced':
             $extraParams = "force=1";
             if ($qfKey) {
                 $extraParams .= "&qfKey={$qfKey}";
             }
             $this->assign('searchKey', $qfKey);
             if ($context == 'advanced') {
                 $url = CRM_Utils_System::url('civicrm/contact/search/advanced', $extraParams);
             } else {
                 $url = CRM_Utils_System::url('civicrm/contribute/search', $extraParams);
             }
             break;
         case 'home':
             $url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
             break;
         case 'activity':
             $url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&force=1&cid={$this->_contactId}&selectedChild=activity");
             break;
         case 'member':
         case 'membership':
             $componentId = CRM_Utils_Request::retrieve('compId', 'Positive', $this);
             $componentAction = CRM_Utils_Request::retrieve('compAction', 'Integer', $this);
             $context = 'membership';
             $searchKey = NULL;
             if ($compContext) {
                 $context = 'search';
                 if ($qfKey) {
                     $searchKey = "&key={$qfKey}";
                 }
                 $compContext = "&compContext={$compContext}";
             }
             if ($componentAction & CRM_Core_Action::VIEW) {
                 $action = 'view';
             } else {
                 $action = 'update';
             }
             $url = CRM_Utils_System::url('civicrm/contact/view/membership', "reset=1&action={$action}&id={$componentId}&cid={$this->_contactId}&context={$context}&selectedChild=member{$searchKey}{$compContext}");
             break;
         case 'participant':
             $componentId = CRM_Utils_Request::retrieve('compId', 'Positive', $this);
             $componentAction = CRM_Utils_Request::retrieve('compAction', 'Integer', $this);
             $context = 'participant';
             $searchKey = NULL;
             if ($compContext) {
                 $context = 'search';
                 if ($qfKey) {
                     $searchKey = "&key={$qfKey}";
                 }
                 $compContext = "&compContext={$compContext}";
             }
             if ($componentAction == CRM_Core_Action::VIEW) {
                 $action = 'view';
             } else {
                 $action = 'update';
             }
             $url = CRM_Utils_System::url('civicrm/contact/view/participant', "reset=1&action={$action}&id={$componentId}&cid={$this->_contactId}&context={$context}&selectedChild=event{$searchKey}{$compContext}");
             break;
         case 'pledge':
             $url = CRM_Utils_System::url('civicrm/contact/view', "reset=1&force=1&cid={$this->_contactId}&selectedChild=pledge");
             break;
         case 'standalone':
             $url = CRM_Utils_System::url('civicrm/dashboard', 'reset=1');
             break;
         case 'fulltext':
             $keyName = '&qfKey';
             $urlParams = 'force=1';
             $urlString = 'civicrm/contact/search/custom';
             if ($this->_action == CRM_Core_Action::UPDATE) {
                 if ($this->_contactId) {
//.........這裏部分代碼省略.........
開發者ID:archcidburnziso,項目名稱:civicrm-core,代碼行數:101,代碼來源:Tab.php

示例3: qfKey

 static function qfKey($key)
 {
     require_once 'CRM/Core/Key.php';
     return $key ? CRM_Core_Key::valid($key) : false;
 }
開發者ID:hampelm,項目名稱:Ginsberg-CiviDemo,代碼行數:5,代碼來源:Rule.php


注:本文中的CRM_Core_Key::valid方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。