[ Index ]
 

Code source de Horde 3.1.3

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/lib/Horde/ -> Prefs.php (sommaire)

Preference is administratively locked.

Poids: 825 lignes (25 kb)
Inclus ou requis: 1 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Prefs:: (37 méthodes):
  Prefs()
  getCharset()
  cacheUpdate()
  cacheLookup()
  add()
  remove()
  setValue()
  __set()
  _setValue()
  getValue()
  __get()
  setLocked()
  isLocked()
  setShared()
  isShared()
  setDirty()
  isDirty()
  setDefault()
  getDefault()
  isDefault()
  _setMask()
  _getMask()
  isEmpty()
  getScope()
  _dirtyPrefs()
  retrieve()
  store()
  cleanup()
  clear()
  convertFromDriver()
  convertToDriver()
  _setDefaults()
  _shutdown()
  _setHook()
  _callHooks()
  factory()
  singleton()


Classe: Prefs  - X-Ref

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*
);

$Horde: framework/Prefs/Prefs.php,v 1.137.10.27 2006/07/03 17:38:11 chuck Exp $

Copyright 1999-2006 Jon Parise <jon@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.

Prefs()   X-Ref
Default constructor (must be called from each extending class in their
constructors via parent::Prefs()).


getCharset()   X-Ref
Returns the charset used by the concrete preference backend.

return: string  The preference backend's charset.

cacheUpdate($pref = null)   X-Ref
Updates the session-based preferences cache (if available).

param: string $pref  The preference to update.  If empty, will update

cacheLookup()   X-Ref
Tries to find the requested preferences in the cache. If they exist,
update the $prefs hash with the cached values.

return: boolean  True on success, false on failure.

add($pref, $val = '', $mask = 0)   X-Ref
Adds a new preference entry to the $prefs hash.

param: string $pref   The name of the preference to add.
param: string $val    The initial value of the preference.
param: integer $mask  The initial bitmask of the preference.

remove($pref)   X-Ref
Removes a preference entry from the $prefs hash.

param: string $pref  The name of the preference to remove.

setValue($pref, $val, $convert = true)   X-Ref
Sets the given preferences ($pref) to the specified value
($val), if the preference is modifiable.

param: string $pref      The name of the preference to modify.
param: string $val       The new value for this preference.
param: boolean $convert  If true the preference value gets converted
return: boolean  True if the value was successfully set, false on a

__set($name, $value)   X-Ref
Pas de description

_setValue($pref, $val, $dirty = true, $convert = true)   X-Ref
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.

param: string  $pref     The name of the preference to modify.
param: string  $val      The new value for this preference.
param: boolean $dirty    True if we should mark the new value as
param: boolean $convert  If true the preference value gets converted
return: boolean  True if the value was successfully set, false on a

getValue($pref, $convert = true)   X-Ref
Returns the value of the requested preference.

param: string $pref      The name of the preference to retrieve.
param: boolean $convert  If true the preference value gets converted
return: string  The value of the preference, null if it doesn't exist.

__get($name)   X-Ref
Pas de description

setLocked($pref, $bool)   X-Ref
Modifies the "locked" bit for the given preference.

param: string $pref   The name of the preference to modify.
param: boolean $bool  The new boolean value for the "locked" bit.

isLocked($pref)   X-Ref
Returns the state of the "locked" bit for the given preference.

param: string $pref  The name of the preference to check.
return: boolean  The boolean state of $pref's "locked" bit.

setShared($pref, $bool)   X-Ref
Modifies the "shared" bit for the given preference.

param: string $pref   The name of the preference to modify.
param: boolean $bool  The new boolean value for the "shared" bit.

isShared($pref)   X-Ref
Returns the state of the "shared" bit for the given preference.

param: string $pref  The name of the preference to check.
return: boolean  The boolean state of $pref's "shared" bit.

setDirty($pref, $bool)   X-Ref
Modifies the "dirty" bit for the given preference.

param: string $pref      The name of the preference to modify.
param: boolean $bool     The new boolean value for the "dirty" bit.

isDirty($pref)   X-Ref
Returns the state of the "dirty" bit for the given preference.

param: string $pref  The name of the preference to check.
return: boolean  The boolean state of $pref's "dirty" bit.

setDefault($pref, $bool)   X-Ref
Modifies the "default" bit for the given preference.

param: string $pref   The name of the preference to modify.
param: boolean $bool  The new boolean value for the "default" bit.

getDefault($pref)   X-Ref
Returns the default value of the given preference.

param: string $pref  The name of the preference to get the default for.
return: string       The preference's default value.

isDefault($pref)   X-Ref
Determines if the current preference value is the default
value from prefs.php or a user defined value

param: string $pref  The name of the preference to check.
return: boolean  True if the preference is the application default

_setMask($pref, $bool, $mask)   X-Ref
Sets the value for a given mask.

param: string $pref   The name of the preference to modify.
param: boolean $bool  The new boolean value for the "default" bit.
param: integer $mask  The mask to add.

_getMask($pref, $mask)   X-Ref
Gets the boolean state for a given mask.

param: string $pref   The name of the preference to modify.
param: integer $mask  The mask to get.
return: boolean  The boolean state for the given mask.

isEmpty($pref)   X-Ref
Determines whether the current preference is empty.

param: string $pref  The name of the preference to check.
return: boolean  True if the preference is empty.

getScope($pref)   X-Ref
Returns the scope of the given preference.

param: string $pref  The name of the preference to examine.
return: string  The scope of the $pref.

_dirtyPrefs()   X-Ref
Return a list of "dirty" preferences.

return: array  The list of "dirty" preferences in $this->_prefs.

retrieve()   X-Ref
Retrieves the default preferences.


store()   X-Ref
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.


cleanup($all = false)   X-Ref
This function provides common cleanup functions for all of the driver
implementations.

param: boolean $all  Clean up all Horde preferences.

clear()   X-Ref
Clears all preferences from the backend.


convertFromDriver($value, $charset)   X-Ref
Converts a value from the driver's charset to the specified charset.

param: mixed $value     A value to convert.
param: string $charset  The charset to convert to.
return: mixed  The converted value.

convertToDriver($value, $charset)   X-Ref
Converts a value from the specified charset to the driver's charset.

param: mixed $value  A value to convert.
param: string $charset  The charset to convert from.
return: mixed  The converted value.

_setDefaults($app)   X-Ref
Populates the $prefs hash with new entries and externally defined
default values.

param: string $app  The application to load defaults for.

_shutdown()   X-Ref
Performs shutdown activities.


_setHook($pref)   X-Ref
Add $pref to the list of preferences with hook functions.

param: string $pref  The preference with a hook.

_callHooks()   X-Ref
After preferences have been loaded, set any locked or empty
preferences that have hooks to the result of the hook.


factory($driver, $scope = 'horde', $user = '', $password = '',$params = null, $caching = true)   X-Ref
Attempts to return a concrete Prefs instance based on $driver.

param: mixed $driver     The type of concrete Prefs subclass to return.
param: string $scope     The scope for this set of preferences.
param: string $user      The name of the user who owns this set of
param: string $password  The password associated with $user.
param: array $params     A hash containing any additional configuration
param: boolean $caching  Should caching be used?
return: Prefs  The newly created concrete Prefs instance, or false on

singleton($driver, $scope = 'horde', $user = '', $password = '',$params = null, $caching = true)   X-Ref
Pas de description



Généré le : Sun Feb 25 18:01:28 2007 par Balluche grâce à PHPXref 0.7