本文整理汇总了PHP中CRM_Core_BAO_OptionValue::updateOptionWeights方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Core_BAO_OptionValue::updateOptionWeights方法的具体用法?PHP CRM_Core_BAO_OptionValue::updateOptionWeights怎么用?PHP CRM_Core_BAO_OptionValue::updateOptionWeights使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Core_BAO_OptionValue
的用法示例。
在下文中一共展示了CRM_Core_BAO_OptionValue::updateOptionWeights方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: postProcess
/**
* Process the form submission.
*
*
* @return void
*/
public function postProcess()
{
if ($this->_action == CRM_Core_Action::VIEW) {
return;
}
$this->_params = $this->controller->exportValues($this->_name);
if (!empty($this->_params['contact_edit_preferences'])) {
$preferenceWeights = explode(',', $this->_params['contact_edit_preferences']);
foreach ($preferenceWeights as $key => $val) {
if (!$val) {
unset($preferenceWeights[$key]);
}
}
$opGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'contact_edit_options', 'id', 'name');
CRM_Core_BAO_OptionValue::updateOptionWeights($opGroupId, array_flip($preferenceWeights));
}
$this->_config->editor_id = $this->_params['editor_id'];
$this->postProcessCommon();
// If "Configure CKEditor" button was clicked
if (!empty($this->_params['ckeditor_config'])) {
// Suppress the "Saved" status message and redirect to the CKEditor Config page
$session = CRM_Core_Session::singleton();
$session->getStatus(TRUE);
$url = CRM_Utils_System::url('civicrm/admin/ckeditor', 'reset=1');
$session->pushUserContext($url);
}
}
示例2: postProcess
/**
* Process the form submission.
*
*
* @return void
*/
public function postProcess()
{
if ($this->_action == CRM_Core_Action::VIEW) {
return;
}
$this->_params = $this->controller->exportValues($this->_name);
if (!empty($this->_params['contact_edit_preferences'])) {
$preferenceWeights = explode(',', $this->_params['contact_edit_preferences']);
foreach ($preferenceWeights as $key => $val) {
if (!$val) {
unset($preferenceWeights[$key]);
}
}
$opGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'contact_edit_options', 'id', 'name');
CRM_Core_BAO_OptionValue::updateOptionWeights($opGroupId, array_flip($preferenceWeights));
}
$this->_config->editor_id = $this->_params['editor_id'];
$this->postProcessCommon();
}
示例3: postProcess
/**
* Function to process the form
*
* @access public
*
* @return void
*/
public function postProcess()
{
if ($this->_action == CRM_Core_Action::VIEW) {
return;
}
$this->_params = $this->controller->exportValues($this->_name);
if (!empty($this->_params['contact_edit_preferences'])) {
$preferenceWeights = explode(',', $this->_params['contact_edit_preferences']);
foreach ($preferenceWeights as $key => $val) {
if (!$val) {
unset($preferenceWeights[$key]);
}
}
$opGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'contact_edit_options', 'id', 'name');
CRM_Core_BAO_OptionValue::updateOptionWeights($opGroupId, array_flip($preferenceWeights));
}
$config = CRM_Core_Config::singleton();
if ($config->userSystem->is_drupal == '1' && module_exists("wysiwyg")) {
variable_set('civicrm_wysiwyg_input_format', $this->_params['wysiwyg_input_format']);
}
$this->_config->editor_id = $this->_params['editor_id'];
// set default editor to session if changed
$session = CRM_Core_Session::singleton();
$session->set('defaultWysiwygEditor', $this->_params['editor_id']);
$this->postProcessCommon();
}
示例4: postProcess
/**
* Function to process the form
*
* @access public
* @return None
*/
public function postProcess()
{
if ($this->_action == CRM_Core_Action::VIEW) {
return;
}
$this->_params = $this->controller->exportValues($this->_name);
if (CRM_Utils_Array::value('contact_edit_prefences', $this->_params)) {
$preferenceWeights = explode(',', $this->_params['contact_edit_prefences']);
foreach ($preferenceWeights as $key => $val) {
if (!$val) {
unset($preferenceWeights[$key]);
}
}
require_once 'CRM/Core/BAO/OptionValue.php';
$opGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_OptionGroup', 'contact_edit_options', 'id', 'name');
CRM_Core_BAO_OptionValue::updateOptionWeights($opGroupId, array_flip($preferenceWeights));
}
$this->_config->editor_id = $this->_params['wysiwyg_editor'];
$this->_config->display_name_format = $this->_params['display_name_format'];
$this->_config->sort_name_format = $this->_params['sort_name_format'];
// set default editor to session if changed
$session = CRM_Core_Session::singleton();
$session->set('defaultWysiwygEditor', $this->_params['wysiwyg_editor']);
parent::postProcess();
}