phpBB

Development Wiki

Build cfg template

From phpBB Development Wiki

Revision as of 23:31, 8 September 2008 by Technocrat (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.

$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