本文整理匯總了PHP中CRM_PCP_BAO_PCP::setIsActive方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_PCP_BAO_PCP::setIsActive方法的具體用法?PHP CRM_PCP_BAO_PCP::setIsActive怎麽用?PHP CRM_PCP_BAO_PCP::setIsActive使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_PCP_BAO_PCP
的用法示例。
在下文中一共展示了CRM_PCP_BAO_PCP::setIsActive方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: run
/**
* Run the page.
*
* This method is called after the page is created. It checks for the
* type of action and executes that action.
* Finally it calls the parent's run method.
*
* @param
*
* @return void
* @access public
*/
function run()
{
// get the requested action
$action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
if ($action & CRM_Core_Action::REVERT) {
$id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
CRM_PCP_BAO_PCP::setIsActive($id, 0);
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1'));
} elseif ($action & CRM_Core_Action::RENEW) {
$id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
CRM_PCP_BAO_PCP::setIsActive($id, 1);
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1'));
} elseif ($action & CRM_Core_Action::DELETE) {
$id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE);
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url(CRM_Utils_System::currentPath(), 'reset=1&action=browse'));
$controller = new CRM_Core_Controller_Simple('CRM_PCP_Form_PCP', 'Personal Campaign Page', CRM_Core_Action::DELETE);
//$this->setContext( $id, $action );
$controller->set('id', $id);
$controller->process();
return $controller->run();
}
// finally browse
$this->browse();
// parent run
parent::run();
}