本文整理汇总了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;
}
示例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) {
//.........这里部分代码省略.........
示例3: qfKey
static function qfKey($key)
{
require_once 'CRM/Core/Key.php';
return $key ? CRM_Core_Key::valid($key) : false;
}