The Prefs:: class provides a common abstracted interface into the various preferences storage mediums. It also includes all of the functions for retrieving, storing, and checking preference values.
TODO: document the format of the $_prefs hash here
$_prefs[*pref name*] = array( 'value' => *Default value*, 'locked' => *boolean*, 'shared' => *boolean*, 'type' => 'checkbox' 'text' 'password' 'textarea' 'select' 'number' 'implicit' 'special' 'link' - There must be a field named either 'url' (internal application link) or 'xurl' (external application link) if this type is used. 'enum' 'enum' => TODO, 'desc' => _(*Description string*), 'help' => *Name of the entry in the XML help file* );
Copyright 1999-2009 The Horde Project (http://www.horde.org/)
See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
Located in /Prefs/Prefs.php (line 55)
Class | Description |
---|---|
![]() |
Preferences storage implementation using files in a directory |
![]() |
Preference storage implementation for an IMSP server. |
![]() |
Preferences storage implementation for a Kolab IMAP server |
![]() |
Preferences storage implementation for PHP's LDAP extention. |
![]() |
Preferences storage implementation for PHP's session implementation. |
![]() |
Preferences storage implementation for PHP's PEAR database abstraction layer. |
Array to cache in. Usually a reference to an array in $_SESSION, but could be overridden by a subclass for testing or other users.
Boolean indicating whether preference caching should be used.
Hash holding preferences with hook functions defined.
Hash holding the current set of preferences. Each preference is itself a hash, so this will ultimately be multi-dimensional.
[*pref name*] => Array( [d] => *default value* [m] => *pref mask* [v] => *pref value* )
String containing the name of the current scope. This is used to differentiate between sets of preferences (multiple applications can have a "sortby" preference, for example). By default, all preferences belong to the "global" (Horde) scope.
Array of loaded scopes. In order to only load what we need, and
to not load things multiple times, we need to maintain a list of loaded scopes. $this->_prefs will always be the combination of the current scope and the 'horde' scope (or just the 'horde' scope).
String containing the current username. This indicates the owner of the preferences.
Default constructor (must be called from each extending class in their constructors via parent::Prefs()).
This function provides common cleanup functions for all of the driver implementations.
Clears all preferences from the backend.
Converts a value from the driver's charset to the specified charset.
Converts a value from the specified charset to the driver's charset.
Attempts to return a concrete Prefs instance based on $driver.
Returns the charset used by the concrete preference backend.
Returns the default value of the given preference.
Get the current scope
Return the user who owns these preferences.
Returns the value of the requested preference.
Determines if the current preference value is the default value from prefs.php or a user defined value
Returns the state of the "dirty" bit for the given preference.
Returns the state of the "locked" bit for the given preference.
Returns the state of the "shared" bit for the given preference.
Removes a preference entry from the $prefs hash.
Retrieves preferences for the current scope + the 'horde' scope.
Modifies the "default" bit for the given preference.
Modifies the "dirty" bit for the given preference.
Modifies the "locked" bit for the given preference.
Change scope without explicitly retrieving preferences
Modifies the "shared" bit for the given preference.
Sets the given preferences ($pref) to the specified value ($val), if the preference is modifiable.
Attempts to return a reference to a concrete Prefs instance based on $driver. It will only create a new instance if no Prefs instance with the same parameters currently exists.
This should be used if multiple preference sources (and, thus, multiple Prefs instances) are required.
This method must be invoked as: $var = &Prefs::singleton()
This function will be run at the end of every request as a shutdown
function (registered by the Prefs:: constructor). All prefs with the dirty bit set will be saved to the storage backend at this time; thus, there is no need to manually call $prefs->store() every time a preference is changed.
Tries to find the requested preferences in the cache. If they exist, update the $_scopes hash with the cached values.
Updates the session-based preferences cache (if available).
Return all "dirty" preferences across all scopes.
Returns the scope of the given preference.
Load a specific preference scope.
Sets the given preferences ($pref) to the specified value ($val), whether or not the preference is user-modifiable, unset the default bit, and set the dirty bit.
Documentation generated on Sun, 30 Jan 2011 05:20:40 +0000 by phpDocumentor 1.4.3