phpBB

Development Wiki

Difference between revisions of "Build cfg template"

From phpBB Development Wiki

m (Categories)
Line 4: Line 4:
  
 
The main area to look at is the $display_vars['vars'] part of the array.
 
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()''
 
$display_vars['vars'][$config_key] => ''configuration_settings_array()''
Line 13: Line 9:
 
This last array is the key to the configuration settings.
 
This last array is the key to the configuration settings.
  
* $display_vars['vars'][$config_key]['lang'] label
+
* '''$display_vars['vars'][$config_key]['lang']'''
* $display_vars['vars'][$config_key]['validate'] expected data type (string,bool,int, etc...)
+
** Text label
* $display_vars['vars'][$config_key]['type'] type of field*
+
* '''$display_vars['vars'][$config_key]['validate']'''
* $display_vars['vars'][$config_key]['explain'] explain (true/false)
+
** Expected data type.  Uses ':' as a delimiter to setup extended settings
* $display_vars['vars'][$config_key]['method'] (see select below)
+
*** bool
* $display_vars['vars'][$config_key]['function'] (see select below)
+
*** int
* $display_vars['vars'][$config_key]['params'] (see select below)
+
*** lang
* $display_vars['vars'][$config_key]['append'] Any text that follows the form field
+
*** string
 
+
*** wpath
 
+
* '''$display_vars['vars'][$config_key]['type']'''
Type of field determines the type of forum field used (text,password,textfield,radio, select, custom, etc..)
+
** Type of field.  Uses ':' as a delimiter to setup extended settings
It uses ':' as the delimiter and thus you can set your field as follows:
+
*** dimension
 
+
*** custom
text:[size]:[maxlength]
+
*** password
password (see text)
+
*** radio
dimension (unsure... seems to be a width by height field)
+
*** select
textarea:[rows]:[columns]
+
*** string
radio (unsure)
+
*** text
select:
+
*** textarea
allows use of the additional settings method,function, params
+
*** false
* function: a PHP function you've created elsewhere to create the <OPTION name=foo>FOO_LABEL</OPTION> set.
+
* '''$display_vars['vars'][$config_key]['explain']'''
* method: (unknown)
+
** Show explain text (true/false)
* params: (unknown)
+
* '''$display_vars['vars'][$config_key]['method']'''
custom (see select)
+
** A function inside your acp class to create screen output, generally used for optional elements <OPTION name=foo>FOO_LABEL</OPTION>
 +
* '''$display_vars['vars'][$config_key]['function']'''
 +
** A function not inside your acp class to create screen output, generally used for optional elements <OPTION name=foo>FOO_LABEL</OPTION>
 +
* '''$display_vars['vars'][$config_key]['params']'''
 +
** Input parameters to use with the function or method
 +
* '''$display_vars['vars'][$config_key]['append']'''
 +
** Any text that follows the form field
  
 
[[Category:API]]
 
[[Category:API]]
 
[[Category:Concepts]]
 
[[Category:Concepts]]

Revision as of 23:31, 8 September 2008

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.

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

This last array is the key to the configuration settings.

  • $display_vars['vars'][$config_key]['lang']
    • Text label
  • $display_vars['vars'][$config_key]['validate']
    • Expected data type. Uses ':' as a delimiter to setup extended settings
      • bool
      • int
      • lang
      • string
      • wpath
  • $display_vars['vars'][$config_key]['type']
    • Type of field. Uses ':' as a delimiter to setup extended settings
      • dimension
      • custom
      • password
      • radio
      • select
      • string
      • text
      • textarea
      • false
  • $display_vars['vars'][$config_key]['explain']
    • Show explain text (true/false)
  • $display_vars['vars'][$config_key]['method']
    • A function inside your acp class to create screen output, generally used for optional elements <OPTION name=foo>FOO_LABEL</OPTION>
  • $display_vars['vars'][$config_key]['function']
    • A function not inside your acp class to create screen output, generally used for optional elements <OPTION name=foo>FOO_LABEL</OPTION>
  • $display_vars['vars'][$config_key]['params']
    • Input parameters to use with the function or method
  • $display_vars['vars'][$config_key]['append']
    • Any text that follows the form field