GetConfigArray
%Plugin_Name%_GetConfigArray
Purpose
With this function you can create the set of parameters that needs to be defined during the plugin configuration, for example, contact data or account credentials. The values of these parameters will be passed to each function within the plugin (except for utilities).
Input Parameters
None
Return Parameters
An associative array of associative arrays, each of which represents an attribute that will be requested during plug-in configuration. The following keys are allowed for attributes:
'type' => 'type'
: a type of an attribute. Possible values are: 'text
', 'textarea
', 'password
', 'dropdown
', 'radio
', 'tickbox
', 'yesno
'.'title' => 'title'
(optional): a user-friendly name of an attribute. It will be displayed on the configuration form.'description' => 'description'
(optional): the description of an attribute. It will be displayed on the configuration form.'defaultValue' => 'defval'
(optional): the default value of an attribute.'required' => 'required'
(optional): this key defines whether the attribute is mandatory. '1
' – mandatory, '0
' – optional.'options' => 'value1,value2, ... , valueX'
(optional, except for 'dropdown' and 'radio' attributes): a set of possible values for 'dropdown
' or 'radio
' attributes.
Note: The drop-down control cannot contain commas in the names of available options list.
Mandatory
Yes
Example
function Example_GetConfigArray() { return array( "Username" => array("type" => "text", "size" => "20", "description" => "Enter your username here"), "Key" => array("type" => "password", "size" => "20", "description" => "Enter your API key here"), "Test Mode" => array("type" => "yesno"), "Debug Mode" => array("type" => "yesno"), ); }