1: <?php
2:
3: 4: 5: 6: 7: 8: 9:
10:
11: defined('_JOOS_CORE') or exit();
12:
13: 14: 15: 16: 17: 18: 19: 20: 21: 22: 23: 24:
25: class pluginEditorJwysiwyg
26: {
27: public static function init()
28: {
29: joosDocument::instance()
30: ->add_css(JPATH_SITE . '/plugins/editors/jwysiwyg/media/css/jquery.wysiwyg.css')
31: ->add_js_file(JPATH_SITE . '/plugins/editors/jwysiwyg/media/js/jquery.wysiwyg.js');
32: }
33:
34: public static function display($name, $content, $hiddenField, $width, $height, $col, $row, $params)
35: {
36: $toolbar = isset($params['toolbar']) ? $params['toolbar'] : 'complete';
37: $config = joosFile::exists(__DIR__ . '/toolbars/' . $toolbar . '.php') ? require_once ( __DIR__ . '/toolbars/' . $toolbar . '.php' ) : '';
38:
39: $code_on_ready = sprintf("$().ready(function() { $('#%s').wysiwyg(%s); })", $name, $config);
40: joosDocument::$data['js_code'][] = $code_on_ready;
41:
42: return '<textarea name="' . $hiddenField . '" id="' . $hiddenField . '" cols="' . $col . '" rows="' . $row . '" style="width:' . $width . ';height:' . $height . ';">' . $content . '</textarea>';
43: }
44:
45: public static function get_content($name, $params = array())
46: {
47:
48:
49: }
50:
51: }
52: