[TYPO3-dev] looking for a hook to use before rendering a backend page
Alexander Stehlik
alexander.stehlik at gmail.com
Sat Mar 1 09:49:18 CET 2014
Hi Ivano,
I think the best way to do this is to manipulate the foreign_table_where
TCA configuration of the fe_users table.
In older TYPO3 versions you need to call t3lib_div::loadTca('fe_users')
before manipulating the TCA in you ext_tables.php files.
Currently the configuration looks like this:
$GLOBALS['TCA']['fe_users']['columns']['usergroup']['config']['foreign_table_where']
= 'ORDER BY fe_groups.title';
You could override that e.g. with:
$timestamp = time();
$GLOBALS['TCA']['fe_users']['columns']['usergroup']['config']['foreign_table_where']
=
'stop < ' . $timestamp . ' ' .
$GLOBALS['TCA']['fe_users']['columns']['usergroup']['config']['foreign_table_where'];
Maybe you could also use BackendUtility::BEenableFields() (in older
versions the class is called t3lib_BEfunc), see [1] to generate the query.
Another possibility would be to write an itemsProcFunc that filters out
the expired items, but this would not be so good performance wise, see
itemsProcFunc in [2]
Hope this helps!
Kind regards,
Alex
[1]
http://typo3.org/api/typo3cms/class_t_y_p_o3_1_1_c_m_s_1_1_backend_1_1_utility_1_1_backend_utility.html#ae227c8b5948d8a630d4fbfb79eaae421
[2]
http://docs.typo3.org/typo3cms/TCAReference/Reference/Columns/Select/Index.html
Am 24.02.2014 18:17, schrieb Ivano Luberti:
> Hello all, I'm currently modifyng itypoexpiringfegroups to tightly
> integrate it with the TYPO3 group management so that the usergroup field
> reflects the content of itypoexpiringfegroups field. I'm planning to
> make the changes available if the actual maintainer agrees with my changes.
>
> I have already been able to hook the process during frontend user logon
> and even to hack current extension javascript to modify values of
> usergroup field in the backend form when itypoexpiringfegroups is edited.
>
> The last thing I want to achieve is that when the form to edit a user is
> called, before showing the values, I can hook the process to possibly
> modify the value of usergroup field taking into account expiration or
> starting validity of groups contained in itypoexpiringfegroups field.
>
> I have already found
>
> $TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tceforms.php']['getSingleFieldClass']
>
>
> but even if I can change value in the DB before showing them, I cannot
> update the $row['usergroup'] value. So backend user would see
> potentially expired values and save them back erroneously.
>
> Does someone knows if exists a suitable hook for my needs?
>
>
>
--
Alexander Stehlik
alexander.stehlik at gmail.com
More information about the TYPO3-dev
mailing list