X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FAdmin%2FForm%2FPreferences%2FDisplay.php;h=503582934d408f697d696ffe3fd0eb11049e3989;hb=7af8604cc04e13b5dc4220ad16cb4eb21d2b9b23;hp=332cc28b17d6354fa916f21686669821bf936e18;hpb=6cc256693c25de60d6877cdccf47243c545c5531;p=civicrm-core.git diff --git a/CRM/Admin/Form/Preferences/Display.php b/CRM/Admin/Form/Preferences/Display.php index 332cc28b17..503582934d 100644 --- a/CRM/Admin/Form/Preferences/Display.php +++ b/CRM/Admin/Form/Preferences/Display.php @@ -1,7 +1,7 @@ _config->editor_id) { - $defaults['editor_id'] = $this->_config->editor_id; - } - if (empty($this->_config->display_name_format)) { - $defaults['display_name_format'] = "{contact.individual_prefix}{ }{contact.first_name}{ }{contact.last_name}{ }{contact.individual_suffix}"; - } - else { + if ($this->_config->display_name_format) { $defaults['display_name_format'] = $this->_config->display_name_format; } - - if (empty($this->_config->sort_name_format)) { - $defaults['sort_name_format'] = "{contact.last_name}{, }{contact.first_name}"; - } - else { + if ($this->_config->sort_name_format) { $defaults['sort_name_format'] = $this->_config->sort_name_format; } @@ -140,16 +130,16 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences { * @return void */ public function buildQuickForm() { - $wysiwyg_options = CRM_Core_OptionGroup::values('wysiwyg_editor'); + $wysiwyg_options = CRM_Core_OptionGroup::values('wysiwyg_editor', FALSE, FALSE, FALSE, NULL, 'label', TRUE, FALSE, 'name'); //changes for freezing the invoices/credit notes checkbox if invoicing is uncheck $invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings'); $invoicing = CRM_Utils_Array::value('invoicing', $invoiceSettings); $this->assign('invoicing', $invoicing); - $config = CRM_Core_Config::singleton(); $extra = array(); $this->addElement('select', 'editor_id', ts('WYSIWYG Editor'), $wysiwyg_options, $extra); + $this->addElement('submit', 'ckeditor_config', ts('Configure CKEditor')); $editOptions = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 0'); $this->assign('editOptions', $editOptions); @@ -195,6 +185,15 @@ class CRM_Admin_Form_Preferences_Display extends CRM_Admin_Form_Preferences { $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); + } } }