Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test functions

config_remove_user_preferences()

Description

Remove user preferences by resetting to system preferences. Used to display system config or user group config
without the current user's preferences changing the values.

Parameters

ColumnTypeDefaultDescription
$page_def: array
$page_def array Array containing page definition, from functions config_add_ ...

Location

include/config_functions.php lines 2259 to 2271

Definition

 
function config_remove_user_preferences(array $page_def): void {
    global 
$system_wide_config_options;

    
// loop through every field about to be created
    
foreach ($page_def as $page_item) {
        if (
$page_item[0] !== 'html'
                
&& isset($system_wide_config_options[$page_item[1]]) 
                && 
$GLOBALS[$page_item[1]] !== $system_wide_config_options[$page_item[1]]) {
            
// Set the global variable back to the system value if it is different
            
$GLOBALS[$page_item[1]] = $system_wide_config_options[$page_item[1]];
        }
    }
}

This article was last updated 14th April 2025 21:35 Europe/London time based on the source file dated 10th April 2025 10:35 Europe/London time.