本文整理汇总了PHP中CRM_Core_BAO_CustomField::getTitle方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_CustomField::getTitle方法的具体用法?PHP CRM_Core_BAO_CustomField::getTitle怎么用?PHP CRM_Core_BAO_CustomField::getTitle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_CustomField
的用法示例。
在下文中一共展示了CRM_Core_BAO_CustomField::getTitle方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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.
*
* @param null
*
* @return void
* @access public
*/
function run()
{
require_once 'CRM/Core/BAO/CustomField.php';
// get the field id
$this->_fid = CRM_Utils_Request::retrieve('fid', $this, false, 0);
$this->_gid = CRM_Utils_Request::retrieve('gid', $this, false, 0);
if ($this->_fid) {
$fieldTitle = CRM_Core_BAO_CustomField::getTitle($this->_fid);
$this->assign('fid', $this->_fid);
$this->assign('fieldTitle', $fieldTitle);
CRM_Utils_System::setTitle(ts('%1 - Multiple Choice Options', array(1 => $fieldTitle)));
}
// get the requested action
$action = CRM_Utils_Request::retrieve('action', $this, false, 'browse');
// default to 'browse'
// assign vars to templates
$this->assign('action', $action);
$id = CRM_Utils_Request::retrieve('id', $this, false, 0);
// what action to take ?
if ($action & (CRM_CORE_ACTION_UPDATE | CRM_CORE_ACTION_ADD | CRM_CORE_ACTION_VIEW | CRM_CORE_ACTION_DELETE)) {
$this->edit($action);
// no browse for edit/update/view
} else {
if ($action & CRM_CORE_ACTION_DISABLE) {
CRM_Core_BAO_CustomOption::setIsActive($id, 0);
} else {
if ($action & CRM_CORE_ACTION_ENABLE) {
CRM_Core_BAO_CustomOption::setIsActive($id, 1);
}
}
$this->browse();
}
// Call the parents run method
parent::run();
}
示例2: run
/**
* Run the page.
*
* This method is called after the page is created. It checks for the
* type of action and executes that action.
*
* @return void
*/
public function run()
{
// get the field id
$this->_fid = CRM_Utils_Request::retrieve('fid', 'Positive', $this, FALSE, 0);
$this->_gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, FALSE, 0);
if ($isReserved = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $this->_gid, 'is_reserved', 'id')) {
CRM_Core_Error::fatal("You cannot add or edit muliple choice options in a reserved custom field-set.");
}
//as url contain $gid so append breadcrumb dynamically.
$breadcrumb = array(array('title' => ts('Custom Data Fields'), 'url' => CRM_Utils_System::url('civicrm/admin/custom/group/field', 'reset=1&gid=' . $this->_gid)));
CRM_Utils_System::appendBreadCrumb($breadcrumb);
if ($this->_fid) {
$fieldTitle = CRM_Core_BAO_CustomField::getTitle($this->_fid);
$this->assign('fid', $this->_fid);
$this->assign('gid', $this->_gid);
$this->assign('fieldTitle', $fieldTitle);
CRM_Utils_System::setTitle(ts('%1 - Multiple Choice Options', array(1 => $fieldTitle)));
}
// get the requested action
$action = CRM_Utils_Request::retrieve('action', 'String', $this, FALSE, 'browse');
// assign vars to templates
$this->assign('action', $action);
$id = CRM_Utils_Request::retrieve('id', 'Positive', $this, FALSE, 0);
// what action to take ?
if ($action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::VIEW | CRM_Core_Action::DELETE) || !empty($_POST)) {
// no browse for edit/update/view
$this->edit($action);
} else {
$this->browse();
}
// Call the parents run method
return parent::run();
}
示例3: run
/**
* Run the page.
*
* This method is called after the page is created. It checks for the
* type of action and executes that action.
*
* @param null
*
* @return void
* @access public
*/
function run()
{
require_once 'CRM/Core/BAO/CustomField.php';
// get the field id
$this->_fid = CRM_Utils_Request::retrieve('fid', 'Positive', $this, false, 0);
$this->_gid = CRM_Utils_Request::retrieve('gid', 'Positive', $this, false, 0);
//as url contain $gid so append breadcrumb dynamically.
$breadcrumb = array(array('title' => ts('Custom Data Fields'), 'url' => CRM_Utils_System::url('civicrm/admin/custom/group/field', 'reset=1&gid=' . $this->_gid)));
CRM_Utils_System::appendBreadCrumb($breadcrumb);
if ($this->_fid) {
$fieldTitle = CRM_Core_BAO_CustomField::getTitle($this->_fid);
$this->assign('fid', $this->_fid);
$this->assign('gid', $this->_gid);
$this->assign('fieldTitle', $fieldTitle);
CRM_Utils_System::setTitle(ts('%1 - Multiple Choice Options', array(1 => $fieldTitle)));
}
// get the requested action
$action = CRM_Utils_Request::retrieve('action', 'String', $this, false, 'browse');
// default to 'browse'
// assign vars to templates
$this->assign('action', $action);
$id = CRM_Utils_Request::retrieve('id', 'Positive', $this, false, 0);
// what action to take ?
if ($action & (CRM_Core_Action::UPDATE | CRM_Core_Action::ADD | CRM_Core_Action::VIEW | CRM_Core_Action::DELETE)) {
$this->edit($action);
// no browse for edit/update/view
} else {
require_once 'CRM/Core/BAO/OptionValue.php';
$this->browse();
}
// Call the parents run method
parent::run();
}