2001-01-11 10:52:33 +01:00
|
|
|
<?php
|
2008-03-15 16:11:48 +01:00
|
|
|
/**
|
2014-06-13 15:15:21 +02:00
|
|
|
* EGroupware API - Preferences
|
2009-10-06 08:45:28 +02:00
|
|
|
*
|
2008-03-15 16:11:48 +01:00
|
|
|
* @link http://www.egroupware.org
|
|
|
|
* @author Joseph Engo <jengo@phpgroupware.org>
|
|
|
|
* @author Mark Peters <skeeter@phpgroupware.org>
|
|
|
|
* @author Ralf Becker <RalfBecker-AT-outdoor-training.de> merging prefs on runtime, session prefs and reworked the class
|
|
|
|
* Copyright (C) 2000, 2001 Joseph Engo
|
|
|
|
* @license http://opensource.org/licenses/lgpl-license.php LGPL - GNU Lesser General Public License
|
|
|
|
* @package api
|
|
|
|
* @version $Id$
|
|
|
|
*/
|
|
|
|
|
2016-03-06 16:54:07 +01:00
|
|
|
use EGroupware\Api;
|
|
|
|
|
2008-03-15 16:11:48 +01:00
|
|
|
/**
|
|
|
|
* preferences class used for setting application preferences
|
|
|
|
*
|
2014-01-18 18:43:15 +01:00
|
|
|
* preferences are read into following arrays:
|
|
|
|
* - $data effective prefs used everywhere in EGroupware
|
|
|
|
* Effective prefs are merged together in following precedence from:
|
|
|
|
* - $forced forced preferences set by the admin, they take precedence over user or default prefs
|
|
|
|
* - $session temporary prefs eg. language set on login just for session
|
|
|
|
* - $user the stored user prefs, only used for manipulating and storeing the user prefs
|
|
|
|
* - $group the stored prefs of all group-memberships of current user, can NOT be deleted or stored directly!
|
|
|
|
* - $default the default preferences, always used when the user has no own preference set
|
2010-05-12 11:23:50 +02:00
|
|
|
*
|
2010-01-27 06:44:31 +01:00
|
|
|
* To update the prefs of a certain group, not just the primary group of the user, you have to
|
|
|
|
* create a new instance of preferences class, with the given id of the group. This takes into
|
|
|
|
* account the offset of DEFAULT_ID, we are using currently for groups (as -1, and -2) are already
|
|
|
|
* taken!
|
2014-06-13 15:15:21 +02:00
|
|
|
*
|
|
|
|
* Preferences get now json-encoded and no longer PHP serialized and addslashed,
|
|
|
|
* thought they only change when they get updated.
|
2008-03-15 16:11:48 +01:00
|
|
|
*/
|
2016-03-28 20:51:38 +02:00
|
|
|
class preferences extends Api\Preferences
|
2008-03-15 16:11:48 +01:00
|
|
|
{
|
|
|
|
/**
|
2014-06-13 15:15:21 +02:00
|
|
|
* @deprecated use add
|
2008-03-15 16:11:48 +01:00
|
|
|
*/
|
|
|
|
function change($app_name,$var,$value = "")
|
|
|
|
{
|
|
|
|
return $this->add($app_name,$var,$value);
|
|
|
|
}
|
|
|
|
}
|