[TYPO3-dev] Alter foreign_table_where to select items from parent page
Brian Bendtsen
nightowl at galnet.dk
Tue Apr 24 14:05:14 CEST 2007
Mathias Schreiber [TYPO3] skrev:
> Brian Bendtsen schrieb:
>> I haven't been able to find any documentation on it, how does it work?
>
> That's interesting since it's part of the TCA definition manual.
>
> Quote:
> =====================================================
> PHP function which is called to fill / manipulate the array with elements.
>
> The function/method will have an array of parameters passed to it (where
> the item-array is passed by reference in the key 'items'). By modifying
> the array of items, you alter the list of items.
> =====================================================
>
> So include a PHP class in you ext_localconf.php and call a method.
>
> Mathias
And I thought there might be a simple solution. I have to say, im new at
TYPO3 extension programming and php. I have only made changes to the
pi1/class.tx_ebbolig_pi1.php.
If I understand this correctly, I have to create a file:
class.tx_myplugin_something.php and create a method/function for filling
the select box by returning a recordset?
Im not sure how to add the class to ext_localconf.php? Tried looking in
this file in some other extension, that didn't help much.
So far my class looks like this:
class tx_ebbolig_afdeling {
function main() {
$query = "SELECT * FROM tx_ebbolig_afdeling INNER JOIN pages ON
tx_ebbolig_afdeling.pid = pages.pid WHERE pages.uid = '###CURRENT_PID###'";
$res = mysql(TYPO3_db, $query);
$row = mysql_fetch_array($res);
return $row;
}
}
Am I totally lost or?
/BB
More information about the TYPO3-dev
mailing list