_persistantFreeze = true; $this->_type = 'DrupalWysiwyg'; } /** * Called by HTML_QuickForm whenever form event is made on this element * * @param string $event Name of event * @param mixed $arg event arguments * @param object &$caller calling object * @since 1.0 * @access public * @return void */ function onQuickFormEvent($event, $arg, &$caller) { switch ($event) { case 'updateValue': civicrm_drupal_wysiwyg_update_value($this, $caller); break; case 'addElement': $format = $arg[0] . '_format'; $this->format = $caller->get($format); if (!$this->format) $this->format = variable_get('civicrm_wysiwyg_input_format', (defined('FILTER_FORMAT_DEFAULT')?FILTER_FORMAT_DEFAULT:null)); $caller->set($format, $this->format); parent::onQuickFormEvent($event, $arg, $caller); break; default: parent::onQuickFormEvent($event, $arg, $caller); } return true; } // end func onQuickFormLoad /** * Return the htmlarea in HTML * * @access public * @return string */ function toHtml() { $html = null; // return frozen state if ($this->_flagFrozen) { return $this->getFrozenHtml(); } else { $html = civicrm_drupal_get_wysiwyg_html($this->_attributes, $this->getValue(), $this->format); return '
' . $html . '
'; } } function exportValue(&$submitValues, $assoc = false) { return $this->_prepareValue($this->getValue(), $assoc); } /** * Returns the htmlarea content in HTML * * @access public * @return string */ function getFrozenHtml() { return $this->getValue(); } }