| Re: Modversion Config Problem |
| by unlucky on 2006/5/11 16:20:12 Alright, I took out the references to adminIndex and adminMenu, and I uninstalled the module. I then reinstalled the module, and it shows up in preferences, and it has a default value. Thanks for all your help! |
| Re: Modversion Config Problem |
| by m0nty on 2006/5/11 16:02:29 should think so. altho i think menu is needed so you can get to preferences. have you tried uninstalling the module, and then reinstalling? the default value should be set then.. |
| Re: Modversion Config Problem |
| by unlucky on 2006/5/11 15:58:17 Semi-related question... is it possible to have a preferences page (System->Preferences->"Module Name" Preferences) without having an admin page? I dont have any admin pages, and as of now, I dont have anything that needs them. I just have a few preferences I want set. I added this: le="color: #000000"><?php // Admin things $modversion['hasAdmin'] = 1; $modversion['adminindex'] = "admin/index.php"; $modversion['adminmenu'] = "admin/menu.php"; but that didnt help with the preferences thing. I am thinking that since I have no admin section, the admin index and menu arent necessary. But can I still do preferences? |
| Re: Modversion Config Problem |
| by Dave_L on 2006/5/11 15:42:14 The stuff you posted looks ok. To get the default value to show up, you may have to uninstall/reinstall the module. The reason for that is that updating a module doesn't affect existing configuration settings. But there's no need to do that unless you just want to test that feature. I'm not sure why the link doesn't show up. That may also require reinstalling the module, if $modversion['config'] wasn't present when you originally installed it. You didn't say which version you're using. In XOOPS 2.2.x, if you want a link to the module's preferences on the module's admin index page, or in the module's admin popup menu, you have to add those yourself. But the links under Preferences on the top bar should get generated automatically. I don't remember exactly how that works in 2.0.x. ---- edit m0nty's reply looks better than mine, but I'll leave it here anyway.
|
| Re: Modversion Config Problem |
| by m0nty on 2006/5/11 15:35:20 have you included this in the xoops_version.php le="color: #000000"><?php // Admin things $modversion['hasAdmin'] = 1; $modversion['adminindex'] = "admin/index.php"; $modversion['adminmenu'] = "admin/menu.php"; hasadmin, will enable it. the others are the path to the admin index page and menu etc. also do you need the trailing slash? a better method of doing the modversion configs is to use an array aswell. le="color: #000000"><?php $modversion['config'][] = array( 'name' => 'headshot_dir', 'title' => '_MI_ERUD_HSPATH_TITLE', 'description' => '_MI_ERUD_HSPATH_DESC', 'formtype' => 'textbox', 'valuetype' => 'text', 'default' => 'dir/'); by using the array, you don't need to worry about the [1] numbers etc for positioning the field in the preferences, the fields will always be displayed in the order of each array. also note, once you have installed the module, and the values are set, updating the module again will not change the default value if it was changed in xoops_version.php, the default value is only set when the module is 1st installed.. once the config table has that data, it doesn't change it again unless you change it in preferences manually.. |