phpBB

Development Wiki

Difference between revisions of "Build cfg template"

From phpBB Development Wiki

Line 1: Line 1:
 
Function: '''build_cfg_template();'''
 
Function: '''build_cfg_template();'''
  
 +
==Description==
 
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...
 
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...
  
Line 8: Line 9:
  
 
This last array is the key to the configuration settings.
 
This last array is the key to the configuration settings.
 +
==Parameters==
 +
{|border="1" cellspacing="0" cellpadding="3"
 +
! Key
 +
! Does
 +
! Valid Type
 +
|-
 +
| '''lang'''
 +
| Text label
 +
|
 +
|-
 +
| '''validate'''
 +
| Expected data type
 +
|
 +
* bool
 +
* int
 +
* lang
 +
* string
 +
* wpath
 +
|-
 +
| '''type'''
 +
| Type of field
 +
|
 +
* dimension
 +
* custom
 +
* password
 +
* radio
 +
* select
 +
* string
 +
* text
 +
* textarea
 +
* false
 +
|-
 +
| '''explain'''
 +
| Show explain text
 +
|
 +
* false
 +
* true
 +
|-
 +
| '''method'''
 +
| A function inside your acp class to create screen output, generally used for optional elements <OPTION name=foo>FOO_LABEL</OPTION>
 +
|
 +
|-
 +
| '''function'''
 +
| A function not inside your acp class to create screen output, generally used for optional elements <OPTION name=foo>FOO_LABEL</OPTION>
 +
|
 +
|-
 +
| '''params'''
 +
| Input parameters to use with the function or method
 +
|
 +
|-
 +
| '''append'''
 +
| Any text that follows the form field
 +
|
 +
|}
  
* '''$display_vars['vars'][$config_key]['lang']'''
+
==Examples==
** 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
+
  
 
[[Category:API]]
 
[[Category:API]]
 
[[Category:Concepts]]
 
[[Category:Concepts]]

Revision as of 23:40, 8 September 2008

Function: build_cfg_template();

Description

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.

Parameters

Key Does Valid Type
lang Text label
validate Expected data type
  • bool
  • int
  • lang
  • string
  • wpath
type Type of field
  • dimension
  • custom
  • password
  • radio
  • select
  • string
  • text
  • textarea
  • false
explain Show explain text
  • false
  • true
method A function inside your acp class to create screen output, generally used for optional elements <OPTION name=foo>FOO_LABEL</OPTION>
function A function not inside your acp class to create screen output, generally used for optional elements <OPTION name=foo>FOO_LABEL</OPTION>
params Input parameters to use with the function or method
append Any text that follows the form field

Examples