PDA

View Full Version : configing a module through admin menus


kentu
23.07.2004, 07:13
I'm new, and so this is probably a ridiculous question.

I've read some component and module tutorials, and I've created a module. I'd like to be able to configure the module from a menu in admin.

So in my xml install file I specify:

<administration>
<menu>my_mod</menu>
<submenu>
<menu act="show">Show It!</menu>
</submenu>
<files>
<filename>admin.my_mod.php</filename>
<filename>admin.my_mod.html.php</filename>
</files>
</administration>

and I don't get a menu. in fact, I can't find anyway to have a module edited from the admin. except for installing a component and having both component and module read the same tables. but that seems to much of a work around.

thanks!

side note: the tabs in my code are stripped. wierd.

Raydian
23.07.2004, 10:51
You say you've created a module and want to configure it through the admin area. The best way to go about doing this is to send the module mammeters through the admin Modules menu. You would need to enable this feature by using mosParseParams( $module->params ); function, then programming whatever changes the module would take/make with that mammeter.

The way you're going about now would eventually get you an admin menu, but then you'd have write more routines in the component to control the modules output.

You also mentioned that you have a DB table to work on. Create the module and write some insert statements in SQL to install the DB table; using phpMyAdmin or something to do the insert.

Just some ideas...

kentu
23.07.2004, 18:57
ok, i've never run accross the mammeters thing before. do you know of a simple module that uses it so i could see how it's done? i'm assuming there's no tutorial or docs, that would be too easy. :-)

from what i hear you saying then, the only way to add menu's and html user friendly config stuff in the back is by installing a component. is that right?

thanks for the help!

Raydian
23.07.2004, 19:15
ok, i've never run accross the mammeters thing before. do you know of a simple module that uses it so i could see how it's done? i'm assuming there's no tutorial or docs, that would be too easy. :-)

Mammeters:
http://mambo.webraydian.com/content/view/95/

Basic Module Tutorial??:
http://www.mambohut.com/content/view/156/58/

from what i hear you saying then, the only way to add menu's and html user friendly config stuff in the back is by installing a component. is that right?

That's right. Also, you'll need a few more files to get that component to show a menu item.

install.my_mod.php
uninstall.my_mod.php
toolbar.my_mod.php
toolbar.my_mod.html.php

<menu act="show">Show It!</menu>

Must use act as the parameter/mammeter
<menu act="act">Show It!</menu>

NOTE: the install files require there be install and uninstall functions within.
see other install/uninstall files for examples


Hope that helps!