/
jce.php
executable file
·83 lines (73 loc) · 1.91 KB
/
jce.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php
/**
* @package JCE
* @subpackage Editors.Jce
*
* @copyright Copyright (C) 2005 - 2023 Open Source Matters, Inc. All rights reserved.
* @copyright Copyright (c) 2009-2024 Ryan Demmer. All rights reserved
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
// Do not allow direct access
defined('JPATH_PLATFORM') or die;
use Joomla\CMS\Editor\Editor;
use Joomla\CMS\Plugin\CMSPlugin;
use Joomla\Plugin\Editors\Jce\PluginTraits\XTDButtonsTrait;
use Joomla\Plugin\Editors\Jce\PluginTraits\DisplayTrait;
/**
* JCE WYSIWYG Editor Plugin.
*
* @since 1.5
*/
class plgEditorJCE extends CMSPlugin
{
use DisplayTrait;
use XTDButtonsTrait;
/**
* Affects constructor behavior. If true, language files will be loaded automatically.
*
* @var boolean
*/
protected $autoloadLanguage = true;
/**
* Constructor.
*
* @param object $subject The object to observe
* @param array $config An array that holds the plugin configuration
*
* @since 1.5
*/
public function __construct(&$subject, $config)
{
parent::__construct($subject, $config);
}
/**
* JCE WYSIWYG Editor - get the editor content.
*
* @vars string The name of the editor
*/
public function onGetContent($editor)
{
return $this->onSave($editor);
}
/**
* JCE WYSIWYG Editor - set the editor content.
*
* @vars string The name of the editor
*/
public function onSetContent($editor, $html)
{
return "WFEditor.setContent('" . $editor . "','" . $html . "');";
}
/**
* JCE WYSIWYG Editor - copy editor content to form field.
*
* @vars string The name of the editor
*/
public function onSave($editor)
{
return "WFEditor.getContent('" . $editor . "');";
}
public function onGetInsertMethod($name)
{
}
}