Beispiel #1
0
 /**
  * Render a TinyMCE editor
  *
  * @param string $name
  * @param string $value
  * @param array $options
  */
 public static function richEditor($name, $value, $options = array())
 {
     $widget = yii::createComponent('application.extensions.gui.tinymce.ETinyMce');
     $widget->name = $name;
     $widget->value = $value;
     if (count($options) == 0) {
         $widget->EditorTemplate = 'custom';
     }
     $widget->setOptions($options);
     //Set widget width and height
     if (isset($options['height'])) {
         $widget->Height = $options['height'];
     } else {
         $widget->Height = '250px';
     }
     if (isset($options['width'])) {
         $widget->Width = $options['width'];
     } else {
         $widget->Width = '518px';
     }
     //min width that the toolbar fits in
     ob_start();
     $widget->init();
     $html = ob_get_contents();
     ob_end_clean();
     return $html;
 }