);
}
else {
- $this->addWysiwyg('msg_html', ts('HTML Message'),
+ $this->add('wysiwyg', 'msg_html', ts('HTML Message'),
array(
'cols' => '80',
'rows' => '8',
}
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
break;
case 'wysiwyg':
- $this->addWysiwyg($fieldName, $fieldValue['title'], $fieldValue['attributes']);
+ $this->add('wysiwyg', $fieldName, $fieldValue['title'], $fieldValue['attributes']);
break;
case 'entity_reference':
)
);
- $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', ' '))
$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));
// 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'));
$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'));
$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')
);
// 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(
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)
);
}
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
//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'));
// 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'));
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],
$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,
));
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':
$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));
}
}
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);
));
}
- /**
- * @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
$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);
$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'));
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'));
*
*/
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
*/
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);
$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'));
}
/**
*/
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'));
}
/**
$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
$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
);
$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') {
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',
);
$form->add('text', 'saveTemplateName', ts('Template Title'));
- $form->addWysiwyg('html_message',
+ $form->add('wysiwyg', 'html_message',
ts('Your Letter'),
array(
'cols' => '80',
//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')
);
$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'));
$this->addGroup($uf_group_type, 'uf_group_type', ts('Used For'), ' ');
// 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);
TRUE
);
- $this->addWysiwyg('description',
+ $this->add('wysiwyg', 'description',
ts('Complete Description'),
$attributes['description']
);
TRUE
);
- $this->addWysiwyg('description',
+ $this->add('wysiwyg', 'description',
ts('Complete Description'),
$attributes['description']
);