Configuration Options


This function defines the settings that can be configured on a per product basis for your module.

The name of this function must be yourmodulename_config.

The supported configuration field types include the following:

  • Text
  • Password
  • Yes/No Checkboxes
  • Dropdown Menus
  • Radio Buttons
  • Text Areas
Below are examples of the available parameters for each type of field. Provisioning modules support different types of options defined in this way.
<?php
    function yourmodule_config() {
    	$configarray = [
        	"name" => "Your Module Name",
        	"description" => "Your Module Description",
        	"version" => "1",//Your Module Version Number
        	"author" => "Author Name",
        	"author_url" => "https://your domain name.com/",
        	"language" => "english",
                "RequiresServer"=>true,//true or false
		"DefaultNonSSLPort"=>"",
		"DefaultSSLPort"=>"2087",
                "WebmailSSLPort"=>"2096",
                "WebmailNonSSLPort"=>"2095",
		"ServiceSingleSignOnLabel"=>"",
		"AdminSingleSignOnLabel"=>"",
		"PackagesLoader"=>"PackagesLoader",//Plans or Packages Loader function name
        	"configs" => [ // Configuration fields 
                 "username" => [
                                "Name" => "Username",
                                "Type" => "text",
                                "Size" => "100",//Input field width
                                "Description" => "The required username.",
                                "Default" => "Default Value Here",
                                 ],
                 "password" => [
                                "Name" => "Password",
                                "Type" => "password",
                                "Size" => "100",//Input field width
                                "Description" => "The required password.",
                                "Default" => "Default Value Here",
                               ],
                    "usessl" => [ //checkbox Button
                            "Name" => "Enable SSL?", 
                            "Type" =>  "yesno",  
                            "Description" => "A quick way to enable or disable this SSL", 
                            "Default" => "yes", 
                        ],
                    "disk" => [ //Dropdown Select box
                            "Name" => "Select Box", 
                            "Type" =>  "dropdown", 
                            "Options" => ['100MB'=>'100 MB','1GB'=>'1 GB','5GB'=>'5 GB'], 
                            "Description" => "Dropdown Description here", 
                            "Default" => "100MB", 
                        ],
                    "radiobox" => [ //Dropdown Select box
                            "Name" => "Radio button", 
                            "Type" =>  "radio", 
                            "Options" => ['100MB'=>'100 MB','1GB'=>'1 GB','5GB'=>'5 GB'], 
                            "Description" => "Radio buttons Description here", 
                            "Default" => "100MB", 
                        ],
                    ],
                ];
          }