CRM-19649 - Multiple wysiwyg presets
authorColeman Watts <coleman@civicrm.org>
Mon, 21 Nov 2016 02:03:43 +0000 (21:03 -0500)
committerColeman Watts <coleman@civicrm.org>
Mon, 21 Nov 2016 02:12:28 +0000 (21:12 -0500)
CRM/Admin/Form/MessageTemplates.php
CRM/Admin/Page/CKEditorConfig.php
CRM/Core/Form.php
CRM/Core/Resources.php
CRM/Event/Form/ManageEvent/EventInfo.php
CRM/Event/Form/ManageEvent/Registration.php
CRM/Upgrade/Incremental/php/FourSeven.php
ang/crmMailing/BodyHtml.html
js/wysiwyg/crm.ckeditor.js
templates/CRM/Admin/Page/CKEditorConfig.tpl
xml/templates/civicrm_data.tpl

index 964dc953e0fecd7c027d5607c71b0443233e48a7..9fcb6406094700a57a26a1cae5f024f4cf75188c 100644 (file)
@@ -205,7 +205,7 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Admin_Form {
           'cols' => '80',
           'rows' => '8',
           'onkeyup' => "return verify(this)",
-          'class' => 'crm-wysiwyg-fullpage',
+          'preset' => 'civimail',
         )
       );
     }
index 5413fbf80bb41cb2d12ec9ae9001b14ec2376377..1b42dee2b45b620ec685421c8761bc7f9a6cf237 100644 (file)
@@ -40,7 +40,7 @@
  */
 class CRM_Admin_Page_CKEditorConfig extends CRM_Core_Page {
 
-  const CONFIG_FILENAME = '[civicrm.files]/persist/crm-ckeditor-config.js';
+  const CONFIG_FILEPATH = '[civicrm.files]/persist/crm-ckeditor-';
 
   /**
    * Settings that cannot be configured in "advanced options"
@@ -61,15 +61,19 @@ class CRM_Admin_Page_CKEditorConfig extends CRM_Core_Page {
     'filebrowserFlashUploadUrl',
   );
 
+  public $preset;
+
   /**
    * Run page.
    *
    * @return string
    */
   public function run() {
+    $this->preset = CRM_Utils_Array::value('preset', $_REQUEST, 'default');
+
     // If the form was submitted, take appropriate action.
     if (!empty($_POST['revert'])) {
-      self::deleteConfigFile();
+      self::deleteConfigFile($this->preset);
     }
     elseif (!empty($_POST['config'])) {
       $this->save($_POST);
@@ -91,10 +95,17 @@ class CRM_Admin_Page_CKEditorConfig extends CRM_Core_Page {
         'settings' => $settings,
       ));
 
+    $configUrl = self::getConfigUrl($this->preset);
+    if (!$configUrl) {
+      $configUrl = self::getConfigUrl('default');
+    }
+
+    $this->assign('preset', $this->preset);
+    $this->assign('presets', CRM_Core_OptionGroup::values('wysiwyg_presets', FALSE, FALSE, FALSE, NULL, 'label', TRUE, FALSE, 'name'));
     $this->assign('skins', $this->getCKSkins());
     $this->assign('skin', CRM_Utils_Array::value('skin', $settings));
     $this->assign('extraPlugins', CRM_Utils_Array::value('extraPlugins', $settings));
-    $this->assign('configUrl', self::getConfigUrl());
+    $this->assign('configUrl', $configUrl);
     $this->assign('revertConfirm', htmlspecialchars(ts('Are you sure you want to revert all changes?', array('escape' => 'js'))));
 
     CRM_Utils_System::appendBreadCrumb(array(array(
@@ -133,7 +144,7 @@ class CRM_Admin_Page_CKEditorConfig extends CRM_Core_Page {
         $config = substr_replace($config, $setting, $pos, 0);
       }
     }
-    self::saveConfigFile($config);
+    self::saveConfigFile($this->preset, $config);
     if (!empty($params['save'])) {
       CRM_Core_Session::setStatus(ts("You may need to clear your browser's cache to see the changes in CiviCRM."), ts('CKEditor Saved'), 'success');
     }
@@ -194,7 +205,7 @@ class CRM_Admin_Page_CKEditorConfig extends CRM_Core_Page {
    */
   private function getConfigSettings() {
     $matches = $result = array();
-    $file = self::getConfigFile();
+    $file = self::getConfigFile($this->preset);
     $result['skin'] = 'moono';
     if ($file) {
       $contents = file_get_contents($file);
@@ -207,39 +218,44 @@ class CRM_Admin_Page_CKEditorConfig extends CRM_Core_Page {
   }
 
   /**
-   * @return null|string
+   * @param string $preset
+   *   Omit to get an array of all presets
+   * @return array|null|string
    */
-  public static function getConfigUrl() {
-    if (self::getConfigFile()) {
-      return Civi::paths()->getUrl(self::CONFIG_FILENAME, 'absolute');
+  public static function getConfigUrl($preset = NULL) {
+    $items = array();
+    $presets = CRM_Core_OptionGroup::values('wysiwyg_presets', FALSE, FALSE, FALSE, NULL, 'name');
+    foreach ($presets as $key => $name) {
+      if (self::getConfigFile($name)) {
+        $items[$name] = Civi::paths()->getUrl(self::CONFIG_FILEPATH . $name . '.js', 'absolute');
+      }
     }
-    return NULL;
+    return $preset ? CRM_Utils_Array::value($preset, $items) : $items;
   }
 
   /**
-   * @param bool $checkIfFileExists
-   *   If false, this fn will return fileName even if it doesn't exist
+   * @param string $preset
    *
    * @return null|string
    */
-  public static function getConfigFile($checkIfFileExists = TRUE) {
-    $fileName = Civi::paths()->getPath(self::CONFIG_FILENAME);
-    return !$checkIfFileExists || is_file($fileName) ? $fileName : NULL;
+  public static function getConfigFile($preset = 'default') {
+    $fileName = Civi::paths()->getPath(self::CONFIG_FILEPATH . $preset . '.js');
+    return is_file($fileName) ? $fileName : NULL;
   }
 
   /**
    * @param string $contents
    */
-  public static function saveConfigFile($contents) {
-    $file = self::getConfigFile(FALSE);
+  public static function saveConfigFile($preset, $contents) {
+    $file = Civi::paths()->getPath(self::CONFIG_FILEPATH . $preset . '.js');
     file_put_contents($file, $contents);
   }
 
   /**
    * Delete config file.
    */
-  public static function deleteConfigFile() {
-    $file = self::getConfigFile();
+  public static function deleteConfigFile($preset) {
+    $file = self::getConfigFile($preset);
     if ($file) {
       unlink($file);
     }
index 2204af696eb9f3ce5b87b9d3c88eba6b36ddb2d0..c694a85252345205d610528026756b60f2725887 100644 (file)
@@ -348,6 +348,10 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
     if ($type == 'wysiwyg' || in_array($type, self::$html5Types)) {
       $attributes = ($attributes ? $attributes : array()) + array('class' => '');
       $attributes['class'] = ltrim($attributes['class'] . " crm-form-$type");
+      if ($type == 'wysiwyg' && isset($attributes['preset'])) {
+        $attributes['data-preset'] = $attributes['preset'];
+        unset($attributes['preset']);
+      }
       $type = $type == 'wysiwyg' ? 'textarea' : 'text';
     }
     // @see http://wiki.civicrm.org/confluence/display/CRMDOC/crmDatepicker
index fef18a071ca8229095c824fb04a0199a6d10c1da..92d73bd6dde82aa8ae2b930fc56c335e7605df1d 100644 (file)
@@ -728,10 +728,7 @@ class CRM_Core_Resources {
     $editor = Civi::settings()->get('editor_id');
     if ($editor == "CKEditor") {
       $items[] = "js/wysiwyg/crm.ckeditor.js";
-      $ckConfig = CRM_Admin_Page_CKEditorConfig::getConfigUrl();
-      if ($ckConfig) {
-        $items[] = array('config' => array('CKEditorCustomConfig' => $ckConfig));
-      }
+      $items[] = array('config' => array('CKEditorCustomConfig' => CRM_Admin_Page_CKEditorConfig::getConfigUrl()));
     }
 
     // These scripts are only needed by back-office users
index bf9b7872769ec2e49f8558b8ae5586f63acbba11..b81625341c61efdc0ca0da7c9f5401dd1cb31f11 100644 (file)
@@ -172,7 +172,7 @@ class CRM_Event_Form_ManageEvent_EventInfo extends CRM_Event_Form_ManageEvent {
     $this->addSelect('participant_listing_id', array('placeholder' => ts('Disabled'), 'option_url' => NULL));
 
     $this->add('textarea', 'summary', ts('Event Summary'), $attributes['summary']);
-    $this->add('wysiwyg', 'description', ts('Complete Description'), $attributes['event_description']);
+    $this->add('wysiwyg', 'description', ts('Complete Description'), $attributes['event_description'] + array('preset' => 'civievent'));
     $this->addElement('checkbox', 'is_public', ts('Public Event'));
     $this->addElement('checkbox', 'is_share', ts('Allow sharing through social media?'));
     $this->addElement('checkbox', 'is_map', ts('Include Map to Event Location'));
index b114488f3b906aa4f64d0d67e02f3e8ec662c353..f37f74fc848b3e37204017ab3f03beb97d89ff07 100644 (file)
@@ -316,7 +316,7 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
    *
    */
   public function buildRegistrationBlock(&$form) {
-    $attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event', 'intro_text') + array('class' => 'collapsed');
+    $attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event', 'intro_text') + array('class' => 'collapsed', 'preset' => 'civievent');
     $form->add('wysiwyg', 'intro_text', ts('Introductory Text'), $attributes);
     $form->add('wysiwyg', 'footer_text', ts('Footer Text'), $attributes);
 
@@ -406,8 +406,8 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
       $form->addYesNo('is_confirm_enabled', ts('Use a confirmation screen?'), NULL, NULL, array('onclick' => "return showHideByValue('is_confirm_enabled','','confirm_screen_settings','block','radio',false);"));
     }
     $form->add('text', 'confirm_title', ts('Title'), $attributes['confirm_title']);
-    $form->add('wysiwyg', 'confirm_text', ts('Introductory Text'), $attributes['confirm_text'] + array('class' => 'collapsed'));
-    $form->add('wysiwyg', 'confirm_footer_text', ts('Footer Text'), $attributes['confirm_text'] + array('class' => 'collapsed'));
+    $form->add('wysiwyg', 'confirm_text', ts('Introductory Text'), $attributes['confirm_text'] + array('class' => 'collapsed', 'preset' => 'civievent'));
+    $form->add('wysiwyg', 'confirm_footer_text', ts('Footer Text'), $attributes['confirm_text'] + array('class' => 'collapsed', 'preset' => 'civievent'));
   }
 
   /**
@@ -436,8 +436,8 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
   public function buildThankYouBlock(&$form) {
     $attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event');
     $form->add('text', 'thankyou_title', ts('Title'), $attributes['thankyou_title']);
-    $form->add('wysiwyg', 'thankyou_text', ts('Introductory Text'), $attributes['thankyou_text'] + array('class' => 'collapsed'));
-    $form->add('wysiwyg', 'thankyou_footer_text', ts('Footer Text'), $attributes['thankyou_text'] + array('class' => 'collapsed'));
+    $form->add('wysiwyg', 'thankyou_text', ts('Introductory Text'), $attributes['thankyou_text'] + array('class' => 'collapsed', 'preset' => 'civievent'));
+    $form->add('wysiwyg', 'thankyou_footer_text', ts('Footer Text'), $attributes['thankyou_text'] + array('class' => 'collapsed', 'preset' => 'civievent'));
   }
 
   /**
index bd6c296c89f45f772da089c10398ce2ee7e9600b..2e327bc813bcab504ac9b371eba606bb9b5584fa 100644 (file)
@@ -257,6 +257,15 @@ class CRM_Upgrade_Incremental_php_FourSeven extends CRM_Upgrade_Incremental_Base
     $this->addTask('Add column to allow for payment processors to set what card types are accepted', 'addAcceptedCardTypesField');
   }
 
+  /**
+   * Upgrade function.
+   *
+   * @param string $rev
+   */
+  public function upgrade_4_7_14($rev) {
+    $this->addTask(ts('Upgrade DB to %1: SQL', array(1 => $rev)), 'runSql', $rev);
+    $this->addTask('Add WYSIWYG Editor Presets', 'addWysiwygPresets');
+  }
 
   /*
    * Important! All upgrade functions MUST add a 'runSql' task.
@@ -882,4 +891,42 @@ FROM `civicrm_dashboard_contact` JOIN `civicrm_contact` WHERE civicrm_dashboard_
     return TRUE;
   }
 
+  /**
+   * CRM-19372 Add field to store accepted credit credit cards for a payment processor.
+   * @return bool
+   */
+  public static function addWysiwygPresets() {
+    CRM_Core_BAO_OptionGroup::ensureOptionGroupExists(array(
+      'name' => 'wysiwyg_presets',
+      'title' => ts('WYSIWYG Editor Presets'),
+      'is_reserved' => 1,
+    ));
+    $values = array(
+      'default' => array('label' => ts('Default'), 'is_default' => 1),
+      'civimail' => array('label' => ts('CiviMail'), 'component_id' => 'CiviMail'),
+      'civievent' => array('label' => ts('CiviEvent'), 'component_id' => 'CiviEvent'),
+    );
+    foreach ($values as $name => $value) {
+      civicrm_api3('OptionValue', 'create', $value + array(
+        'options' => array('match' => array('name', 'option_group_id')),
+        'name' => $name,
+        'option_group_id' => 'wysiwyg_presets',
+      ));
+    }
+    $fileName = Civi::paths()->getPath('[civicrm.files]/persist/crm-ckeditor-config.js');
+    if (file_exists($fileName)) {
+      $config = file_get_contents($fileName);
+      $pos = strrpos($config, '};');
+      $setting = "\n\tconfig.allowedContent = true;\n";
+      $config = substr_replace($config, $setting, $pos, 0);
+      unlink($fileName);
+    }
+    else {
+      $config = "CKEDITOR.editorConfig = function( config ) {\n\tconfig.allowedContent = true;\n};\n";
+    }
+    $newFileName = Civi::paths()->getPath('[civicrm.files]/persist/crm-ckeditor-default.js');
+    file_put_contents($newFileName, $config);
+    return TRUE;
+  }
+
 }
index 730beecdd866af18145d8cc06ef6dd4d0702cdc8..e3de42005c028bce3c7e926aff8e797df5083fe5 100644 (file)
@@ -14,7 +14,7 @@ Required vars: mailing
         crm-ui-insert-rx="insert:body_html"
         ng-model="mailing.body_html"
         ng-blur="checkTokens(mailing, 'body_html', 'insert:body_html')"
-        class="crm-wysiwyg-fullpage"
+        data-preset="civimail"
         ></textarea>
       <span ng-model="body_html_tokens" crm-ui-validate="hasAllTokens(mailing, 'body_html')"></span>
       <div ng-show="htmlForm.$error.crmUiValidate" class="crmMailing-error-link">
index c684a5140c4da84febadf0e3a894401ba1b9bdf4..422ee5711aee0da603b4436815b73e3a3da95175 100644 (file)
     function initialize() {
       var
         browseUrl = CRM.config.resourceBase + "packages/kcfinder/browse.php?cms=civicrm",
-        uploadUrl = CRM.config.resourceBase + "packages/kcfinder/upload.php?cms=civicrm";
+        uploadUrl = CRM.config.resourceBase + "packages/kcfinder/upload.php?cms=civicrm",
+        preset = $(item).data('preset') || 'default',
+        // This variable is always an array but a legacy extension could be setting it as a string.
+        customConfig = (typeof CRM.config.CKEditorCustomConfig === 'string') ? CRM.config.CKEditorCustomConfig :
+          (CRM.config.CKEditorCustomConfig[preset] || CRM.config.CKEditorCustomConfig.default);
 
       $(item).addClass('crm-wysiwyg-enabled');
 
-      var isFullPage = $(item).hasClass('crm-wysiwyg-fullpage');
-
       CKEDITOR.replace($(item)[0], {
         filebrowserBrowseUrl: browseUrl + '&type=files',
         filebrowserImageBrowseUrl: browseUrl + '&type=images',
@@ -77,9 +79,7 @@
         filebrowserUploadUrl: uploadUrl + '&type=files',
         filebrowserImageUploadUrl: uploadUrl + '&type=images',
         filebrowserFlashUploadUrl: uploadUrl + '&type=flash',
-        allowedContent: true, // For CiviMail!
-        fullPage: isFullPage,
-        customConfig: CRM.config.CKEditorCustomConfig,
+        customConfig: customConfig,
         on: {
           instanceReady: onReady
         }
index 58e4bd176a8af0472ac33fe6ff4b143069252f98..df1dbfcecd4c35f997636face106eefc440cb11c 100644 (file)
   #crm-custom-config-options > div {
     margin: .5em .2em;
   }
+  #crm-container .ui-tabs-nav {
+    padding-bottom: 0;
+  }
+  #crm-container .ui-tabs-nav li {
+    margin-left: .3em;
+  }
+  #crm-container .ui-tabs-nav a {
+    font-size: 1.1em;
+    border-bottom: 0 none;
+    padding: 3px 10px 1px !important;
+  }
 {/literal}</style>
 {* Force the custom config file to reload by appending a new query string *}
 <script type="text/javascript">
   {if $configUrl}CKEDITOR.config.customConfig = '{$configUrl}?{php}print str_replace(array(' ', '.'), array('', '='), microtime());{/php}'{/if};
 </script>
 
+<div class="ui-tabs">
+  <ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header">
+    <li>{ts}Preset:{/ts}</li>
+    {foreach from=$presets key='k' item='p'}
+      <li class="ui-tabs-tab ui-corner-top ui-state-default ui-tab {if $k == $preset}ui-tabs-active ui-state-active{/if}">
+        <a class="ui-tabs-anchor" href="{crmURL q="preset=$k"}">{$p}</a>
+      </li>
+    {/foreach}
+  </ul>
+</div>
 <form method="post" action="{crmURL}" id="toolbarModifierForm">
-  <div class="crm-block crm-form-block">
-    <label for="skin">{ts}Skin{/ts}</label>
-    <select id="skin" name="config_skin" class="crm-select2 eight config-param">
-      {foreach from=$skins item='s'}
-        <option value="{$s}" {if $s == $skin}selected{/if}>{$s|ucfirst}</option>
-      {/foreach}
-    </select>
-    &nbsp;&nbsp;
-    <label for="extraPlugins">{ts}Plugins{/ts}</label>
-    <input id="extraPlugins" name="config_extraPlugins" class="huge config-param" value="{$extraPlugins}" placeholder="{ts}Select optional extra features{/ts}">
-  </div>
+  <fieldset>
+    <div class="crm-block crm-form-block">
+      <label for="skin">{ts}Skin{/ts}</label>
+      <select id="skin" name="config_skin" class="crm-select2 eight config-param">
+        {foreach from=$skins item='s'}
+          <option value="{$s}" {if $s == $skin}selected{/if}>{$s|ucfirst}</option>
+        {/foreach}
+      </select>
+      &nbsp;&nbsp;
+      <label for="extraPlugins">{ts}Plugins{/ts}</label>
+      <input id="extraPlugins" name="config_extraPlugins" class="huge config-param" value="{$extraPlugins}" placeholder="{ts}Select optional extra features{/ts}">
+    </div>
 
-  <div class="editors-container">
-    <div id="editor-basic"></div>
-    <div id="editor-advanced"></div>
-  </div>
+    <div class="editors-container">
+      <div id="editor-basic"></div>
+      <div id="editor-advanced"></div>
+    </div>
 
-  <div class="configurator">
-    <div>
-      <div id="toolbarModifierWrapper" class="active"></div>
+    <div class="configurator">
+      <div>
+        <div id="toolbarModifierWrapper" class="active"></div>
+      </div>
     </div>
-  </div>
 
 
-  <div class="crm-block crm-form-block">
-    <fieldset>
-      <legend>{ts}Advanced Options{/ts}</legend>
-      <div class="description">{ts 1='href="http://docs.ckeditor.com/#!/api/CKEDITOR.config" target="_blank"'}Refer to the <a %1>CKEditor Api Documentation</a> for details.{/ts}</div>
-      <div id="crm-custom-config-options"></div>
-    </fieldset>
-  </div>
+    <div class="crm-block crm-form-block">
+      <fieldset>
+        <legend>{ts}Advanced Options{/ts}</legend>
+        <div class="description">{ts 1='href="http://docs.ckeditor.com/#!/api/CKEDITOR.config" target="_blank"'}Refer to the <a %1>CKEditor Api Documentation</a> for details.{/ts}</div>
+        <div id="crm-custom-config-options"></div>
+      </fieldset>
+    </div>
 
-  <div class="crm-submit-buttons">
-    <span class="crm-button crm-i-button">
-      <i class="crm-i fa-wrench"></i> <input type="submit" value="{ts}Save{/ts}" name="save" class="crm-form-submit" accesskey="S"/>
-    </span>
-    <span class="crm-button crm-i-button">
-      <i class="crm-i fa-times"></i> <input type="submit" value="{ts}Revert to Default{/ts}" name="revert" class="crm-form-submit" onclick="return confirm('{$revertConfirm}');"/>
-    </span>
-  </div>
+    <div class="crm-submit-buttons">
+      <span class="crm-button crm-i-button">
+        <i class="crm-i fa-wrench"></i> <input type="submit" value="{ts}Save{/ts}" name="save" class="crm-form-submit" accesskey="S"/>
+      </span>
+      <span class="crm-button crm-i-button">
+        <i class="crm-i fa-times"></i> <input type="submit" value="{ts}Revert to Default{/ts}" name="revert" class="crm-form-submit" onclick="return confirm('{$revertConfirm}');"/>
+      </span>
+    </div>
+    <input type="hidden" value="{$preset}" name="preset" />
+  </fieldset>
 </form>
 <script type="text/template" id="config-row-tpl">
   <div class="crm-config-option-row">
index 2b85d2a5ccd6a40577ac43bd739a614836bf97ab..200d358d236575023b3da7ab3e981c3198f5acc0 100644 (file)
@@ -209,6 +209,7 @@ VALUES
    ('communication_style'           , '{ts escape="sql"}Communication Style{/ts}'                , NULL, 1, 1, 0),
    ('msg_mode'                      , '{ts escape="sql"}Message Mode{/ts}'                       , NULL, 1, 1, 0),
    ('contact_date_reminder_options' , '{ts escape="sql"}Contact Date Reminder Options{/ts}'      , NULL, 1, 1, 1),
+   ('wysiwyg_presets'               , '{ts escape="sql"}WYSIWYG Editor Presets{/ts}'             , NULL, 1, 1, 0),
    ('relative_date_filters'         , '{ts escape="sql"}Relative Date Filters{/ts}'              , NULL, 1, 1, 0);
 
 SELECT @option_group_id_pcm            := max(id) from civicrm_option_group where name = 'preferred_communication_method';
@@ -288,6 +289,7 @@ SELECT @option_group_id_communication_style := max(id) from civicrm_option_group
 SELECT @option_group_id_msg_mode := max(id) from civicrm_option_group where name = 'msg_mode';
 SELECT @option_group_id_contactDateMode := max(id) from civicrm_option_group where name = 'contact_date_reminder_options';
 SELECT @option_group_id_date_filter    := max(id) from civicrm_option_group where name = 'relative_date_filters';
+SELECT @option_group_id_wysiwyg_presets    := max(id) from civicrm_option_group where name = 'wysiwyg_presets';
 
 SELECT @contributeCompId := max(id) FROM civicrm_component where name = 'CiviContribute';
 SELECT @eventCompId      := max(id) FROM civicrm_component where name = 'CiviEvent';
@@ -962,6 +964,11 @@ VALUES
 (@option_group_id_contactDateMode, '{ts escape="sql"}Actual date only{/ts}', '1', 'Actual date only', NULL, NULL, 0, 1, NULL, 0, 1, 1, NULL, NULL),
 (@option_group_id_contactDateMode, '{ts escape="sql"}Each anniversary{/ts}', '2', 'Each anniversary', NULL, NULL, 0, 2, NULL, 0, 1, 1, NULL, NULL),
 
+-- WYSIWYG Editor Presets
+(@option_group_id_wysiwyg_presets, '{ts escape="sql"}Default{/ts}',   '1', 'default',   NULL, NULL, 1, 1, NULL, 0, 1, 1, NULL, NULL),
+(@option_group_id_wysiwyg_presets, '{ts escape="sql"}CiviMail{/ts}',  '2', 'civimail',  NULL, NULL, 0, 2, NULL, 0, 1, 1, @contributeCompId, NULL),
+(@option_group_id_wysiwyg_presets, '{ts escape="sql"}CiviEvent{/ts}', '3', 'civievent', NULL, NULL, 0, 3, NULL, 0, 1, 1, @eventCompId, NULL),
+
 -- Relative Date Filters
    (@option_group_id_date_filter, '{ts escape="sql"}Today{/ts}', 'this.day', 'this.day', NULL, NULL, NULL,1, NULL, 0, 0, 1, NULL, NULL),
    (@option_group_id_date_filter, '{ts escape="sql"}This week{/ts}', 'this.week', 'this.week', NULL, NULL, NULL,2, NULL, 0, 0, 1, NULL, NULL),