<?php
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
+ | CiviCRM version 4.7 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
*
* @package CRM
* @copyright CiviCRM LLC (c) 2004-2015
- * $Id: Display.php 45499 2013-02-08 12:31:05Z kurund $
- *
*/
/**
$defaults = parent::setDefaultValues();
parent::cbsDefaultValues($defaults);
- if ($this->_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;
}
/**
* Build the form object.
- *
- * @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);
/**
* Process the form submission.
- *
- *
- * @return void
*/
public function postProcess() {
if ($this->_action == CRM_Core_Action::VIEW) {
$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);
+ }
}
}