Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

process_config_options()

Description

Process configuration options from database
either system wide or user specific by setting
the global variable

Parameters

ColumnTypeDefaultDescription
$user_id int null

Return

void

Location

include/config_functions.php lines 362 to 389

Definition

 
function process_config_options($user_id null)
    {
    global 
$user_preferences;

    
// If the user doesn't have the ability to set his/her own preferences, then don't load it either
    
if(!is_null($user_id) && !$user_preferences)
        {
        return;
        }

    
$config_options = array();

    if(
get_config_options($user_id$config_options))
        {
        foreach(
$config_options as $config_option)
            {
            
$param_value $config_option['value'];

            
// Prepare the value since everything is stored as a string
            
if (is_numeric($param_value) && '' !== $param_value)
                {
                
$param_value = (int) $param_value;
                }

            
$GLOBALS[$config_option['parameter']] = $param_value;
            }
        }
    }

This article was last updated 27th April 2024 19:35 Europe/London time based on the source file dated 18th April 2024 17:15 Europe/London time.