[TYPO3-german] selectorbox in eigener extension manuell mit werten füllen
David Bruchmann
david at bruchmann-web.de
Wed Mar 11 15:24:16 CET 2009
Hallo Manuel,
... und voll machen geht so:
$result['table'] = 'DEINE TABELLE';
$result['res'] = $GLOBALS['TYPO3_DB']->exec_SELECTquery (
$tmpSelect = 'uid,title',
$tmpFrom = $result['table'],
$tmpWhere = $result['table'].'.deleted=0 AND
'.$result['table'].'.hidden=0 '.($mainCatId ? ' AND
maincategory='.$mainCatId : '').($tcaWhere ? ' '.$tcaWhere : ''),
$tmpGroupBy = '',
$tmpOrderBy = '',
$tmpLimit = ''
);
$result['query'] = 'SELECT '.$tmpSelect.' FROM '.$tmpFrom.($tmpWhere ? '
WHERE '.$tmpWhere : '').($tmpGroupBy ? ' GroupBy '.$tmpGroupBy :
'').($tmpOrderBy ? ' OrderBy '.$tmpOrderBy : '').($tmpLimit ? ' Limit
'.$tmpLimit : '');
$result['numrows'] = $GLOBALS['TYPO3_DB']->sql_num_rows($result['res']);
//$params['items'] = array();
// optional divider: $params['items'][] = "--div--";
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($result['res'])) {
$params['items'][] = array($row['title'],$row['uid']);
//,'','','EXPL_ALLOW'
}
Viele Grüße
David
----- Ursprüngliche Nachricht -----
Von: David Bruchmann <david at bruchmann-web.de>
Gesendet: Mittwoch, 11. März 2009 15:10:36
An: German TYPO3 Userlist <typo3-german at lists.netfielders.de>
CC:
Betreff: Re: [TYPO3-german] selectorbox in eigener extension manuell
mit werten füllen
> Hallo Manuel,
>
> Sieh Dir mal die Erweiterung static_info_tables an.
>
> Dort wird in der Datei ext_tables.php ein zusätzliches Feld in die
> Tabelle sys_language eingefügt, dessen Werte aus einer anderen Tabelle
> kommen. Dazu wird die Funktion 'tx_staticinfotables_div->selectItemsTCA'
> aufgerufen, welche in ext_localconf.php eingebunden wird.
>
> Es reicht in der Funktion den Array $params['items'] zu befüllen - er
> muss nicht per return zurückgegeben werden.
>
> Ausserdem habe ich mir für die einzelnen items *** NUR ZUR ERKLÄRUNG ***
> folgenden Array aufgeschrieben, die Keys musst Du in Deiner Extension
> aber weglassen:
>
>
> /*
> // The first array is an explicational example only and the keynames
> aren't used ...
> // reference:
> http://typo3.org/documentation/document-library/core-documentation/doc_core_api/4.2.0/view/4/2/#id4272080
> $params['items'][0] = array(
> 'label' => 'abc',
> 'value' => 1,
> 'icon' => '',
> 'description' => '', // for checkbox only
> 'rights' => '', // [ 'EXPL_ALLOW' | 'EXPL_DENY' ]
> );
> // ... so use it like that:
> $params['items'][0] = array(
> 'abc',
> 1,
> '',
> '', // for checkbox only
> '', // [ 'EXPL_ALLOW' | 'EXPL_DENY' ]
> );
> // ... or only like that if possible:
> $params['items'][0] = array(
> 'abc',
> 1
> );
> */
>
>
> Viele Grüße
> David
>
>
> ----- Ursprüngliche Nachricht -----
> Von: Manuel <news at teamrama.de>
> Gesendet: Mittwoch, 11. März 2009 14:51:21
> An: typo3-german at lists.netfielders.de
> CC:
> Betreff: [TYPO3-german] selectorbox in eigener extension manuell mit
> werten füllen
>> hallo,
>>
>> die betreff-zeile schildert eigentlich schon sehr exakt mein anliegen.
>> ich habe eine eigene extension erstellt, in der ein feld eine
>> selector-box ist. der haken zum pre-processing ist angehakt und ich
>> meine die datei gefunden zu haben die für die werte dieser selectorbox
>> verantwortlich ist. diese beinhaltet standardmässig u.a. nun folgende
>> zeilen:
>>
>> function main(&$params,&$pObj) {
>> /*
>> debug('Hello World!',1);
>> debug('$params:',1);
>> debug($params);
>> debug('$pObj:',1);
>> debug($pObj);
>> */
>>
>> // Adding an item!
>> $params['items'][] = array($pObj->sL('Added label by PHP
>> function|Tilfjet Dansk tekst med PHP funktion'), 999);
>>
>> // No return - the $params and $pObj variables are passed by
>> reference, so just change content in then and it is passed back
>> automatically...
>> }
>>
>> wie muss diese datei nun geändert werden, damit die selectorbox mit
>> entsprechenden werten befüllt wird?
>>
>> freu mich über jeden hinweis.
>> danke und gruss,
>> manuel
>> _______________________________________________
>> TYPO3-german mailing list
>> TYPO3-german at lists.netfielders.de
>> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-german
>>
> _______________________________________________
> TYPO3-german mailing list
> TYPO3-german at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-german
>
More information about the TYPO3-german
mailing list