47 protected $pluginButtons =
'formatblock, indent, outdent, blockquote, insertparagraphbefore, insertparagraphafter, left, center, right, justifyfull, orderedlist, unorderedlist, line';
50 'formatblock' =>
'FormatBlock',
52 'outdent' =>
'Outdent',
53 'blockquote' =>
'Blockquote',
54 'insertparagraphbefore' =>
'InsertParagraphBefore',
55 'insertparagraphafter' =>
'InsertParagraphAfter',
56 'left' =>
'JustifyLeft',
57 'center' =>
'JustifyCenter',
58 'right' =>
'JustifyRight',
59 'justifyfull' =>
'JustifyFull',
60 'orderedlist' =>
'InsertOrderedList',
61 'unorderedlist' =>
'InsertUnorderedList',
62 'line' =>
'InsertHorizontalRule' 74 'pre' =>
'Preformatted',
75 'address' =>
'Address',
76 'article' =>
'Article',
78 'blockquote' =>
'Long quotation',
82 'nav' =>
'Navigation',
83 'section' =>
'Section' 86 protected $defaultBlockElementsOrder =
'none, p, h1, h2, h3, h4, h5, h6, pre, address, article, aside, blockquote, div, footer, header, nav, section';
96 $registerRTEinJavascriptString =
'';
97 if (in_array(
'formatblock', $this->toolbar)) {
98 if (!is_array($this->thisConfig[
'buttons.']) || !is_array($this->thisConfig[
'buttons.'][
'formatblock.'])) {
99 $registerRTEinJavascriptString .=
' 100 RTEarea[' . $RTEcounter .
'].buttons.formatblock = new Object();';
103 $hideItems = array();
105 $restrictTo = array(
'*');
107 $prefixLabelWithTag = FALSE;
108 $postfixLabelWithTag = FALSE;
110 if (is_array($this->thisConfig[
'buttons.']) && is_array($this->thisConfig[
'buttons.'][
'formatblock.'])) {
112 if ($this->thisConfig[
'buttons.'][
'formatblock.'][
'removeItems']) {
113 if ($this->htmlAreaRTE->cleanList($this->thisConfig[
'buttons.'][
'formatblock.'][
'removeItems']) ==
'*') {
120 if ($this->thisConfig[
'buttons.'][
'formatblock.'][
'addItems']) {
124 if ($this->thisConfig[
'buttons.'][
'formatblock.'][
'restrictToItems']) {
128 if ($this->thisConfig[
'buttons.'][
'formatblock.'][
'orderItems']) {
131 $prefixLabelWithTag = $this->thisConfig[
'buttons.'][
'formatblock.'][
'prefixLabelWithTag'] ? TRUE : $prefixLabelWithTag;
132 $postfixLabelWithTag = $this->thisConfig[
'buttons.'][
'formatblock.'][
'postfixLabelWithTag'] ? TRUE : $postfixLabelWithTag;
135 $blockElementsOrder = array_merge(\
TYPO3\CMS\Core\Utility\
GeneralUtility::trimExplode(
',', $this->htmlAreaRTE->cleanList($blockElementsOrder), TRUE), $addItems);
137 if (in_array(
'indent', $this->toolbar) || in_array(
'outdent', $this->toolbar)) {
138 $blockElementsOrder = array_merge($blockElementsOrder, array(
'div'));
141 if (in_array(
'blockquote', $this->toolbar)) {
142 $blockElementsOrder = array_merge($blockElementsOrder, array(
'blockquote'));
145 $blockElementsOrder = array_diff($blockElementsOrder, $hideItems);
147 if (!in_array(
'*', $restrictTo)) {
148 $blockElementsOrder = array_intersect($blockElementsOrder, $restrictTo);
151 $blockElementsOptions = array();
153 if (is_array($this->thisConfig[
'buttons.']) && is_array($this->thisConfig[
'buttons.'][
'formatblock.']) && is_array($this->thisConfig[
'buttons.'][
'formatblock.'][
'items.'])) {
154 $labels = $this->thisConfig[
'buttons.'][
'formatblock.'][
'items.'];
156 foreach ($blockElementsOrder as $item) {
157 if ($this->htmlAreaRTE->is_FE()) {
158 $blockElementsOptions[$item] = $TSFE->getLLL($this->defaultBlockElements[$item], $this->LOCAL_LANG);
160 $blockElementsOptions[$item] = $LANG->getLL($this->defaultBlockElements[$item]);
163 if (is_array($labels[$item .
'.']) && $labels[$item .
'.'][
'label']) {
164 $blockElementsOptions[$item] = $this->htmlAreaRTE->getPageConfigLabel($labels[$item .
'.'][
'label'], 0);
166 $blockElementsOptions[$item] = ($prefixLabelWithTag && $item !=
'none' ? $item .
' - ' :
'') . $blockElementsOptions[$item] . ($postfixLabelWithTag && $item !=
'none' ?
' - ' . $item :
'');
168 $first = array_shift($blockElementsOptions);
170 if (!is_array($this->thisConfig[
'buttons.']) || !is_array($this->thisConfig[
'buttons.'][
'formatblock.']) || !$this->thisConfig[
'buttons.'][
'formatblock.'][
'orderItems']) {
171 asort($blockElementsOptions);
174 $JSBlockElements = array();
175 $JSBlockElements[] = array($first,
'none');
176 foreach ($blockElementsOptions as $item => $label) {
177 $JSBlockElements[] = array($label, $item);
179 if ($this->htmlAreaRTE->is_FE()) {
180 $GLOBALS[
'TSFE']->csConvObj->convArray($JSBlockElements, $this->htmlAreaRTE->OutputCharset,
'utf-8');
182 $registerRTEinJavascriptString .=
' 183 RTEarea[' . $RTEcounter .
'].buttons.formatblock.options = ' . json_encode($JSBlockElements) .
';';
185 return $registerRTEinJavascriptString;
$defaultBlockElementsOrder
$relativePathToLocallangFile
$convertToolbarForHtmlAreaArray
static trimExplode($delim, $string, $removeEmptyValues=FALSE, $limit=0)
buildJavascriptConfiguration($RTEcounter)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]