phpBB

Development Wiki

Build cfg template

From phpBB Development Wiki

Revision as of 00:35, 20 July 2008 by Pyramide (Talk | contribs)

Function: build_cfg_template();

This function is used in the ACP to build configuration pages and cuts down on all the INPUT fields and allows you to create a simple array of all the fields you need to set, along with limits, validation, etc...

The main area to look at is the $display_vars['vars'] part of the array.


Note: I've tried to interpret what the code does as much as possible but obviously I've only managed to figure out SOME of the workings.. Please update


$display_vars['vars'][$config_key] => configuration_settings_array()

This last array is the key to the configuration settings.

  • $display_vars['vars'][$config_key]['lang'] label
  • $display_vars['vars'][$config_key]['validate'] expected data type (string,bool,int, etc...)
  • $display_vars['vars'][$config_key]['type'] type of field*
  • $display_vars['vars'][$config_key]['explain'] explain (true/false)
  • $display_vars['vars'][$config_key]['method'] (see select below)
  • $display_vars['vars'][$config_key]['function'] (see select below)
  • $display_vars['vars'][$config_key]['params'] (see select below)
  • $display_vars['vars'][$config_key]['append'] Any text that follows the form field


Type of field determines the type of forum field used (text,password,textfield,radio, select, custom, etc..) It uses ':' as the delimiter and thus you can set your field as follows:

text:[size]:[maxlength]
password (see text)
dimension (unsure... seems to be a width by height field)
textarea:[rows]:[columns]
radio (unsure)
select:
allows use of the additional settings method,function, params
* function: a PHP function you've created elsewhere to create the <OPTION name=foo>FOO_LABEL</OPTION> set.
* method: (unknown)
* params: (unknown)
custom (see select)