[TYPO3-team-templavoila] RFC: #4200: Shortcut page must show content when kb_tv_cont_slide in used
Dmitry Dulepov
dmitry.dulepov at gmail.com
Mon Dec 7 12:07:33 CET 2009
Hi!
I like the idea but I do not like magic constants. In 6 months nobody is going to remember what this means:
+ if (in_array($doktype, $handleDoktypes)) {
+ $doktype = 1;
+ }
There should be at least a comment explaining what's going on here and what "1" means. I would prefer a class constant but comment would do too.
Also you can make this code shorter by using t3lib_div::inList():
+ $handleDoktypes = t3lib_div::trimExplode(',', $this->modTSconfig['properties']['doktypesRenderAsEdit'], TRUE);
+ if (in_array($doktype, $handleDoktypes)) {
All together become something like:
$docTypesToEdit = $this->modTSconfig['properties']['pageTypesToEdit'];
if ($docTypesToEdit && t3lib_div::inList($docTypesToEdit, $doktype)) {
// Make sure it is editable by page module
$doktype = self::DOKTYPE_ABCD;
}
I also changed TS property name from doktypesRenderAsEdit to pageTypesToEdit because previous was hard to remember for non–programmers, who do not know what "doktype" is.
Comments? :)
--
Dmitry Dulepov
"Trust me, I am a doctor!" (c) Gregory House, M.D.
More information about the TYPO3-team-templavoila
mailing list