[TYPO3-dev] Extending news_author_rel: a typo3 and SQL question
Pieter
pieter.v at gmx.net
Sat Mar 25 19:09:32 CET 2006
Ingmar Schlecht wrote:
> Hi Pieter,
>
> Pieter wrote:
>> My questions:
>> 1) how can I access the typoscript configuration in ext_tables.php? I
>> need to replace "5" with a typoscript value.
>
> There is no standard way to access typoscript values in the backend,
> except for building the whole TypoScript tree manually in the backend as
> e.g. the rlmp_automaketemplate extensions does.
>
> But you can't use TypoScript here anyway, because in ext_tables.php you
> don't know for which page ID you should generate the Template TypoScript
> tree.
>
Thanks for putting me on the right track.
Things are working now. A added a parameter to ext_conf_template.txt:
# cat=basic//40; type=text; label= Select fe_usergroups: Here you can
insert a comma separated list fe_usergroups PID's. Only records from
the groups in this list are shown. Only used for a "select" from
fe_users! Empty = all fe_users are shown.
fe_usergroups =
And some code in ext_tables.php:
require_once(PATH_t3lib.'class.t3lib_div.php');
function findInSet_whereClause($field,$list) {
$items = t3lib_div::trimExplode(',',$list);
$whereClause .= 'AND (0 ';
foreach($items as $item) {
$whereClause .= "OR
$field = '$item' OR
$field LIKE '$item,%' OR
$field LIKE '%,$item' OR
$field LIKE '%,$item,%' ";
}
$whereClause .= ')';
return $whereClause;
}
$fe_usergroups = $confArr['fe_usergroups'];
if ($fe_usergroups and ($foreign_table == 'fe_users')) {
$fTableWhere .=
findInSet_whereClause($foreign_table.'.usergroup',$fe_usergroups);
}
I'll send it to Rupi as an idea for a future version.
Regards,
Pieter
More information about the TYPO3-dev
mailing list