CMS Made Simple API

class.cms_userprefs.php

Classes and utilities for working with user preferences.

Tags
license

GPL

Table of Contents

Classes

cms_userprefs
A static class for preferences stored with admin user accounts

Functions

get_preference()  : mixed
Retrieve the value of the named preference for the given userid.
set_preference()  : mixed
Sets the given perference for the given userid with the given value.

Functions

get_preference()

Retrieve the value of the named preference for the given userid.

get_preference(int $userid, string $prefname[, mixed $default = '' ]) : mixed
Parameters
$userid : int

The user id

$prefname : string

The preference name

$default : mixed = ''

The default value if the preference is not set for the given user id.

Tags
since
0.3
see
cms_siteprefs::get_for_user

set_preference()

Sets the given perference for the given userid with the given value.

set_preference(int $userid, string $prefname, mixed $value) : mixed
Parameters
$userid : int

The user id

$prefname : string

The preference name

$value : mixed

The preference value (will be stored as a string)

Tags
since
0.3
see
cms_siteprefs::set_for_user

        
On this page

Search results