$defaults['sort_name_format'] = $this->_config->sort_name_format;
}
- $config = CRM_Core_Config::singleton();
- if ($config->userSystem->is_drupal == '1' && module_exists("wysiwyg")) {
- $defaults['wysiwyg_input_format'] = variable_get('civicrm_wysiwyg_input_format', 0);
- }
-
return $defaults;
}
$config = CRM_Core_Config::singleton();
$extra = array();
- //if not using Joomla, remove Joomla default editor option
- if ($config->userFramework != 'Joomla') {
- unset($wysiwyg_options[3]);
- }
-
- $drupal_wysiwyg = FALSE;
- if (!$config->userSystem->is_drupal || !module_exists("wysiwyg")) {
- unset($wysiwyg_options[4]);
- }
- else {
- $extra['onchange'] = '
- if (this.value==4) {
- cj("#crm-preferences-display-form-block-wysiwyg_input_format").show();
- }
- else {
- cj("#crm-preferences-display-form-block-wysiwyg_input_format").hide()
- }';
-
- $formats = filter_formats();
- $format_options = array();
- foreach ($formats as $id => $format) {
- $format_options[$id] = $format->name;
- }
- $drupal_wysiwyg = TRUE;
- }
$this->addElement('select', 'editor_id', ts('WYSIWYG Editor'), $wysiwyg_options, $extra);
- if ($drupal_wysiwyg) {
- $this->addElement('select', 'wysiwyg_input_format', ts('Input Format'), $format_options, NULL);
- }
-
$editOptions = CRM_Core_OptionGroup::values('contact_edit_options', FALSE, FALSE, FALSE, 'AND v.filter = 0');
$this->assign('editOptions', $editOptions);
// http://civicrm.org/licensing
CRM.$(function($) {
$(document)
- .on('crmLoad', function(e) {
- // This is drupal's old-school way of listening for 'load' type events. It has to be called manually.
- Drupal.attachBehaviors(e.target);
- })
- .on('crmUnload', function(e) {
- // This function doesn't exist in D6 so call conditionally
- if (typeof Drupal.detachBehaviors === 'function') {
- Drupal.detachBehaviors(e.target);
- }
- })
.on('dialogopen', function(e) {
// D7 hack to get the toolbar out of the way (CRM-15341)
$('#toolbar').css('z-index', '100');
<td class="label">{$form.editor_id.label}</td>
<td>{$form.editor_id.html}</td>
</tr>
- {if $form.wysiwyg_input_format.html}
- <tr id="crm-preferences-display-form-block-wysiwyg_input_format" style="display:none;">
- <td class="label">{$form.wysiwyg_input_format.label}</td>
- <td>
- {$form.wysiwyg_input_format.html}{literal}
- <script type="text/javascript">
- CRM.$(function($) {
- if ($('#editor_id').val() == 4) {
- $('#crm-preferences-display-form-block-wysiwyg_input_format').show();
- }
- });
- </script>
- {/literal}
- <br/>
- <span class="description">
- {ts}You will need to enable and configure several modules if you want to allow users to upload images while using a Drupal Default Editor.{/ts}
- {docURL page="Configuring CiviCRM to Use the Default Drupal Editor" resource="wiki"}
- </span>
- </td>
- </tr>
- {/if}
<tr class="crm-preferences-display-form-block-description">
<td> </td>
<td class="description">