54 lines
1.7 KiB
PHP
54 lines
1.7 KiB
PHP
<?php defined('SYSPATH') or die('No direct access allowed.');
|
|
|
|
/**
|
|
* This class is for rendering the tinyMCE editor
|
|
*
|
|
* @package lnApp
|
|
* @subpackage Editor
|
|
* @category Helpers
|
|
* @author Deon George
|
|
* @copyright (c) 2010 Deon George
|
|
* @license http://dev.leenooks.net/license.html
|
|
*/
|
|
class Editor {
|
|
private static $added = FALSE;
|
|
|
|
public static function add() {
|
|
if (static::$added)
|
|
return;
|
|
|
|
static::$added = TRUE;
|
|
|
|
Script::add(array(
|
|
'type'=>'file',
|
|
'data'=>'js/jquery-1.4.2.js',
|
|
));
|
|
Script::add(array(
|
|
'type'=>'file',
|
|
'data'=>'js/tiny_mce/tiny_mce.js',
|
|
));
|
|
Script::add(array(
|
|
'type'=>'stdin',
|
|
'data'=>'
|
|
tinyMCE.init({
|
|
mode : "specific_textareas",
|
|
editor_selector : "mceEditor",
|
|
theme : "advanced",
|
|
plugins : "table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print",
|
|
theme_advanced_buttons1_add : "fontselect,fontsizeselect",
|
|
theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",
|
|
theme_advanced_buttons2_add_before: "cut,copy,paste,separator,search,replace,separator",
|
|
theme_advanced_buttons3_add_before : "tablecontrols,separator",
|
|
theme_advanced_buttons3_add : "iespell,media,advhr",
|
|
theme_advanced_toolbar_location : "bottom",
|
|
theme_advanced_toolbar_align : "center",
|
|
plugin_insertdate_dateFormat : "%Y-%m-%d",
|
|
plugin_insertdate_timeFormat : "%H:%M:%S",
|
|
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
|
|
relative_urls: "true",
|
|
width : "100%"
|
|
});'));
|
|
}
|
|
}
|
|
?>
|