CRM-16354 - Migrate forms to new wysiwyg code
authorColeman Watts <coleman@civicrm.org>
Wed, 29 Apr 2015 04:47:56 +0000 (22:47 -0600)
committerColeman Watts <coleman@civicrm.org>
Wed, 29 Apr 2015 04:47:56 +0000 (22:47 -0600)
29 files changed:
CRM/Admin/Form/MessageTemplates.php
CRM/Admin/Form/Options.php
CRM/Admin/Form/Preferences.php
CRM/Campaign/Form/Campaign.php
CRM/Campaign/Form/Petition.php
CRM/Campaign/Form/Survey/Main.php
CRM/Campaign/Form/SurveyType.php
CRM/Case/Form/Activity/OpenCase.php
CRM/Contact/Form/Edit/Email.php
CRM/Contribute/Form/ContributionPage/Amount.php
CRM/Contribute/Form/ContributionPage/Settings.php
CRM/Contribute/Form/ContributionPage/ThankYou.php
CRM/Contribute/Form/ContributionPage/Widget.php
CRM/Contribute/Form/Task/Invoice.php
CRM/Core/BAO/CustomField.php
CRM/Core/BAO/UFGroup.php
CRM/Core/Form.php
CRM/Custom/Form/Group.php
CRM/Event/Form/ManageEvent/EventInfo.php
CRM/Event/Form/ManageEvent/Fee.php
CRM/Event/Form/ManageEvent/Registration.php
CRM/Friend/BAO/Friend.php
CRM/Friend/Form.php
CRM/Mailing/BAO/Mailing.php
CRM/Mailing/Form/ForwardMailing.php
CRM/Member/Form/MembershipBlock.php
CRM/UF/Form/Group.php
tools/CRM/Auction/Form/Auction.php
tools/CRM/Auction/Form/Item.php

index a20e6b13981df8c8088518157c905e2de3f722d0..98b6c18ceb55540c9fed94281bc1724e97a9afbb 100644 (file)
@@ -173,7 +173,7 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Admin_Form {
       );
     }
     else {
-      $this->addWysiwyg('msg_html', ts('HTML Message'),
+      $this->add('wysiwyg', 'msg_html', ts('HTML Message'),
         array(
           'cols' => '80',
           'rows' => '8',
index 3c92c0bcc95718f7ff5375a319aac36c1c2672a4..54f0536f5c3f589e97b7cc42729fa48ba94c672f 100644 (file)
@@ -238,7 +238,7 @@ class CRM_Admin_Form_Options extends CRM_Admin_Form {
     }
     else {
       // Hard-coding attributes here since description is still stored as varchar and not text in the schema. dgg
-      $this->addWysiwyg('description',
+      $this->add('wysiwyg', 'description',
         ts('Description'),
         array('rows' => 4, 'cols' => 80),
         $required
index 84adc99ce46ce03244ff6469c0a9f88ffdfc6ab5..a239e973ea2a7ae760fd9329e90c6b729c13e6b3 100644 (file)
@@ -202,7 +202,7 @@ class CRM_Admin_Form_Preferences extends CRM_Core_Form {
               break;
 
             case 'wysiwyg':
-              $this->addWysiwyg($fieldName, $fieldValue['title'], $fieldValue['attributes']);
+              $this->add('wysiwyg', $fieldName, $fieldValue['title'], $fieldValue['attributes']);
               break;
 
             case 'entity_reference':
index 634b7fc086287bbadeab197c5e43035aa8aba7ff..923d7838c9c519bde73b238df9e3760be8940d22 100644 (file)
@@ -264,7 +264,7 @@ class CRM_Campaign_Form_Campaign extends CRM_Core_Form {
       )
     );
 
-    $this->addWysiwyg('goal_general', ts('Campaign Goals'), array('rows' => 2, 'cols' => 40));
+    $this->add('wysiwyg', 'goal_general', ts('Campaign Goals'), array('rows' => 2, 'cols' => 40));
     $this->add('text', 'goal_revenue', ts('Revenue Goal'), array('size' => 8, 'maxlength' => 12));
     $this->addRule('goal_revenue', ts('Please enter a valid money value (e.g. %1).',
       array(1 => CRM_Utils_Money::format('99.99', ' '))
index 43b03347562e06ef932613c4be0ba4d79278e7c7..ff73aee9691f963aa98c33cb16a9f8e5ba61a1d5 100644 (file)
@@ -187,7 +187,7 @@ class CRM_Campaign_Form_Petition extends CRM_Core_Form {
     $this->addElement('hidden', 'activity_type_id', $petitionTypeID);
 
     // script / instructions / description of petition purpose
-    $this->addWysiwyg('instructions', ts('Introduction'), $attributes['instructions']);
+    $this->add('wysiwyg', 'instructions', ts('Introduction'), $attributes['instructions']);
 
     // Campaign id
     $campaigns = CRM_Campaign_BAO_Campaign::getCampaigns(CRM_Utils_Array::value('campaign_id', $this->_values));
@@ -211,7 +211,7 @@ class CRM_Campaign_Form_Petition extends CRM_Core_Form {
 
     // thank you title and text (html allowed in text)
     $this->add('text', 'thankyou_title', ts('Thank-you Page Title'), CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Survey', 'thankyou_title'));
-    $this->addWysiwyg('thankyou_text', ts('Thank-you Message'), CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Survey', 'thankyou_text'));
+    $this->add('wysiwyg', 'thankyou_text', ts('Thank-you Message'), CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Survey', 'thankyou_text'));
 
     // bypass email confirmation?
     $this->add('checkbox', 'bypass_confirm', ts('Bypass email confirmation'));
index cc2bd7532fa2bc73a8de243ad6b91620ee5c24cd..2a7090f649835d84b91101750e2b4e517c48a979 100644 (file)
@@ -166,7 +166,7 @@ class CRM_Campaign_Form_Survey_Main extends CRM_Campaign_Form_Survey {
     $this->add('select', 'campaign_id', ts('Campaign'), array('' => ts('- select -')) + $campaigns);
 
     // script / instructions
-    $this->addWysiwyg('instructions', ts('Instructions for interviewers'), array('rows' => 5, 'cols' => 40));
+    $this->add('wysiwyg', 'instructions', ts('Instructions for interviewers'), array('rows' => 5, 'cols' => 40));
 
     // release frequency
     $this->add('text', 'release_frequency', ts('Release Frequency'), CRM_Core_DAO::getAttribute('CRM_Campaign_DAO_Survey', 'release_frequency'));
index fe455f7106acefd29f3cda6d6618fe0bf9fcf93a..cfa5a9630a63729744a7fdc1e1140653a152f175 100644 (file)
@@ -124,7 +124,7 @@ class CRM_Campaign_Form_SurveyType extends CRM_Admin_Form {
     $this->applyFilter('__ALL__', 'trim');
     $this->add('text', 'label', ts('Title'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'label'), TRUE);
 
-    $this->addWysiwyg('description',
+    $this->add('wysiwyg', 'description',
       ts('Description'),
       CRM_Core_DAO::getAttribute('CRM_Core_DAO_OptionValue', 'description')
     );
index 358f203e99f88c4dbdb666519b76b6417f1062f3..9776866da09f36c1cca6cc8684c72b4cff395936 100644 (file)
@@ -189,7 +189,7 @@ class CRM_Case_Form_Activity_OpenCase {
     // calling this field activity_location to prevent conflict with contact location fields
     $form->add('text', 'activity_location', ts('Location'), CRM_Core_DAO::getAttribute('CRM_Activity_DAO_Activity', 'location'));
 
-    $form->addWysiwyg('activity_details', ts('Details'), array('rows' => 4, 'cols' => 60), FALSE);
+    $form->add('wysiwyg', 'activity_details', ts('Details'), array('rows' => 4, 'cols' => 60), FALSE);
 
     $form->addButtons(array(
         array(
index 3bef4b552abb0639a945b9e98278b006117a2824..d86c8f5645b7a3cc1a18c8113eefb531c76c0ade 100644 (file)
@@ -115,7 +115,7 @@ class CRM_Contact_Form_Edit_Email {
           array('rows' => 2, 'cols' => 40)
         );
 
-        $form->addWysiwyg("email[$blockId][signature_html]", ts('Signature (HTML)'),
+        $form->add('wysiwyg', "email[$blockId][signature_html]", ts('Signature (HTML)'),
           array('rows' => 2, 'cols' => 40)
         );
       }
index c6e9348fe2073af4e427c2726c1252b0882702cd..1d68305afbe44d8a5996de7c1ab9a376162ea0dc 100644 (file)
@@ -137,7 +137,7 @@ SELECT id
       CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'pay_later_text'),
       FALSE
     );
-    $this->addWysiwyg('pay_later_receipt', ts('Pay Later Instructions'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'pay_later_receipt'));
+    $this->add('wysiwyg', 'pay_later_receipt', ts('Pay Later Instructions'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'pay_later_receipt'));
     $this->addElement('checkbox', 'is_billing_required', ts('Billing address required'));
 
     //add partial payment options
index 7b8b7ec1922a758506079dc8b7887657931e63d1..a9dbc7541f51d7d956be4e05d808abf032067a41 100644 (file)
@@ -129,9 +129,9 @@ class CRM_Contribute_Form_ContributionPage_Settings extends CRM_Contribute_Form_
     //CRM-7362 --add campaigns.
     CRM_Campaign_BAO_Campaign::addCampaign($this, CRM_Utils_Array::value('campaign_id', $this->_values));
 
-    $this->addWysiwyg('intro_text', ts('Introductory Message'), $attributes['intro_text']);
+    $this->add('wysiwyg', 'intro_text', ts('Introductory Message'), $attributes['intro_text']);
 
-    $this->addWysiwyg('footer_text', ts('Footer Message'), $attributes['footer_text']);
+    $this->add('wysiwyg', 'footer_text', ts('Footer Message'), $attributes['footer_text']);
 
     //Register schema which will be used for OnBehalOf and HonorOf profile Selector
     CRM_UF_Page_ProfileEditor::registerSchemas(array('OrganizationModel', 'HouseholdModel'));
index 37db949665a7d9988ac853dbf3d5b1bfed0282bb..31a9185aa5829d63194d990d86ca179039232687 100644 (file)
@@ -62,17 +62,9 @@ class CRM_Contribute_Form_ContributionPage_ThankYou extends CRM_Contribute_Form_
     // thank you title and text (html allowed in text)
     $this->add('text', 'thankyou_title', ts('Thank-you Page Title'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'thankyou_title'), TRUE);
 
-    $attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'thankyou_text');
-    $attributes['click_wysiwyg'] = TRUE;
-    $this->addWysiwyg('thankyou_text', ts('Thank-you Message'), $attributes);
-    // FIXME: This hack forces height of editor to 175px. Need to modify QF classes for editors to allow passing
-    // explicit height and width.
-    $footerAttribs = array(
-      'rows' => 2,
-      'cols' => 40,
-      'click_wysiwyg' => TRUE,
-    );
-    $this->addWysiwyg('thankyou_footer', ts('Thank-you Footer'), $footerAttribs);
+    $attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'thankyou_text') + array('class' => 'collapsed');
+    $this->add('wysiwyg', 'thankyou_text', ts('Thank-you Message'), $attributes);
+    $this->add('wysiwyg', 'thankyou_footer', ts('Thank-you Footer'), $attributes);
 
     $this->addElement('checkbox', 'is_email_receipt', ts('Email Receipt to Contributor?'), NULL, array('onclick' => "showReceipt()"));
     $this->add('text', 'receipt_from_name', ts('Receipt From Name'), CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_ContributionPage', 'receipt_from_name'));
index 9b91f478c995050d25d75ccd5eb681f3dac019aa..e404cd185ba406f39b6c6457dd0d670384e4882d 100644 (file)
@@ -186,7 +186,7 @@ class CRM_Contribute_Form_ContributionPage_Widget extends CRM_Contribute_Form_Co
       array('onclick' => "widgetBlock(this)")
     );
 
-    $this->addWysiwyg('about', ts('About'), $attributes['about']);
+    $this->add('wysiwyg', 'about', ts('About'), $attributes['about']);
 
     foreach ($this->_fields as $name => $val) {
       $this->add($val[1],
index 97ebb604a6303f361a808c2481969ad09f0979cf..c14ea1a8b149b0a0cbfda09ec868c430214bc03e 100644 (file)
@@ -183,7 +183,7 @@ class CRM_Contribute_Form_Task_Invoice extends CRM_Contribute_Form_Task {
       $this->addRule('from_email_address', ts('From Email Address is required'), 'required');
     }
 
-    $this->addWysiwyg('email_comment', ts('If you would like to add personal message to email please add it here. (If sending to more then one receipient the same message will be sent to each contact.)'), array(
+    $this->add('wysiwyg', 'email_comment', ts('If you would like to add personal message to email please add it here. (If sending to more then one receipient the same message will be sent to each contact.)'), array(
       'rows' => 2,
       'cols' => 40,
     ));
index 59707c5c30500007748e7249254ae949fb097040..e80bbb153c1a61f7b8ca2bef5766e3722a4e1635 100644 (file)
@@ -989,7 +989,7 @@ class CRM_Core_BAO_CustomField extends CRM_Core_DAO_CustomField {
         if ($field->text_length) {
           $attributes['maxlength'] = $field->text_length;
         }
-        $qf->addWysiwyg($elementName, $label, $attributes, $search);
+        $qf->add('wysiwyg', $elementName, $label, $attributes, $search);
         break;
 
       case 'Autocomplete-Select':
index 2c90b4bbed61ef99f2c924d99e1a9cf702f3a321..dac46e3f2c3d4e2deb19f5a9b77a2a037899543d 100644 (file)
@@ -2240,7 +2240,7 @@ AND    ( entity_id IS NULL OR entity_id <= 0 )
       $form->add('select', $name, $title, CRM_Core_PseudoConstant::worldRegion(), $required, $selectAttributes);
     }
     elseif ($fieldName == 'signature_html') {
-      $form->addWysiwyg($name, $title, CRM_Core_DAO::getAttribute('CRM_Core_DAO_Email', $fieldName));
+      $form->add('wysiwyg', $name, $title, CRM_Core_DAO::getAttribute('CRM_Core_DAO_Email', $fieldName));
     }
     elseif ($fieldName == 'signature_text') {
       $form->add('textarea', $name, $title, CRM_Core_DAO::getAttribute('CRM_Core_DAO_Email', $fieldName));
@@ -2258,7 +2258,7 @@ AND    ( entity_id IS NULL OR entity_id <= 0 )
       }
     }
     elseif ($fieldName == 'activity_details') {
-      $form->addWysiwyg($fieldName, $title, array('rows' => 4, 'cols' => 60), $required);
+      $form->add('wysiwyg', $fieldName, $title, array('rows' => 4, 'cols' => 60), $required);
     }
     elseif ($fieldName == 'activity_duration') {
       $form->add('text', $name, $title, $attributes, $required);
index 01a7029658d7086442ced5af5852805416421538..5c00193ce68d7ed7464002b65b212dfc1270b33d 100644 (file)
@@ -1350,50 +1350,6 @@ class CRM_Core_Form extends HTML_QuickForm_Page {
     ));
   }
 
-  /**
-   * @param string $name
-   * @param $label
-   * @param $attributes
-   * @param bool $forceTextarea
-   */
-  public function addWysiwyg($name, $label, $attributes, $forceTextarea = FALSE) {
-    // 1. Get configuration option for editor (tinymce, ckeditor, pure textarea)
-    // 2. Based on the option, initialise proper editor
-    $editorID = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
-      'editor_id'
-    );
-    $editor = strtolower(CRM_Utils_Array::value($editorID,
-      CRM_Core_OptionGroup::values('wysiwyg_editor')
-    ));
-    if (!$editor || $forceTextarea) {
-      $editor = 'textarea';
-    }
-    if ($editor == 'joomla default editor') {
-      $editor = 'joomlaeditor';
-    }
-
-    if ($editor == 'drupal default editor') {
-      $editor = 'drupalwysiwyg';
-    }
-
-    //lets add the editor as a attribute
-    $attributes['editor'] = $editor;
-
-    $this->addElement($editor, $name, $label, $attributes);
-    $this->assign('editor', $editor);
-
-    // include wysiwyg editor js files
-    // FIXME: This code does not make any sense
-    $includeWysiwygEditor = FALSE;
-    $includeWysiwygEditor = $this->get('includeWysiwygEditor');
-    if (!$includeWysiwygEditor) {
-      $includeWysiwygEditor = TRUE;
-      $this->set('includeWysiwygEditor', $includeWysiwygEditor);
-    }
-
-    $this->assign('includeWysiwygEditor', $includeWysiwygEditor);
-  }
-
   /**
    * @param int $id
    * @param $title
index 2896c9462e88ba9244bf37b2be14a2c4ef518db4..46f3a1c0f0f6487c6c481c0c6308d50108696dfd 100644 (file)
@@ -335,8 +335,8 @@ class CRM_Custom_Form_Group extends CRM_Core_Form {
     $this->assign('defaultSubtypes', json_encode($this->_subtypes));
 
     // help text
-    $this->addWysiwyg('help_pre', ts('Pre-form Help'), $attributes['help_pre']);
-    $this->addWysiwyg('help_post', ts('Post-form Help'), $attributes['help_post']);
+    $this->add('wysiwyg', 'help_pre', ts('Pre-form Help'), $attributes['help_pre']);
+    $this->add('wysiwyg', 'help_post', ts('Post-form Help'), $attributes['help_post']);
 
     // weight
     $this->add('text', 'weight', ts('Order'), $attributes['weight'], TRUE);
index db79e3af5cdfb297155b78756396c0d15a6797ff..2b3e1a701a2576b063b09e8790a4fea1a1cc00b3 100644 (file)
@@ -204,7 +204,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->addWysiwyg('description', ts('Complete Description'), $attributes['event_description']);
+    $this->add('wysiwyg', 'description', ts('Complete Description'), $attributes['event_description']);
     $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 a0ba29fb33fb7357a6297890053319b5b8477f28..50ae47e8c3c4405ee1de9452e63376473fabc34e 100644 (file)
@@ -282,7 +282,7 @@ class CRM_Event_Form_ManageEvent_Fee extends CRM_Event_Form_ManageEvent {
       CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event', 'pay_later_text'),
       FALSE
     );
-    $this->addWysiwyg('pay_later_receipt', ts('Pay Later Instructions'), CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event', 'pay_later_receipt'));
+    $this->add('wysiwyg', 'pay_later_receipt', ts('Pay Later Instructions'), CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event', 'pay_later_receipt'));
 
     $this->addElement('checkbox', 'is_billing_required', ts('Billing address required'));
     $this->add('text', 'fee_label', ts('Fee Label'));
index 3a24bb1d96838998bdafd0c0f1943523bcd73600..cac7a8fd047f438a03a9ac4a40058a74ca9712e2 100644 (file)
@@ -314,17 +314,9 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
    *
    */
   public function buildRegistrationBlock(&$form) {
-    $attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event');
-    $attributes['intro_text']['click_wysiwyg'] = TRUE;
-    $form->addWysiwyg('intro_text', ts('Introductory Text'), $attributes['intro_text']);
-    // FIXME: This hack forces height of editor to 175px. Need to modify QF classes for editors to allow passing
-    // explicit height and width.
-    $footerAttribs = array(
-      'rows' => 2,
-      'cols' => 40,
-      'click_wysiwyg' => TRUE,
-    );
-    $form->addWysiwyg('footer_text', ts('Footer Text'), $footerAttribs);
+    $attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event', 'intro_text') + array('class' => 'collapsed');
+    $form->add('wysiwyg', 'intro_text', ts('Introductory Text'), $attributes);
+    $form->add('wysiwyg', 'footer_text', ts('Footer Text'), $attributes);
 
     extract(self::getProfileSelectorTypes());
     //CRM-15427
@@ -401,7 +393,6 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
    */
   public function buildConfirmationBlock(&$form) {
     $attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event');
-    $attributes['confirm_text']['click_wysiwyg'] = TRUE;
     // CRM-11182 - Optional confirmation page for free events
     $is_monetary = CRM_Core_DAO::getFieldValue('CRM_Event_DAO_Event', $form->_id, 'is_monetary');
     $form->assign('is_monetary', $is_monetary);
@@ -409,15 +400,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->addWysiwyg('confirm_text', ts('Introductory Text'), $attributes['confirm_text']);
-    // FIXME: This hack forces height of editor to 175px. Need to modify QF classes for editors to allow passing
-    // explicit height and width.
-    $footerAttribs = array(
-      'rows' => 2,
-      'cols' => 40,
-      'click_wysiwyg' => TRUE,
-    );
-    $form->addWysiwyg('confirm_footer_text', ts('Footer Text'), $footerAttribs);
+    $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'));
   }
 
   /**
@@ -445,17 +429,9 @@ class CRM_Event_Form_ManageEvent_Registration extends CRM_Event_Form_ManageEvent
    */
   public function buildThankYouBlock(&$form) {
     $attributes = CRM_Core_DAO::getAttribute('CRM_Event_DAO_Event');
-    $attributes['thankyou_text']['click_wysiwyg'] = TRUE;
     $form->add('text', 'thankyou_title', ts('Title'), $attributes['thankyou_title']);
-    $form->addWysiwyg('thankyou_text', ts('Introductory Text'), $attributes['thankyou_text']);
-    // FIXME: This hack forces height of editor to 175px. Need to modify QF classes for editors to allow passing
-    // explicit height and width.
-    $footerAttribs = array(
-      'rows' => 2,
-      'cols' => 40,
-      'click_wysiwyg' => TRUE,
-    );
-    $form->addWysiwyg('thankyou_footer_text', ts('Footer Text'), $footerAttribs);
+    $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'));
   }
 
   /**
index 545b7fd5f91d5ae8a45f23788f55c451324cbe71..53617dbed852097fb2651f72076e21c61901b3d6 100644 (file)
@@ -246,7 +246,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend {
     $form->add('text', 'tf_title', ts('Title'), CRM_Core_DAO::getAttribute('CRM_Friend_DAO_Friend', 'title'), TRUE);
 
     // intro-text and thank-you text
-    $form->addWysiwyg('intro', ts('Introduction'), CRM_Core_DAO::getAttribute('CRM_Friend_DAO_Friend', 'intro'), TRUE);
+    $form->add('wysiwyg', 'intro', ts('Introduction'), CRM_Core_DAO::getAttribute('CRM_Friend_DAO_Friend', 'intro') + array('class' => 'collapsed'));
 
     $form->add('textarea', 'suggested_message', ts('Suggested Message'),
       CRM_Core_DAO::getAttribute('CRM_Friend_DAO_Friend', 'suggested_message'), FALSE
@@ -256,7 +256,7 @@ class CRM_Friend_BAO_Friend extends CRM_Friend_DAO_Friend {
 
     $form->add('text', 'tf_thankyou_title', ts('Thank-you Title'), CRM_Core_DAO::getAttribute('CRM_Friend_DAO_Friend', 'thankyou_title'), TRUE);
 
-    $form->addWysiwyg('tf_thankyou_text', ts('Thank-you Message'), CRM_Core_DAO::getAttribute('CRM_Friend_DAO_Friend', 'thankyou_text'), TRUE);
+    $form->add('wysiwyg', 'tf_thankyou_text', ts('Thank-you Message'), CRM_Core_DAO::getAttribute('CRM_Friend_DAO_Friend', 'thankyou_text') + array('class' => 'collapsed'));
 
     if ($form->_friendId) {
       // CRM-14200 the i18n dialogs need this for translation
index f8da2d709eaa65183b556453e7a9b3883afbd8a3..b48829235dba461a2ea05b814c4799805995ea22 100644 (file)
@@ -195,7 +195,7 @@ class CRM_Friend_Form extends CRM_Core_Form {
     );
     $email->freeze();
 
-    $this->addWysiwyg('suggested_message', ts('Your Message'), CRM_Core_DAO::getAttribute('CRM_Friend_DAO_Friend', 'suggested_message'));
+    $this->add('wysiwyg', 'suggested_message', ts('Your Message'), CRM_Core_DAO::getAttribute('CRM_Friend_DAO_Friend', 'suggested_message'));
     $friend = array();
     $mailLimit = self::NUM_OPTION;
     if ($this->_entityTable == 'civicrm_pcp') {
index a0c7b9176e9491ea58e982dd2c6ea039a4ad129b..42dca2625f1d39d226d3cf6f06ca70a09c7198c9 100644 (file)
@@ -2663,7 +2663,7 @@ LEFT JOIN civicrm_mailing_group g ON g.mailing_id   = m.id
     if ($className != 'CRM_SMS_Form_Upload' && $className != 'CRM_Contact_Form_Task_SMS' &&
       $className != 'CRM_Contact_Form_Task_SMS'
     ) {
-      $form->addWysiwyg('html_message',
+      $form->add('wysiwyg', 'html_message',
         ts('HTML Format'),
         array(
           'cols' => '80',
@@ -2763,7 +2763,7 @@ LEFT JOIN civicrm_mailing_group g ON g.mailing_id   = m.id
     );
     $form->add('text', 'saveTemplateName', ts('Template Title'));
 
-    $form->addWysiwyg('html_message',
+    $form->add('wysiwyg', 'html_message',
       ts('Your Letter'),
       array(
         'cols' => '80',
index 9de95bd79ff6573e0d4fe549ebf71d3a9df67ff4..4a5f0632392715fa260ffccb5424cf29cc86cdc5 100644 (file)
@@ -83,7 +83,7 @@ class CRM_Mailing_Form_ForwardMailing extends CRM_Core_Form {
 
     //insert message Text by selecting "Select Template option"
     $this->add('textarea', 'forward_comment', ts('Comment'), array('cols' => '80', 'rows' => '8'));
-    $this->addWysiwyg('html_comment',
+    $this->add('wysiwyg', 'html_comment',
       ts('HTML Message'),
       array('cols' => '80', 'rows' => '8')
     );
index 13f92b6ab1de9d2c834986c8ff0f811d5d45904d..bb4f00947ce793b89ceb9119f14c6144747131d5 100644 (file)
@@ -121,11 +121,11 @@ class CRM_Member_Form_MembershipBlock extends CRM_Contribute_Form_ContributionPa
 
       $this->addElement('text', 'new_title', ts('Title - New Membership'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'new_title'));
 
-      $this->addWysiwyg('new_text', ts('Introductory Message - New Memberships'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'new_text'));
+      $this->add('wysiwyg', 'new_text', ts('Introductory Message - New Memberships'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'new_text'));
 
       $this->addElement('text', 'renewal_title', ts('Title - Renewals'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'renewal_title'));
 
-      $this->addWysiwyg('renewal_text', ts('Introductory Message - Renewals'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'renewal_text'));
+      $this->add('wysiwyg', 'renewal_text', ts('Introductory Message - Renewals'), CRM_Core_DAO::getAttribute('CRM_Member_DAO_MembershipBlock', 'renewal_text'));
 
       $this->addElement('checkbox', 'is_required', ts('Require Membership Signup'));
       $this->addElement('checkbox', 'display_min_fee', ts('Display Membership Fee'));
index 7f6ec3cb70b81918008041080995827c1a37a95d..21b1c9ee12ee4f2621198c6b4300e430da0c354a 100644 (file)
@@ -148,8 +148,8 @@ class CRM_UF_Form_Group extends CRM_Core_Form {
     $this->addGroup($uf_group_type, 'uf_group_type', ts('Used For'), '&nbsp;');
 
     // help text
-    $this->addWysiwyg('help_pre', ts('Pre-form Help'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFGroup', 'help_post'));
-    $this->addWysiwyg('help_post', ts('Post-form Help'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFGroup', 'help_post'));
+    $this->add('wysiwyg', 'help_pre', ts('Pre-form Help'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFGroup', 'help_post'));
+    $this->add('wysiwyg', 'help_post', ts('Post-form Help'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFGroup', 'help_post'));
 
     // weight
     $this->add('text', 'weight', ts('Order'), CRM_Core_DAO::getAttribute('CRM_Core_DAO_UFJoin', 'weight'), TRUE);
index 4cfb8354edf5b0783673ac7bcd8f1eafb9834c20..b96d6b179d82d9bb970c7e799020b49b29b220f0 100644 (file)
@@ -114,7 +114,7 @@ class CRM_Auction_Form_Auction extends CRM_Core_Form {
       TRUE
     );
 
-    $this->addWysiwyg('description',
+    $this->add('wysiwyg', 'description',
       ts('Complete Description'),
       $attributes['description']
     );
index 6633980e7e7074f70f86b4a7d02e713c99dcb806..c21221c650a09cfd9ba95f6f18cde476721f8c3c 100644 (file)
@@ -141,7 +141,7 @@ class CRM_Auction_Form_Item extends CRM_Core_Form {
       TRUE
     );
 
-    $this->addWysiwyg('description',
+    $this->add('wysiwyg', 'description',
       ts('Complete Description'),
       $attributes['description']
     );