@@ -17,42 +17,42 @@ discard block |
||
| 17 | 17 | class ExtensionManager |
| 18 | 18 | { |
| 19 | 19 | |
| 20 | - /** |
|
| 21 | - * @var array |
|
| 22 | - */ |
|
| 23 | - protected $excludedContentTypes = array('pages', 'pages_language_overlay', 'tx_rtehtmlarea_acronym'); |
|
| 24 | - |
|
| 25 | - /** |
|
| 26 | - * Display a message to the Extension Manager whether the configuration is OK or KO. |
|
| 27 | - * |
|
| 28 | - * @param array $params |
|
| 29 | - * @param \TYPO3\CMS\Core\TypoScript\ConfigurationForm $tsObj |
|
| 30 | - * @return string |
|
| 31 | - */ |
|
| 32 | - public function renderDataTypes(&$params, &$tsObj) |
|
| 33 | - { |
|
| 34 | - |
|
| 35 | - $configuration = ConfigurationUtility::getInstance()->getConfiguration(); |
|
| 36 | - $selectedDataTypes = GeneralUtility::trimExplode(',', $configuration['data_types']); |
|
| 37 | - $options = ''; |
|
| 38 | - foreach ($this->getDataTypes() as $dataType) { |
|
| 39 | - $checked = ''; |
|
| 40 | - |
|
| 41 | - if (in_array($dataType, $selectedDataTypes)) { |
|
| 42 | - $checked = 'checked="checked"'; |
|
| 43 | - } |
|
| 44 | - $options .= sprintf( |
|
| 45 | - '<li><label><input type="checkbox" class="fieldDataType" value="%s" %s /> %s</label></li>', |
|
| 46 | - $dataType, |
|
| 47 | - $checked, |
|
| 48 | - $dataType |
|
| 49 | - ); |
|
| 50 | - } |
|
| 51 | - |
|
| 52 | - $menu = sprintf('<ul class="list-unstyled" style="margin-top: 10px;">%s</ul>', $options); |
|
| 53 | - |
|
| 54 | - // Assemble final output. |
|
| 55 | - $output = <<<EOF |
|
| 20 | + /** |
|
| 21 | + * @var array |
|
| 22 | + */ |
|
| 23 | + protected $excludedContentTypes = array('pages', 'pages_language_overlay', 'tx_rtehtmlarea_acronym'); |
|
| 24 | + |
|
| 25 | + /** |
|
| 26 | + * Display a message to the Extension Manager whether the configuration is OK or KO. |
|
| 27 | + * |
|
| 28 | + * @param array $params |
|
| 29 | + * @param \TYPO3\CMS\Core\TypoScript\ConfigurationForm $tsObj |
|
| 30 | + * @return string |
|
| 31 | + */ |
|
| 32 | + public function renderDataTypes(&$params, &$tsObj) |
|
| 33 | + { |
|
| 34 | + |
|
| 35 | + $configuration = ConfigurationUtility::getInstance()->getConfiguration(); |
|
| 36 | + $selectedDataTypes = GeneralUtility::trimExplode(',', $configuration['data_types']); |
|
| 37 | + $options = ''; |
|
| 38 | + foreach ($this->getDataTypes() as $dataType) { |
|
| 39 | + $checked = ''; |
|
| 40 | + |
|
| 41 | + if (in_array($dataType, $selectedDataTypes)) { |
|
| 42 | + $checked = 'checked="checked"'; |
|
| 43 | + } |
|
| 44 | + $options .= sprintf( |
|
| 45 | + '<li><label><input type="checkbox" class="fieldDataType" value="%s" %s /> %s</label></li>', |
|
| 46 | + $dataType, |
|
| 47 | + $checked, |
|
| 48 | + $dataType |
|
| 49 | + ); |
|
| 50 | + } |
|
| 51 | + |
|
| 52 | + $menu = sprintf('<ul class="list-unstyled" style="margin-top: 10px;">%s</ul>', $options); |
|
| 53 | + |
|
| 54 | + // Assemble final output. |
|
| 55 | + $output = <<<EOF |
|
| 56 | 56 | <div class="form-group form-group-dashed> |
| 57 | 57 | <div class="form-control-wrap"> |
| 58 | 58 | |
@@ -86,30 +86,30 @@ discard block |
||
| 86 | 86 | </div> |
| 87 | 87 | EOF; |
| 88 | 88 | |
| 89 | - return $output; |
|
| 90 | - } |
|
| 91 | - |
|
| 92 | - /** |
|
| 93 | - * @return array |
|
| 94 | - */ |
|
| 95 | - public function getDataTypes() |
|
| 96 | - { |
|
| 97 | - |
|
| 98 | - $dataTypes = []; |
|
| 99 | - |
|
| 100 | - if (is_array($GLOBALS['TCA'])) { |
|
| 101 | - foreach ($GLOBALS['TCA'] as $contentType => $tca) { |
|
| 102 | - if (!in_array($contentType, $this->excludedContentTypes) |
|
| 103 | - && isset($GLOBALS['TCA'][$contentType]['ctrl']['label']) |
|
| 104 | - && ( |
|
| 105 | - !isset($GLOBALS['TCA'][$contentType]['ctrl']['hideTable']) |
|
| 106 | - || true !== (bool)$GLOBALS['TCA'][$contentType]['ctrl']['hideTable'] |
|
| 107 | - ) |
|
| 108 | - ) { |
|
| 109 | - $dataTypes[] = $contentType; |
|
| 110 | - } |
|
| 111 | - } |
|
| 112 | - } |
|
| 113 | - return $dataTypes; |
|
| 114 | - } |
|
| 89 | + return $output; |
|
| 90 | + } |
|
| 91 | + |
|
| 92 | + /** |
|
| 93 | + * @return array |
|
| 94 | + */ |
|
| 95 | + public function getDataTypes() |
|
| 96 | + { |
|
| 97 | + |
|
| 98 | + $dataTypes = []; |
|
| 99 | + |
|
| 100 | + if (is_array($GLOBALS['TCA'])) { |
|
| 101 | + foreach ($GLOBALS['TCA'] as $contentType => $tca) { |
|
| 102 | + if (!in_array($contentType, $this->excludedContentTypes) |
|
| 103 | + && isset($GLOBALS['TCA'][$contentType]['ctrl']['label']) |
|
| 104 | + && ( |
|
| 105 | + !isset($GLOBALS['TCA'][$contentType]['ctrl']['hideTable']) |
|
| 106 | + || true !== (bool)$GLOBALS['TCA'][$contentType]['ctrl']['hideTable'] |
|
| 107 | + ) |
|
| 108 | + ) { |
|
| 109 | + $dataTypes[] = $contentType; |
|
| 110 | + } |
|
| 111 | + } |
|
| 112 | + } |
|
| 113 | + return $dataTypes; |
|
| 114 | + } |
|
| 115 | 115 | } |