[TYPO3-dev] Adding SQL condition to the list module according to BE Groups
Fabien Udriot
fudriot at omic.ch
Tue Jul 13 13:13:04 CEST 2010
So it is fairly easy... when one knows!
1. Declare the hook in ext_locallang.php
$TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable'][] =
'EXT:speciality/class.tx_speciality_modulelisthook.php:&tx_speciality_modulelisthook';
2. Save following file: class.tx_speciality_modulelisthook.php
require_once(PATH_t3lib.'interfaces/interface.t3lib_localrecordlistgettablehook.php');
class tx_speciality_modulelisthook implements t3lib_localRecordListGetTableHook {
/**
* Allows to add additional condition when rendering a list of records in List Module
*
* @param string $table: the table name
* @param int $pageId: the page id
* @param string $additionalWhereClause: reference of additional query
* @param string $selectedFieldsList: the list of field
* @param object $pObj: parent object
* @return void
*/
public function getDBlistQuery($table, $pageId, &$additionalWhereClause, &$selectedFieldsList,
&$parentObject) {
if($table == 'tt_news') {
$additionalWhereClause .= ' AND title LIKE "%TYPO3%"';
}
}
}
Cheers,
Fabien
On 7/13/10 10:54 AM, Fabien Udriot wrote:
> Also, it seems I can use a hook to filter records in the List Module
> $TYPO3_CONF_VARS['SC_OPTIONS']['typo3/class.db_list_extra.inc']['getTable']
>
> I am currently digging into it and how to use it.
>
> Fb.
>
> On 7/12/10 8:59 PM, Steffen Kamper wrote:
>> Hi,
>>
>> Fabien Udriot schrieb:
>>> I am wondering if a "sys_action" can be useful here? Anyway, it can make sense to have that
>>> feature to have everything at one place for the BE Users.
>>>
>>
>> i use sys_action mainly for that reason. You can create nearly every view of data with SQLquery.
>>
>> vg Steffen
More information about the TYPO3-dev
mailing list