[TASK] Use "int" in @param notation
[Packages/TYPO3.CMS.git] / typo3 / sysext / rtehtmlarea / Classes / Extension / UserElements.php
1 <?php
2 namespace TYPO3\CMS\Rtehtmlarea\Extension;
3
4 /**
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16 /**
17 * User Elements extension for htmlArea RTE
18 *
19 * @author Stanislas Rolland <typo3(arobas)sjbr.ca>
20 */
21 class UserElements extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi {
22
23 protected $extensionKey = 'rtehtmlarea';
24
25 // The key of the extension that is extending htmlArea RTE
26 protected $pluginName = 'UserElements';
27
28 // The name of the plugin registered by the extension
29 protected $relativePathToLocallangFile = '';
30
31 // Path to this main locallang file of the extension relative to the extension dir.
32 protected $relativePathToSkin = 'extensions/UserElements/skin/htmlarea.css';
33
34 // Path to the skin (css) file relative to the extension dir
35 protected $htmlAreaRTE;
36
37 // Reference to the invoking object
38 protected $thisConfig;
39
40 // Reference to RTE PageTSConfig
41 protected $toolbar;
42
43 // Reference to RTE toolbar array
44 protected $LOCAL_LANG;
45
46 // Frontend language array
47 protected $pluginButtons = 'user';
48
49 protected $convertToolbarForHtmlAreaArray = array(
50 'user' => 'UserElements'
51 );
52
53 /**
54 * Return JS configuration of the htmlArea plugins registered by the extension
55 *
56 * @param int Relative id of the RTE editing area in the form
57 * @return string JS configuration for registered plugins, in this case, JS configuration of block elements
58 */
59 public function buildJavascriptConfiguration($RTEcounter) {
60 $registerRTEinJavascriptString = '';
61 $button = 'user';
62 if (in_array($button, $this->toolbar)) {
63 if (!is_array($this->thisConfig['buttons.']) || !is_array($this->thisConfig['buttons.'][($button . '.')])) {
64 $registerRTEinJavascriptString .= '
65 RTEarea[' . $RTEcounter . '].buttons.' . $button . ' = new Object();';
66 }
67 $registerRTEinJavascriptString .= '
68 RTEarea[' . $RTEcounter . '].buttons.' . $button . '.pathUserModule = "' .
69 \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleUrl('rtehtmlarea_wizard_user') . '";';
70 }
71 return $registerRTEinJavascriptString;
72 }
73
74 }