[TYPO3] menuFunc
Bas van der Togt
bas.vander.togt at efocus.nl
Fri Jul 6 16:09:49 CEST 2007
Thank you for your answer Peter!
I'm not an php expert.
Can you maybe give me an example?
<?php
class user_menuFunc2 {
function makeMenuArray($content,$conf) {
$menuArr = array();
$lConf = $conf["userFunc."];
$res = $this->cObj->exec_getQuery($lConf["table"],$lConf["select."]);
if ($error = $GLOBALS['TYPO3_DB']->sql_error()) {
$GLOBALS['TT']->setTSlogMessage($error,3);
}
else {
$GLOBALS['TT']->setTSlogMessage('NUMROWS:
'.$GLOBALS['TYPO3_DB']->sql_num_rows($res));
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$menuArr[] = $row;
}
}
return $menuArr;
}
}
?>
Peter Klein wrote:
> Hi Bas. If you want to set the ACT state for one of the menu items, you can
> do it like this in your userFunc.
> But you have to specify which menuitem ($k) it is you want active yourself.
>
> $menuArr[$k]["ITEM_STATE"]="ACT";
>
More information about the TYPO3-english
mailing list