UserPreferences
class UserPreferences (View source)
Functions for displaying user preferences pages
Methods
Loads user preferences
Saves user preferences
Returns a user preferences array filtered by $cfg['UserprefsDisallow'] (exclude list) and keys from user preferences form (allow list)
Updates one user preferences option (loads and saves to database).
Redirects after saving new user preferences
Shows form which allows to quickly load settings stored in browser's local storage
Details
__construct(DatabaseInterface $dbi, Relation $relation, Template $template)
No description
void
pageInit(ConfigFile $cf)
Common initialization for user preferences modification pages
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)
Message
save(array $configArray)
Saves user preferences
array
apply(array $configData)
Returns a user preferences array filtered by $cfg['UserprefsDisallow'] (exclude list) and keys from user preferences form (allow list)
Message
persistOption(string $path, mixed $value, mixed $defaultValue)
Updates one user preferences option (loads and saves to database).
No validation is done!
void
redirect(string $fileName, array|null $params = null, string|null $hash = null)
Redirects after saving new user preferences
string
autoloadGetHeader()
Shows form which allows to quickly load settings stored in browser's local storage