本文整理匯總了PHP中CRM_Price_BAO_PriceFieldValue::getOptionLabel方法的典型用法代碼示例。如果您正苦於以下問題:PHP CRM_Price_BAO_PriceFieldValue::getOptionLabel方法的具體用法?PHP CRM_Price_BAO_PriceFieldValue::getOptionLabel怎麽用?PHP CRM_Price_BAO_PriceFieldValue::getOptionLabel使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CRM_Price_BAO_PriceFieldValue
的用法示例。
在下文中一共展示了CRM_Price_BAO_PriceFieldValue::getOptionLabel方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: edit
/**
* edit custom Option.
*
* editing would involved modifying existing fields + adding data to new fields.
*
* @param string $action the action to be invoked
*
* @return void
* @access public
*/
function edit($action)
{
$oid = CRM_Utils_Request::retrieve('oid', 'Positive', $this, FALSE, 0);
$params = array();
if ($oid) {
$params['oid'] = $oid;
$sid = CRM_Price_BAO_PriceSet::getSetId($params);
$usedBy = CRM_Price_BAO_PriceSet::getUsedBy($sid);
}
// set the userContext stack
$session = CRM_Core_Session::singleton();
$session->pushUserContext(CRM_Utils_System::url('civicrm/admin/price/field/option', "reset=1&action=browse&fid={$this->_fid}&sid={$this->_sid}"));
$controller = new CRM_Core_Controller_Simple('CRM_Price_Form_Option', ts('Price Field Option'), $action);
$controller->set('fid', $this->_fid);
$controller->setEmbedded(TRUE);
$controller->process();
$controller->run();
$this->browse();
if ($action & CRM_Core_Action::DELETE) {
// add breadcrumb
$url = CRM_Utils_System::url('civicrm/admin/price/field/option', 'reset=1');
CRM_Utils_System::appendBreadCrumb(ts('Price Option'), $url);
$this->assign('usedPriceSetTitle', CRM_Price_BAO_PriceFieldValue::getOptionLabel($oid));
$this->assign('usedBy', $usedBy);
$comps = array("Event" => "civicrm_event", "Contribution" => "civicrm_contribution_page");
$priceSetContexts = array();
foreach ($comps as $name => $table) {
if (array_key_exists($table, $usedBy)) {
$priceSetContexts[] = $name;
}
}
$this->assign('contexts', $priceSetContexts);
}
}