[Typo3-dev] example does not work

Michael Plank m.plank at digitop.de
Tue Jul 13 09:59:00 CEST 2004


Hallo Experts,
In this example:
http://typo3.org/documentation/document-library/doc_core_tsref/HMENU-1/?encryptionKey=&cHash=5400c1c06a
that I tried to adapt to my needs, I have a problem concerning the menu.
It 's content is being fed by the different categories that a backend user
defines. One category is one menu point.
Usually it is possible to set up the URL with _OVERRIDE_HREF Unfortunately
the example of the "userfunction" does not work. Typo only transfers
"index.php?id=" as link and not the parameters that I have defined in the
PHP fuction.

Here my Example:

PHP-File:
require_once(PATH_tslib."class.tslib_pibase.php");
class user_akunfeuser_class extends tslib_pibase{
var $cObj;
function getItems($sql){
$res = mysql(TYPO3_db,$sql);
$out = array();
while( $row = mysql_fetch_assoc($res) ){
$out[]=$row;
}
return $out;
}

function makeMenuArray($content,$conf) {
$GLOBALS["TSFE"]->set_no_cache();
$sql = "SELECT * FROM tx_akunfeuser_category WHERE pid='22'
".$this->cObj->enableFields('tx_akunfeuser_category');
$rows = $this->getItems($sql);
while(list($c,$row)=each($rows) ){
$menuItemsArray[] = array('title' => $row['category'],'_OVERRIDE_HREF' =>
'http://www.meineURL.de');
}
return $menuItemsArray;
}
}
Setup-Feld:
includeLibs.akunfeuser_library = fileadmin/scripts/user_akunfeuser_class.php
page.10{
marks.MEN_RIGHT = HMENU
marks.MEN_RIGHT.special = userfunction
marks.MEN_RIGHT.special.userFunc = user_akunfeuser_class->makeMenuArray
marks.MEN_RIGHT.1 = TMENU
marks.MEN_RIGHT.1.NO{
10 = TEXT
10.field = title
}
}

Why doesn't it work?
THX,
Michael






More information about the TYPO3-dev mailing list