Geeklog
[ class tree: Geeklog ] [ index: Geeklog ] [ all elements ]

Class: config

Source Location: /system/classes/config.class.php

Class Overview




Variables

Methods



Class Details

[line 34]


[ Top ]


Class Variables

$changedArray = array()

[line 122]

Changed configuration array (such as mail settings) that pass the validation.

If validationErrors is not empty, changed values should be saved for later submission




Tags:

access:  public

Type:   array


[ Top ]

$config_array =

[line 48]

Array of configurations


Type:   array


[ Top ]

$conf_ft_arr =

[line 62]

Array of configuration features (security rights)


Type:   array


[ Top ]

$conf_tab_arr =

[line 55]

Array of configuration tabs, used by autocomplete


Type:   array


[ Top ]

$conf_type =

[line 69]

Array of configuration types


Type:   array


[ Top ]

$dbconfig_file =

[line 41]

Path to db-config.php file


Type:   string


[ Top ]

$flag_version_2 =

[line 76]

Whether support new theme format for the later Geeklog 2.0 or not


Type:   boolean


[ Top ]

$tmpValues = array()

[line 112]

Changed values that pass the validation.

If validationErrors is not empty, changed values should be saved for later submission




Tags:

access:  public

Type:   array


[ Top ]

$validate = array()

[line 86]

List of validation rules. Append entries for validation as ('field_name' => '/^perl_compat_regexp$/') that have to match with preg_match(). Use these rules with config::_validates()



Tags:

access:  public

Type:   array


[ Top ]

$validationErrors = array()

[line 94]

List of validation errors.



Tags:

access:  public

Type:   array


[ Top ]

$validationErrorValues = array()

[line 102]

Values that failed validation



Tags:

access:  public

Type:   array


[ Top ]



Class Methods


static method get_instance [line 147]

static config &get_instance( string 0)

This method will return an instance of the config class. If an instance with the given group/reference name does not exist, then it will create a new one. This function insures that there is only one instance for a given group name.



Tags:

return:  The newly created or referenced config object
access:  public


Parameters:

string   0   group_name This is simply the group name that this config object will control - for the main gl settings this is 'Core'

[ Top ]

method add [line 500]

void add( string $param_name, mixed $default_value, string $type, string $subgroup, [string $fieldset = null], [array $selection_array = null], [int $sort = 0], [boolean $set = true], [string $group = 'Core'], [string $tab = null])

Adds a configuration variable to the config object



Parameters:

string   $param_name   name of the parameter to add
mixed   $default_value   the default value of the parameter (also will be the initial value)
string   $type   the type of the configuration variable If the configuration variable is an array, prefix this string with '@' if the administrator should NOT be able to add or remove keys '*' if the administrator should be able to add named keys '%' if the administrator should be able to add numbered keys These symbols can be repeated like such: @@text if the configuration variable is an array of arrays of text. The base variable types are: 'text' textbox displayed string value stored 'select' selectbox displayed string value stored 'hidden' no display string value stored
string   $subgroup   subgroup of the variable (the second row of tabs on the user interface)
string   $fieldset   the fieldset to display the variable under
array   $selection_array   possible selections for the 'select' type this MUST be passed if you use the 'select' type
int   $sort   sort rank on the user interface (ascending)
boolean   $set   whether or not this parameter is set to config_array property
string   $group   group of the variable
string   $tab   the tab to display the variable under

[ Top ]

method del [line 556]

void del( string $param_name, string $group)

Permanently deletes a parameter



Parameters:

string   $param_name   This is the name of the parameter to delete
string   $group   Configuraton group name

[ Top ]

method get_config [line 304]

bool|array &get_config( string $group)

Get configurations for particular group.



Tags:

return:  Array of configurations for specified group or returns false if group doesn't exist


Parameters:

string   $group   Group name

[ Top ]

method get_ui [line 774]

void get_ui( string $grp, [ $sg = '0'], [mixed $change_result = null])

This function is responsible for creating the configuration GUI



Parameters:

mixed   $change_result   This is an array of what changes were made to the configuration - if it is passed, it will display the "Changes" message box.
string   $grp   sg This is the subgroup name to load the gui for. If nothing is passed, it will display the first (alpha) subgroup.
   $sg  

[ Top ]

method group_exists [line 329]

bool group_exists( string $group)

Check if group exists or not



Tags:

return:  True if group exists


Parameters:

string   $group   Group name

[ Top ]

method initConfig [line 199]

array(string &initConfig( )

This method initializes the configuration array (i.e. $_CONF) and will return a reference to the newly created array. The class keeps track of this reference, and the set function will mutate it.



Tags:

return:  => mixed) This is a reference to the config array


[ Top ]

method load_baseconfig [line 178]

void load_baseconfig( )

This method reads the secure configuration file and loads

lib-database.php. This needs to be called in the 'Core' group before &init_config() can be used. It only needs to be called once




[ Top ]

method restore_param [line 390]

bool restore_param( string $name, string $group, [int $sg = null], [string $tab_id = null])

This method restores the default value (specified in the default_value field) of a configuration variable.



Tags:

return:  True on succeed


Parameters:

string   $name   Configuration variable's name
string   $group   Group name of configuration variable
int   $sg   Subgroup of configuration variable
string   $tab_id   Tab id

[ Top ]

method set [line 343]

void set( string $name, mixed $value, [ $group = 'Core'])

This method sets a configuration variable to a value in the database and in the current array. If the variable does not already exist, nothing will happen.



Parameters:

string   $name   Name of the config parameter to set
mixed   $value   The value to set the config parameter to
   $group  

[ Top ]

method set_configfile [line 167]

void set_configfile( string $sf)

This method sets the secure configuration file (database related

settings) for the configuration class to read. This should only need to be called for the 'Core' group. It also must be called before load_baseconfig()




Parameters:

string   $sf   sf The filename and path of the secure db settings

[ Top ]

method set_default [line 367]

void set_default( string $name, mixed $value, [string $group = 'Core'])

This method sets the default of a configuration variable to a value in the database but not in the current array.

If the variable does not already exist, nothing will happen.




Parameters:

string   $name   Name of the config parameter to set
mixed   $value   The value to set the config parameter to
string   $group   Config group name ('Core' or plugin name)

[ Top ]

method unset_param [line 437]

bool unset_param( string $name, string $group, [int $sg = null], [string $tab_id = ''])

This method sets a configuration variable's value to 'unset'.



Tags:

return:  True on succeed


Parameters:

string   $name   Configuration variable's name
string   $group   Group name of configuration variable
int   $sg   Subgroup of configuration variable
string   $tab_id   Tab id

[ Top ]

method updateConfig [line 1535]

array(string=>boolean) updateConfig( array(string=>mixed) $change_array, string $group)

This function takes $_POST input and evaluates it



Tags:

return:  this is the change_array


Parameters:

array(string=>mixed)   $change_array   this is the $_POST array
string   $group   Group name

[ Top ]

method _DB_escapedQuery [line 2108]

void _DB_escapedQuery( $sql)

Helper function: Fix escaped SQL requests for MS SQL, if necessary



Parameters:

   $sql  

[ Top ]

method _extract_permissible_conf [line 1652]

void _extract_permissible_conf( &$change_array, string $group, [int $sg_id = null], array(string=>mixed) $change_array)

Extracts allowed conf from posted data. Used by updateConfig



Parameters:

array(string=>mixed)   $change_array   this is the $_POST array
string   $group   Configuration group
int   $sg_id   Subgroup id
   &$change_array  

[ Top ]

method _get_config_features [line 2209]

array _get_config_features( )

Get features that has ft_name like 'config%'.

Used by lib-common to declare $_CONF_FT




Tags:

return:  features that has ft_name like 'config%'


[ Top ]

method _get_extended [line 571]

array(string _get_extended( string $subgroup, $group)

Gets extended (GUI related) information from the database



Tags:

return:  => string => array(string => mixed)) Array keys are fieldset => parameter named => information array


Parameters:

string   $subgroup   subgroup filters by subgroup
   $group  

[ Top ]

method _get_fs_name [line 753]

void _get_fs_name( string $tab_id, int $fs_id)

Get fieldset name based on sepecified tab id.



Parameters:

string   $tab_id   tab id
int   $fs_id   fieldset id

[ Top ]

method _get_groups [line 675]

array _get_groups( )

Get configuration groups for current logged user.

Plugins being disabled are ignored. Configurations that user doesn't access to are ignored.




Tags:

return:  Array of configuraton groups.


[ Top ]

method _get_sgroups [line 709]

array _get_sgroups( string $group)

Get configuration subgroups for particular configuration group.



Tags:

return:  Array of subgroups that belong to configuration $group


Parameters:

string   $group   Configuration group name

[ Top ]

method _get_tab_name [line 738]

void _get_tab_name( string $group, int $tab_id)

Get tab name based on sepecified group name and tab id.



Parameters:

string   $group   Group name
int   $tab_id   tab id

[ Top ]

method _post_configuration [line 648]

void _post_configuration( )

Changes any config settings that depend on other configuration settings.

Called by config::initConfig and config::updateConfig




[ Top ]

method _post_initconfig [line 629]

void _post_initconfig( )

Changes any config settings that depend on other configuration settings.

Called by config::initConfig




[ Top ]

method _sanitize_string [line 1727]

sanitized _sanitize_string( string $config, string $group, $input_val)

Returns sanitized string.



Tags:

return:  string
access:  public


Parameters:

string   $config   Configuration variable
string   $group   Configuration group
   $input_val  

[ Top ]

method _set_ConfigHelp [line 2128]

void _set_ConfigHelp( &$t, string $group, string $option, string $t)

Helper function: Set the URL to the help section for a config option



Parameters:

string   $t   Template
string   $group   'Core' or plugin name
string   $option   name of the config option
   &$t  

[ Top ]

method _UI_autocomplete_data [line 2017]

string _UI_autocomplete_data( )

Build JSON for autocomplete



Tags:

return:  JS variable in string


[ Top ]

method _UI_configmanager_menu [line 1914]

void _UI_configmanager_menu( $conf_group $conf_group, [$sg $sg = 0])

Builds configuration menu



Parameters:

$conf_group   $conf_group   Configuration group
$sg   $sg   Configuration subgroup

[ Top ]

method _UI_get_change_block [line 1016]

string _UI_get_change_block( array $changes, [string $group = null], [int $sg = null])

Get messages to display when changes were made to the configuration.



Tags:

return:  string of HTML to be displayed on message box


Parameters:

array   $changes   Array of changes. Keys are configuration paramater name.
string   $group   Configuration group
int   $sg   Configuration subgroup

[ Top ]

method _UI_get_conf_element [line 1161]

string _UI_get_conf_element( string $group, string $name, string $display_name, string $type, string $val, [mixed $selectionArray = null], [ $deletable = false], [bool $allow_reset = false], bool $deleteable)

Get a parsed config element based on group $group, name $name, type $type, value to be shown $val and label $display_name to be shown on the left based on language.



Parameters:

string   $group   Configuration group.
string   $name   Configuration name on table.
string   $display_name   Configuration display name based on language.
string   $type   Configuration type such as select, text, textarea, @select, etc.
string   $val   Value of configuration
mixed   $selectionArray   Array of option of select element
bool   $deleteable   If configuration is deleteable
bool   $allow_reset   Allow set and unset of configuration
   $deletable  

[ Top ]

method _UI_get_conf_element_2 [line 1344]

string _UI_get_conf_element_2( string $group, string $name, string $display_name, string $type, string $val, [mixed $selectionArray = null], [ $deletable = false], [bool $allow_reset = false], bool $deleteable)

Get a parsed config element based on group $group, name $name, type $type, value to be shown $val and label $display_name to be shown on the left based on language.



Parameters:

string   $group   Configuration group.
string   $name   Configuration name on table.
string   $display_name   Configuration display name based on language.
string   $type   Configuration type such as select, text, textarea, @select, etc.
string   $val   Value of configuration
mixed   $selectionArray   Array of option of select element
bool   $deleteable   If configuration is deleteable
bool   $allow_reset   Allow set and unset of configuration
   $deletable  

[ Top ]

method _UI_get_fs [line 1109]

void _UI_get_fs( string $group, string $contents, int $fs_id, &$t, object $t)

Set fieldset from configuration where fieldset = $fs_id under the group $group with content $contents to template $t



Parameters:

string   $group  
string   $contents   Contents
int   $fs_id  
object   $t   Template object
   &$t  

[ Top ]

method _UI_get_tab [line 1068]

string _UI_get_tab( string $group, string $contents, int $tab_id, &$t, object $t)

Set tab from configuration where tab = $tab_id under the group $group with content $contents to template $t



Tags:

return:  tab name to display based on current language


Parameters:

string   $group   Configuration group
string   $contents   Contents
int   $tab_id   tab id
object   $t   Template object
   &$t  

[ Top ]

method _UI_js_image_spinner [line 2098]

string _UI_js_image_spinner( )

Set image spinner path in javascript variable



Tags:

return:  JS variable in string


[ Top ]

method _UI_perm_denied [line 1135]

string _UI_perm_denied( )

Returns a page for permission denied



Tags:

return:  HTML for permission denied page


[ Top ]

method _validates [line 1820]

boolean _validates( string $config, string $group, &$value, [ &$relatedValue = null], mixed $value, mixed $relatedValue)

Returns true if configuration field pass given validation rule.



Tags:

return:  True if there are no errors
access:  public


Parameters:

string   $config   Configuration variable
string   $group   Configuration group
mixed   $value   Submitted value
mixed   $relatedValue   value that related such as mail settings
   &$value  
   &$relatedValue  

[ Top ]

method _validate_input [line 1676]

mixed _validate_input( mixed $config, $group, &$input_val)

Input validation



Parameters:

mixed   $config  
   $group  
   &$input_val  

[ Top ]

method _validate_numeric [line 1783]

boolean _validate_numeric( string $config, string $group)

Returns true if configuration field should be numeric.



Tags:

return:  True if numeric
access:  public


Parameters:

string   $config   Configuration variable
string   $group   Configuration group

[ Top ]


Documentation generated on Sun, 02 Oct 2016 07:46:35 +0000 by phpDocumentor 1.4.3