2 namespace TYPO3\CMS\Rtehtmlarea\Extension;
45 'fontstyle' =>
'FontName',
46 'fontsize' =>
'FontSize'
56 'Arial' =>
'Arial,sans-serif',
57 'Arial Black' =>
'\'Arial Black\
',sans-serif',
58 'Verdana' =>
'Verdana,Arial,sans-serif',
59 'Times New Roman' =>
'\'Times New Roman\
',Times,serif',
60 'Garamond' =>
'Garamond',
61 'Lucida Handwriting' =>
'\'Lucida Handwriting\
'',
62 'Courier' =>
'Courier',
63 'Webdings' =>
'Webdings',
64 'Wingdings' =>
'Wingdings'
67 'Extra small' =>
'8px',
68 'Very small' =>
'9px',
72 'Very large' =>
'24px',
73 'Extra large' =>
'32px'
92 $enabled = parent::main($configuration) &&
$GLOBALS[
'TYPO3_CONF_VARS'][
'EXTCONF'][
'rtehtmlarea'][
'allowStyleAttribute'];
93 $this->RTEProperties = $this->configuration[
'RTEsetup'][
'properties'];
107 foreach ($pluginButtonsArray as $buttonId) {
108 if (in_array($buttonId, $this->toolbar)) {
112 return implode(LF, $jsArray);
127 if (is_array($this->configuration[
'thisConfig'][
'buttons.']) && is_array($this->configuration[
'thisConfig'][
'buttons.'][$buttonId .
'.'])) {
128 if ($this->configuration[
'thisConfig'][
'buttons.'][$buttonId .
'.'][
'removeItems']) {
129 $hideItems = $this->configuration[
'thisConfig'][
'buttons.'][$buttonId .
'.'][
'removeItems'];
131 if ($this->configuration[
'thisConfig'][
'buttons.'][$buttonId .
'.'][
'addItems']) {
137 $languageKey = $buttonId ==
'fontstyle' ?
'Default font' :
'Default size';
140 $languageService->sL(
141 'LLL:EXT:rtehtmlarea/Resources/Private/Language/Plugins/SelectFont/locallang.xlf:' . $languageKey
147 if ($hideItems !=
'*') {
149 foreach ($this->defaultFont[$buttonId] as $name => $value) {
151 $label = $languageService->sL(
'LLL:EXT:rtehtmlarea/Resources/Private/Language/Plugins/SelectFont/locallang.xlf:' . $name) ?: $name;
152 $items[$name] = array($label, $this->
cleanList($value));
158 if (is_array($this->RTEProperties[$buttonId ==
'fontstyle' ?
'fonts.' :
'fontSizes.'])) {
159 foreach ($this->RTEProperties[$buttonId ==
'fontstyle' ?
'fonts.' :
'fontSizes.'] as $name => $conf) {
160 $name = substr($name, 0, -1);
161 if (in_array($name, $addItems)) {
163 $items[$name] = array($label, $this->
cleanList($conf[
'value']));
168 if ($this->configuration[
'thisConfig'][
'buttons.'][$buttonId .
'.'][
'defaultItem'] && $items[$this->configuration[
'thisConfig'][
'buttons.'][$buttonId .
'.'][
'defaultItem']]) {
169 $items[
'none'] = array($items[$this->configuration[
'thisConfig'][
'buttons.'][$buttonId .
'.'][
'defaultItem']][0],
'none');
170 unset($items[$this->configuration[
'thisConfig'][
'buttons.'][$buttonId .
'.'][
'defaultItem']]);
173 $itemsJSArray = array();
174 foreach ($items as $name => $option) {
175 $itemsJSArray[] = array(
'text' => $option[0],
'value' => $option[1]);
177 $itemsJSArray = json_encode(array(
'options' => $itemsJSArray));
179 if (!is_array($this->configuration[
'thisConfig'][
'buttons.']) || !is_array($this->configuration[
'thisConfig'][
'buttons.'][($buttonId .
'.')])) {
180 $jsArray[] =
'RTEarea[editornumber].buttons.' . $buttonId .
' = new Object();';
182 $jsArray[] =
'RTEarea[editornumber].buttons.' . $buttonId .
'.dataUrl = "' . $this->
writeTemporaryFile($buttonId .
'_' . $this->configuration[
'contentLanguageUid'],
'js', $itemsJSArray) .
'";';
183 return implode(LF, $jsArray);