[TASK] Merge submodule fluid into core
[Packages/TYPO3.CMS.git] / typo3 / sysext / rtehtmlarea / Classes / Extension / UserElements.php
1 <?php
2 namespace TYPO3\CMS\Rtehtmlarea\Extension;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 2008-2013 Stanislas Rolland <typo3(arobas)sjbr.ca>
8 * All rights reserved
9 *
10 * This script is part of the Typo3 project. The Typo3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 *
19 * This script is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * This copyright notice MUST APPEAR in all copies of the script!
25 ***************************************************************/
26 /**
27 * User Elements extension for htmlArea RTE
28 *
29 * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
30 */
31 class UserElements extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi {
32
33 protected $extensionKey = 'rtehtmlarea';
34
35 // The key of the extension that is extending htmlArea RTE
36 protected $pluginName = 'UserElements';
37
38 // The name of the plugin registered by the extension
39 protected $relativePathToLocallangFile = '';
40
41 // Path to this main locallang file of the extension relative to the extension dir.
42 protected $relativePathToSkin = 'extensions/UserElements/skin/htmlarea.css';
43
44 // Path to the skin (css) file relative to the extension dir
45 protected $htmlAreaRTE;
46
47 // Reference to the invoking object
48 protected $thisConfig;
49
50 // Reference to RTE PageTSConfig
51 protected $toolbar;
52
53 // Reference to RTE toolbar array
54 protected $LOCAL_LANG;
55
56 // Frontend language array
57 protected $pluginButtons = 'user';
58
59 protected $convertToolbarForHtmlAreaArray = array(
60 'user' => 'UserElements'
61 );
62
63 /**
64 * Return JS configuration of the htmlArea plugins registered by the extension
65 *
66 * @param integer Relative id of the RTE editing area in the form
67 * @return string JS configuration for registered plugins, in this case, JS configuration of block elements
68 */
69 public function buildJavascriptConfiguration($RTEcounter) {
70 $registerRTEinJavascriptString = '';
71 $button = 'user';
72 if (in_array($button, $this->toolbar)) {
73 if (!is_array($this->thisConfig['buttons.']) || !is_array($this->thisConfig['buttons.'][($button . '.')])) {
74 $registerRTEinJavascriptString .= '
75 RTEarea[' . $RTEcounter . '].buttons.' . $button . ' = new Object();';
76 }
77 $registerRTEinJavascriptString .= '
78 RTEarea[' . $RTEcounter . '].buttons.' . $button . '.pathUserModule = "' . $this->htmlAreaRTE->extHttpPath . 'mod5/user.php";';
79 }
80 return $registerRTEinJavascriptString;
81 }
82
83 }
84
85
86 ?>