2 namespace TYPO3\CMS\Rtehtmlarea\Extension;
37 protected $pluginButtons =
'formattext, bidioverride, big, bold, citation, code, definition, deletedtext, emphasis, insertedtext, italic, keyboard, quotation, sample, small, span, strikethrough, strong, subscript, superscript, underline, variable';
45 'formattext' =>
'FormatText',
46 'bidioverride' =>
'BiDiOverride',
49 'citation' =>
'Citation',
51 'definition' =>
'Definition',
52 'deletedtext' =>
'DeletedText',
53 'emphasis' =>
'Emphasis',
54 'insertedtext' =>
'InsertedText',
56 'keyboard' =>
'Keyboard',
57 'monospaced' =>
'MonoSpaced',
58 'quotation' =>
'Quotation',
62 'strikethrough' =>
'StrikeThrough',
64 'subscript' =>
'Subscript',
65 'superscript' =>
'Superscript',
66 'underline' =>
'Underline',
67 'variable' =>
'Variable'
76 'none' =>
'No markup',
78 'bdo' =>
'BiDi override',
79 'big' =>
'Large text',
82 'del' =>
'Deleted text',
83 'dfn' =>
'Definition',
86 'ins' =>
'Inserted text',
90 'small' =>
'Small text',
91 'span' =>
'Style container',
92 'strike' =>
'Strike-through',
93 'strong' =>
'Strong emphasis',
95 'sup' =>
'Superscript',
96 'tt' =>
'Monospaced text',
106 protected $defaultInlineElementsOrder =
'none, bidioverride, big, bold, citation, code, definition, deletedtext, emphasis, insertedtext, italic, keyboard,
107 monospaced, quotation, sample, small, span, strikethrough, strong, subscript, superscript, underline, variable';
116 'bidioverride' =>
'bdo',
119 'citation' =>
'cite',
121 'definition' =>
'dfn',
122 'deletedtext' =>
'del',
124 'insertedtext' =>
'ins',
127 'monospaced' =>
'tt',
132 'strikethrough' =>
'strike',
133 'strong' =>
'strong',
134 'subscript' =>
'sub',
135 'superscript' =>
'sup',
148 if (in_array(
'formattext', $this->toolbar)) {
149 if (!is_array($this->configuration[
'thisConfig'][
'buttons.']) || !is_array($this->configuration[
'thisConfig'][
'buttons.'][
'formattext.'])) {
150 $jsArray[] =
'RTEarea[editornumber].buttons.formattext = new Object();';
153 $hideItems = array();
154 $restrictTo = array(
'*');
156 $prefixLabelWithTag =
false;
157 $postfixLabelWithTag =
false;
159 if (is_array($this->configuration[
'thisConfig'][
'buttons.']) && is_array($this->configuration[
'thisConfig'][
'buttons.'][
'formattext.'])) {
161 if ($this->configuration[
'thisConfig'][
'buttons.'][
'formattext.'][
'removeItems']) {
165 if ($this->configuration[
'thisConfig'][
'buttons.'][
'formattext.'][
'restrictTo']) {
167 }
elseif ($this->configuration[
'thisConfig'][
'buttons.'][
'formattext.'][
'restrictToItems']) {
171 if ($this->configuration[
'thisConfig'][
'buttons.'][
'formattext.'][
'orderItems']) {
172 $inlineElementsOrder =
'none,' . $this->configuration[
'thisConfig'][
'buttons.'][
'formattext.'][
'orderItems'];
174 $prefixLabelWithTag = $this->configuration[
'thisConfig'][
'buttons.'][
'formattext.'][
'prefixLabelWithTag'] ?
true : $prefixLabelWithTag;
175 $postfixLabelWithTag = $this->configuration[
'thisConfig'][
'buttons.'][
'formattext.'][
'postfixLabelWithTag'] ?
true : $postfixLabelWithTag;
178 if (!in_array(
'*', $restrictTo)) {
179 $inlineElementsOrder = array_intersect($inlineElementsOrder, $restrictTo);
182 $inlineElementsOptions = array();
183 foreach ($inlineElementsOrder as $item) {
184 $inlineElementsOptions[$this->buttonToInlineElement[$item]] = $this->
getLanguageService()->sL(
185 'LLL:EXT:rtehtmlarea/Resources/Private/Language/Plugins/InlineElements/locallang.xlf:' . $this->defaultInlineElements[$this->buttonToInlineElement[$item]]
187 $inlineElementsOptions[$this->buttonToInlineElement[$item]] = ($prefixLabelWithTag && $item !=
'none' ? $this->buttonToInlineElement[$item] .
' - ' :
'') . $inlineElementsOptions[$this->buttonToInlineElement[$item]] . ($postfixLabelWithTag && $item !=
'none' ?
' - ' . $this->buttonToInlineElement[$item] :
'');
189 $first = array_shift($inlineElementsOptions);
191 if (!is_array($this->configuration[
'thisConfig'][
'buttons.']) || !is_array($this->configuration[
'thisConfig'][
'buttons.'][
'formattext.']) || !$this->configuration[
'thisConfig'][
'buttons.'][
'formattext.'][
'orderItems']) {
192 asort($inlineElementsOptions);
195 $JSInlineElements = array();
196 $JSInlineElements[] = array($first,
'none');
197 foreach ($inlineElementsOptions as $item => $label) {
198 $JSInlineElements[] = array($label, $item);
200 $jsArray[] =
'RTEarea[editornumber].buttons.formattext.options = ' . json_encode($JSInlineElements) .
';';
202 return implode(LF, $jsArray);