User Login    
 + Register
  • Main navigation
Vote for XOOPS!!!!
Login
Username:

Password:


Lost Password?

Register now!
Documentation
Who's Online
80 user(s) are online (8 user(s) are browsing XoopsWiki)

Members: 1
Guests: 79

credman, more...
[Main Page]

Dev:$xoopsModuleConfig

From XOOPS Project

Main Page | Recent changes | Edit this page | Page history | Switch to MediaWiki mode

Printable version | Disclaimers | Privacy policy
Category: Development

XoopsModuleConfig is a global variable that allows system-wide preferences to be stored and used within your module. The options are initially instantiated through inclusion in the xoops_version.php file in the module's directory. These are retrieved and become available when the mainfile.php is included. Defining

Within your xoops_version.php file, include this information for each configuration variable:

    $modversion['config'][1] = array(
        'name' => 'config_name',
        'title' => 'Title',
        'description' => 'Description',
        'formtype' => 'yesno',
        'valuetype' => 'int',
        'default' => 1);

or this way:

    $modversion['config'][1]['name'] = 'config_name';
    $modversion['config'][1]['title'] = 'Title';
    $modversion['config'][1]['description'] = 'Description';
    $modversion['config'][1]['formtype'] = 'yesno';
    $modversion['config'][1]['valuetype'] = 'int';
    $modversion['config'][1]['default'] = 1;

Potential values for 'formtype':

    'yesno'
    'select'
    'select_multi'
    'group'
    'group_multi'
    'textbox'
    'textarea'
    'user'
    'user_multi'
    'timezone'
    'language'

Potential values for 'valuetype':

    'int'
    'float'
    'text'
    'array'

All items with formtype 'multi_xxx' must have the valuetype 'array'.

Each set must be numbered differently. You can leave the number off if you use the first listing style.

Useful Functions

   * To retrieve the value of the configuration variable:
   $xoopsModuleConfig['config_name']
   * Still need to figure out how to change the value and update it in the database.

Note: concerning performance issue, only necessary configs should be registered to $xoopsConfig.

Retrieved from "http://www.xoops.org/modules/mediawiki/index.php/Dev:%24xoopsModuleConfig"

This page has been accessed 514 times. This page was last modified 16:59, 15 December 2007. Content is available under XOOPS Project.


Local Support Sites
Powered by
XOOPS Code hosted on SourceForge

Powered by PHP



Powered by MySQL

Powered by Smarty

OSI certified

All content on this site is subject to the Creative Commons License
Developers for Hire