.

WYMEditor Class Reference
[WYMEditor]

Component to include WYMEditor on your page. More...

List of all members.

Static Public Member Functions

static  create_config ($name, $template=self::CONFIG_DEFAULT)
  Create a new config.
static  enable (PageData $page_data, $config=self::CONFIG_DEFAULT)
  Enable WYMEditor, and use given javascript file, to invoke it.

Public Attributes

const  CONFIG_DEFAULT = 'default'

Detailed Description

Component to include WYMEditor on your page.

Author:
Gerd Riesselmann

Definition at line 8 of file wymeditor.cls.php.


Member Function Documentation

static WYMEditor::create_config ( name,
template = self::CONFIG_DEFAULT  
) [static]

Create a new config.

Parameters:
sring  $name
string  $template Name of config to use as template
Returns:
WYMEditorConfig

Definition at line 42 of file wymeditor.cls.php.

00042                                                                                     {
00043                 $template = self::get_config($template);
00044                 self::$configs[$name] = $template;
00045                 HtmlText::register_editor($name, $template);            
00046                 return $template; 
00047         }
static WYMEditor::enable ( PageData page_data,
config = self::CONFIG_DEFAULT  
) [static]

Enable WYMEditor, and use given javascript file, to invoke it.

Definition at line 16 of file wymeditor.cls.php.

00016                                                                                          {
00017                 $config = self::get_config($config);
00018                 
00019                 $page_data->head->add_js_file('js/wymeditor/jquery.wymeditor.js');
00020                 $page_data->head->add_css_file('js/wymeditor/jquery.wymeditor.css');
00021                 
00022                 $init_plugins = array();
00023                 foreach($config->plugins as $js => $init) {
00024                         $page_data->head->add_js_file($js);
00025                         $init_plugins[] = $init;
00026                 }
00027                 
00028                 $page_data->head->add_js_file($config->init_file);
00029                 
00030                 $init_plugins = implode(";\n", $init_plugins);
00031                 $init_plugin_func = "function _wym_init_plugins(wym) {\n$init_plugins\n}";
00032                 $page_data->head->add_js_snippet($init_plugin_func, true);
00033         }

Member Data Documentation

const WYMEditor::CONFIG_DEFAULT = 'default'

Definition at line 9 of file wymeditor.cls.php.


The documentation for this class was generated from the following file: