Example #1
0
 /**
  * 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);
     }
 }
Example #2
0
 /**
  * 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();
 }
Example #3
0
 /**
  * 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();
 }
Example #4
0
 /**
  * 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();
 }