class UserPreferences

Functions for displaying user preferences pages

Properties

Template $template

Methods

__construct()

Constructor

void
pageInit(ConfigFile $cf)

Common initialization for user preferences modification pages

array
load()

Loads user preferences

true|Message
save(array $config_array)

Saves user preferences

array
apply(array $config_data)

Returns a user preferences array filtered by $cfg['UserprefsDisallow'] (blacklist) and keys from user preferences form (whitelist)

true|Message
persistOption(string $path, mixed $value, mixed $default_value)

Updates one user preferences option (loads and saves to database).

void
redirect(string $file_name, array|null $params = null, string $hash = null)

Redirects after saving new user preferences

string
autoloadGetHeader()

Shows form which allows to quickly load settings stored in browser's local storage

Details

at line 40
__construct()

Constructor

at line 53
void pageInit(ConfigFile $cf)

Common initialization for user preferences modification pages

Parameters

ConfigFile $cf Config file instance

Return Value

void

at line 77
array load()

Loads user preferences

Returns an array: * config_data - path => value pairs * mtime - last modification time * type - 'db' (config read from pmadb) or 'session' (read from user session)

Return Value

array

at line 118
true|Message save(array $config_array)

Saves user preferences

Parameters

array $config_array configuration array

Return Value

true|Message

at line 191
array apply(array $config_data)

Returns a user preferences array filtered by $cfg['UserprefsDisallow'] (blacklist) and keys from user preferences form (whitelist)

Parameters

array $config_data path => value pairs

Return Value

array

at line 222
true|Message persistOption(string $path, mixed $value, mixed $default_value)

Updates one user preferences option (loads and saves to database).

No validation is done!

Parameters

string $path configuration
mixed $value value
mixed $default_value default value

Return Value

true|Message

at line 246
void redirect(string $file_name, array|null $params = null, string $hash = null)

Redirects after saving new user preferences

Parameters

string $file_name Filename
array|null $params URL parameters
string $hash Hash value

Return Value

void

at line 269
string autoloadGetHeader()

Shows form which allows to quickly load settings stored in browser's local storage

Return Value

string