[TYPO3-dev] Label and tooltip attributes of own page doctypes
Daniel Kluhs
daniel.kluhs at gmx.net
Tue Sep 10 12:03:38 CEST 2013
Hi,
I hope im in the right mailing list.
I have a problem if i add an custom page doctype it is not possible to modify the title and the tooltip of the toolbar button.
(It is not very important but nice to have)
The Problem is it seems that this attributes are mapped with an hardcoded array.
ExtdirectTreeDataProvider.php:
115 public function getNodeTypes() {
116 $map = array(
117 1 => 'LLL:EXT:lang/locallang_tca.xlf:doktype.I.0',
118 3 => 'LLL:EXT:cms/locallang_tca.xlf:pages.doktype.I.8',
119 4 => 'LLL:EXT:cms/locallang_tca.xlf:pages.doktype.I.2',
120 6 => 'LLL:EXT:cms/locallang_tca.xlf:pages.doktype.I.4',
121 7 => 'LLL:EXT:cms/locallang_tca.xlf:pages.doktype.I.5',
122 199 => 'LLL:EXT:cms/locallang_tca.xlf:pages.doktype.I.7',
123 254 => 'LLL:EXT:lang/locallang_tca.xlf:doktype.I.folder',
124 255 => 'LLL:EXT:lang/locallang_tca.xlf:doktype.I.2'
125 );
126 $doktypes = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.doktypesToShowInNewPageDragArea'));
127 $output = array();
128 $allowedDoktypes = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $GLOBALS['BE_USER']->groupData['pagetypes_select']);
129 $isAdmin = $GLOBALS['BE_USER']->isAdmin();
130 foreach ($doktypes as $doktype) {
131 if (!$isAdmin && !in_array($doktype, $allowedDoktypes)) {
132 continue;
133 }
134 $label = $GLOBALS['LANG']->sL($map[$doktype], TRUE);
135 $spriteIcon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIconClasses($GLOBALS['TCA']['pages']['ctrl']['typeicon_classes'][$doktype]);
136 $output[] = array(
137 'nodeType' => $doktype,
138 'cls' => 'typo3-pagetree-topPanel-button',
139 'iconCls' => $spriteIcon,
140 'title' => $label,
141 'tooltip' => $label
142 );
143 }
144 return $output;
145 }
Maybe someone has an idee how to make this editable.
Or maybe if $map[$doktype] is empty it's possible to use the "doctype name" as fallback. ($TCA['pages_language_overlay']['columns']['doktype']['config']['items'][$foo][0])
mfg Daniel Kluhs
More information about the TYPO3-dev
mailing list