$defaults = parent::setDefaultValues();
parent::cbsDefaultValues($defaults);
- if ($this->_config->editor_id) {
- $defaults['editor_id'] = $this->_config->editor_id;
- }
if ($this->_config->display_name_format) {
$defaults['display_name_format'] = $this->_config->display_name_format;
}
* @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);
"js/crm.ajax.js",
);
// add wysiwyg editor
- $editorID = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'editor_id');
- $editor = CRM_Utils_Array::value($editorID,
- CRM_Core_OptionGroup::values('wysiwyg_editor', FALSE, FALSE, FALSE, NULL, 'name')
- );
+ $editor = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME, 'editor_id');
$items[] = "js/wysiwyg/crm.wysiwyg.js";
if ($editor == "CKEditor") {
$items[] = "bower_components/ckeditor/ckeditor.js";
'group' => 'core',
'name' => 'editor_id',
'type' => 'String',
- 'html_type' => 'Text',
- 'default' => NULL,
+ 'html_type' => 'Select',
+ 'default' => 'CKEditor',
'add' => '4.1',
'title' => 'Wysiwig Editor',
'is_domain' => 1,
});
function showCKEditorConfig() {
- $('.crm-preferences-display-form-block-editor_id .crm-button').toggle($(this).val() == '2');
+ $('.crm-preferences-display-form-block-editor_id .crm-button').toggle($(this).val() == 'CKEditor');
}
$('select[name=editor_id]').each(showCKEditorConfig).change(showCKEditorConfig);
});
{contact.country}{/literal}{/serialize}' ),
( @domainID, NULL, 1, 'CiviCRM Preferences', 'display_name_format', '{serialize}{literal}{contact.individual_prefix}{ }{contact.first_name}{ }{contact.last_name}{ }{contact.individual_suffix}{/literal}{/serialize}' ),
( @domainID, NULL, 1, 'CiviCRM Preferences', 'sort_name_format', '{serialize}{literal}{contact.last_name}{, }{contact.first_name}{/literal}{/serialize}' ),
- ( @domainID, NULL, 1, 'CiviCRM Preferences', 'editor_id', '{serialize}2{/serialize}' ),
+ ( @domainID, NULL, 1, 'CiviCRM Preferences', 'editor_id', '{serialize}CKEditor{/serialize}' ),
( @domainID, NULL, 1, 'CiviCRM Preferences', 'contact_ajax_check_similar', '{serialize}1{/serialize}' ),
( @domainID, NULL, 1, 'CiviCRM Preferences', 'activity_assignee_notification', '{serialize}1{/serialize}' ),
( @domainID, NULL, 1, 'CiviCRM Preferences', 'activity_assignee_notification_ics', '{serialize}0{/serialize}' ),