typo3 - doNotLinkIt in userFunc -


im building menu following typoscript

includelibs.myadminmenu = typo3conf/ext/my_admin/user_makemenu.php lib.usermenu = coa_int lib.usermenu.10 = hmenu lib.usermenu.10 {     special = directory     special.value = 184     modules = {$modules}     entrylevel = 1     1 = tmenu     1.itemarrayprocfunc = user_myadminmenu->makemenu     1 {         no = 1         no.allwrap = |         act = 1         act.allwrap = |     } } 

this works fine, inside makemenu method have following

foreach($menuarr $i => $menu) {     if (array_key_exists($menu['uid'], $this->paymentmodules)) {         if (! in_array($this->paymentmodules[$menu['uid']], $modules)) {             $menuarr[$i]['donotlinkit'] = 1;         }     } } 

this doesnt work - have tried with

unset($menuarr[$i]) 

this removed menu item, want dont link, there way this?

if not possible unlink menuitem, possible override url page?

a different approach be:

(untested)

includelibs.myadminmenu = typo3conf/ext/my_admin/user_makemenu.php lib.usermenu = coa_int lib.usermenu.10 = hmenu lib.usermenu.10 {     special = directory     special.value = 184     modules = {$modules}     entrylevel = 1     1 = tmenu     1 {         no = 1         no.allwrap = |         no.donotlinkit = 1         no.donotlinkit.if {           # userfunc needs return list of pids           # value = 10,12,24,44           value.postuserfunc = user_myadminmenu->makemenu           isinlist.field = uid         }         act = 1         act.allwrap = |         act.donotlinkit < .no.donotlinkit     } } 

imho easier read , maintain.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -