From: Steven L. <st...@tu...> - 2004-11-02 18:21:15
|
On Sat, 2004-10-30 at 04:08, Ton Oosterhoff wrote: > I am almost finished extending the Menuman module with category > capability. >=20 > The last obstacle is the following. >=20 > I want to show a menu if the menu=E2=80=99s category equals the categor= y of > one of the other modules that are displayed. So I have to detect which > categories are currently displayed. >=20 > The problem is how to code this in PHP. >=20 > I thought the following method was the shortest: >=20 > - loop through mod_fatcat_elements; >=20 > - extract module_id, module_title and cat_id; >=20 > - check if module title is displayed with =E2=80=9C if > (isset($_REQUEST['module']) && $_REQUEST['module']=3D=3Dmodule_title) =E2= =80=9C >=20 > So far so good, now I know if a module is displayed, but how can I > check that it is displayed with module_id? >=20 > For Pagemaster this would be with $_REQUEST[=E2=80=98PAGE_id=E2=80=99],= but is there > some generic expression I can use ? >=20 > Something like =E2=80=A6. && $_REQUEST[=E2=80=98module_id=E2=80=99]=3D=3D= module_id? >=20 > Some suggestions? >=20 > Or maybe an other approach?=20 I would suggest using the function call: $_SESSION['OBJ_fatcat']->getModulesCategories($module_title,$module_id); Then check to see if what it returns matches the category of your menu. Right now there is now what to use one request var for any module id because it differs between modules. announce is $_REQUEST['ANN_id'] pagemaster is $_REQUEST['PAGE_id'] faq is $_REQUEST['FAQ_id'] etc... But a proposal I am about to post across the list would change that so most modules will use $_REQUEST['id'], we'll just have to see if folks agree with it. --=20 Steven Levin Computer Systems Admin I Electronic Student Services Appalachian State University http://phpwebsite.appstate.edu |