Public Member Functions | |
| perform () | |
Private Member Functions | |
| init () | |
| getContents ($editorArea, $hiddenField) | |
| editorArea ($name, $content, $hiddenField, $width, $height, $col, $row) | |
Definition at line 3 of file bot_nulleditor.php.
| bot_nulleditor::perform | ( | ) |
Definition at line 5 of file bot_nulleditor.php.
References init().
00005 { 00006 $args = func_get_args(); 00007 $event = array_shift($args); 00008 $botparams = array_shift($args); 00009 $published = array_shift($args); 00010 switch ($event) { 00011 case 'onIniEditor': 00012 return $this->init (); 00013 00014 case 'onGetEditorContents': 00015 return call_user_func_array(array($this,'getContents'), $args); 00016 00017 case 'onEditorArea': 00018 return call_user_func_array(array($this,'editorArea'), $args); 00019 00020 } 00021 }
| bot_nulleditor::init | ( | ) | [private] |
Aliro null editor No WYSIWYG Editor - javascript initialisation
Definition at line 27 of file bot_nulleditor.php.
Referenced by perform().
00027 { 00028 return <<<EOD 00029 <script type="text/javascript"> 00030 function insertAtCursor(myField, myValue) { 00031 if (document.selection) { 00032 // IE support 00033 myField.focus(); 00034 sel = document.selection.createRange(); 00035 sel.text = myValue; 00036 } else if (myField.selectionStart || myField.selectionStart == '0') { 00037 // MOZILLA/NETSCAPE support 00038 var startPos = myField.selectionStart; 00039 var endPos = myField.selectionEnd; 00040 myField.value = myField.value.substring(0, startPos) 00041 + myValue 00042 + myField.value.substring(endPos, myField.value.length); 00043 } else { 00044 myField.value += myValue; 00045 } 00046 } 00047 </script> 00048 EOD; 00049 }
| bot_nulleditor::getContents | ( | $ | editorArea, | |
| $ | hiddenField | |||
| ) | [private] |
No WYSIWYG Editor - copy editor contents to form field
| string | The name of the editor area | |
| string | The name of the form field |
Definition at line 55 of file bot_nulleditor.php.
| bot_nulleditor::editorArea | ( | $ | name, | |
| $ | content, | |||
| $ | hiddenField, | |||
| $ | width, | |||
| $ | height, | |||
| $ | col, | |||
| $ | row | |||
| ) | [private] |
No WYSIWYG Editor - display the editor
| string | The name of the editor area | |
| string | The content of the field | |
| string | The name of the form field | |
| string | The width of the editor area | |
| string | The height of the editor area | |
| int | The number of columns for the editor area | |
| int | The number of rows for the editor area |
Definition at line 69 of file bot_nulleditor.php.
References aliroMambotHandler::getInstance().
00069 { 00070 /* 00071 echo '<br />Name='.$name; 00072 echo '<br />Content='.$content; 00073 echo '<br />hiddenField='.$hiddenField; 00074 echo '<br />width='.$width; 00075 echo '<br />height='.$height; 00076 echo '<br />col='.$col; 00077 echo '<br />row='.$row; 00078 */ 00079 $mhandler = aliroMambotHandler::getInstance(); 00080 $results = $mhandler->trigger('onCustomEditorButton'); 00081 $buttons = array(); 00082 foreach ($results as $result) { 00083 $buttons[] = '<img src="'.aliroCore::getInstance()->getCfg('live_site').'/mambots/editors-xtd/'.$result[0].'" onclick="insertAtCursor( document.adminForm.'.$hiddenField.', \''.$result[1].'\' )" />'; 00084 } 00085 $buttons = implode( "", $buttons ); 00086 return <<<EOD 00087 <textarea name="$hiddenField" id="$hiddenField" cols="$col" rows="$row" style="width:{$width}px;height:{$height}px;">$content</textarea> 00088 <br />$buttons 00089 EOD; 00090 }
1.5.5