示例#1
0
 /**
  * A convenience wrapper to create an Editor configuration
  * bean.  Allows for three sizes of editor, SMALL, MEDIUM, and LARGE.
  * If no size is given, it will default to MEDIUM.  Also accepts
  * optional name and content.
  */
 protected function getEditorConfig($size = null, $name = null, $content = null)
 {
     $size_opts = array(EDITOR::SMALL => "150", EDITOR::MEDIUM => "300", EDITOR::LARGE => "400");
     $editor = new Editor();
     $height = $size ? $size_opts[$size] : $size_opts[Editor::MEDIUM];
     $editor->setHeight($height);
     if ($name != null) {
         $editor->setName($name);
     }
     if ($content != null) {
         $editor->setContent($content);
     }
     return $editor;
 }