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:
26: class pluginEditorRedactor
27: {
28: public static function init()
29: {
30: joosDocument::instance()
31: ->add_css(JPATH_APP_PLUGINS_SITE . '/editors/redactor/css/redactor.css')
32: ->add_js_file(JPATH_APP_PLUGINS_SITE . '/editors/redactor/redactor.js');
33: }
34:
35: public static function display($name, $content, $hiddenField, $width, $height, $col, $row, $params)
36: {
37: $option = $option = joosRequest::param('option');
38:
39: $code_on_ready = <<< EOD
40: $(document).ready(function() {
41: $('#$name').redactor({
42: imageUpload: '/admin/ajax.index.php?option=$option&task=upload_images_embedded',
43: fileUpload: '/admin/ajax.index.php?option=$option&task=upload_files_embedded'
44: });
45: });
46: EOD;
47: joosDocument::instance()
48: ->add_js_code($code_on_ready);
49:
50: return '<textarea name="' . $hiddenField . '" id="' . $hiddenField . '" cols="' . $col . '" rows="' . $row . '" style="width:' . $width . ';height:' . $height . ';">' . $content . '</textarea>';
51: }
52:
53: public static function get_content($name, $params = array())
54: {
55: return true;
56: }
57:
58: }
59: