Get XOOPS XOOPSXOOPS FAQFAQ ForumsForums NewsNews ThemesThemes ModulesModules

Search

Donate to XOOPS!

Please select an amount to donate


Do you want your username revealed with your donation?
Yes - List me as a Generous Donor
No - List my donation as from an Anonymous Donor


Local Support

Advertisement

XOOPS Code hosted on SourceForge

Cumulus Tag Cloud

admin Arabic banner block Christmas comments cumulus DayDawn dhsoft e-Commerce E-Learning Git Google GUI hacks instant-zero jQuery module mygalleries news Nordic Olédrion oxygen PageRank PHP rmcommon security SEO simple-XOOPS Smarty sport tag Theme tutorial wiki xoops XoopsEngine ZendFramework

Top Tags

module (1) rmcommon (1)

New Users

Registering user

# 133032

lsfx2000

Welcome to XOOPS!
[Main Page]

Dev:$xoopsModuleConfig

From XOOPS Web Application System

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'
    'hidden'

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://xoops.org/modules/mediawiki/index.php/Dev:%24xoopsModuleConfig"

This page has been accessed 3,569 times. This page was last modified 08:19, 17 October 2008. Content is available under XOOPS Web Application System.