TYPO3 CMS  TYPO3_7-6
DefinitionList.php
Go to the documentation of this file.
1 <?php
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 
18 
23 {
29  protected $pluginName = 'DefinitionList';
30 
36  protected $pluginButtons = 'definitionlist, definitionitem';
37 
44  'definitionlist' => 'DefinitionList',
45  'definitionitem' => 'DefinitionItem'
46  ];
47 
53  protected $requiredPlugins = 'BlockElements';
54 
61  public function main(array $configuration)
62  {
63  return parent::main($configuration)
64  && isset($GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['rtehtmlarea']['plugins']['BlockElements']);
65  }
66 
72  public function buildJavascriptConfiguration()
73  {
74  return '';
75  }
76 
83  public function applyToolbarConstraints($show)
84  {
85  $blockElementsButtons = 'formatblock, indent, outdent, blockquote, insertparagraphbefore, insertparagraphafter, left, center, right, justifyfull, orderedlist, unorderedlist';
86  $notRemoved = array_intersect(\TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $blockElementsButtons, true), $show);
87  // DefinitionList plugin requires BlockElements plugin
88  // We will not allow any definition lists operations if all block elements buttons were disabled
89  if (empty($notRemoved)) {
90  return array_diff($show, \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $this->pluginButtons));
91  } else {
92  return $show;
93  }
94  }
95 }
static trimExplode($delim, $string, $removeEmptyValues=false, $limit=0)
if(TYPO3_MODE==='BE') $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tsfebeuserauth.php']['frontendEditingController']['default']