Feature #14999
closedoverride admin panel values from TSConfig
0%
Description
currently, it is not possible to override all admin panel values from user/group TSConfig.
At the moment, there are only the following properties for module.edit:
( http://typo3.org/documentation/document-library/doc_core_tsconfig/gt_ADMPANEL/ )
.forceDisplayIcons
.forceDisplayFieldIcons
.forceNoPopup
But in case you want to hide the admin panel for users and still set some values for them, you can use the proposed patch. For example, to set the preview for pages and records to on, you can use the following TSConfig after applying the patch:
admPanel {
hide = 1
module.preview = 1
module.preview.showHiddenPages = 1
module.preview.showHiddenRecords = 1
}
Maybe this is helpful to others as well, do others think this might become a core modification?
Greets,
Sebastian
(issue imported from #M1518)
Files
Updated by Sebastian Kurfuerst about 19 years ago
There is a problem with this fix which is more complicated.
It's visible that it is not possible to set
module.preview.showHiddenRecords = 1 - that's how I noticed the bug.
It became visible that the problem itself lies in the function t3lib_page::enableFields in the second if-statement:
if ($show_hidden==-1) $show_hidden=0; // If show_hidden was not changed
If show_hidden is a boolean value (as it is when it is set with the method outlined in the bugreport), then $show_hidden is set to 0 (http://www.php.net/manual/en/types.comparisons.php) - Bugfix for this would be to write === instead of ==.
Normally, $show_hidden comes from UC, and is a String there: t3lib_tsfebeuserauth::extGetFeAdminValue: $retVal = $val ? $this->uc['TSFE_adminConfig'][$pre.'_'.$val] : 1;
The t3lib_page::enableFields function is called in tslib_content::enableFields, but this is not relevant.
One solution for exactly this problem would be to do a
return '1';
instead of
return true
in the patch which is attached to this bugreport. This however, is somewhat "unclean" I think, because the values are just supposed to be boolean. Thus, the proposed solution would be to write
if ($show_hidden===-1)
instead of
if ($show_hidden==-1)
in t3lib_page::enableFields. Then the solution is clean and everything should work as expected.
Any comments, hints, suggestions? Greets, Sebastian
Updated by Sebastian Kurfuerst about 19 years ago
the new version implements non-boolean fields as well.
greets, Sebastian