[ Index ]
 

Code source de eGroupWare 1.2.106-2

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

title

Body

[fermer]

/phpgwapi/inc/ -> class.preferences.inc.php (sommaire)

(pas de description)

Poids: 1280 lignes (46 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

preferences:: (24 méthodes):
  preferences()
  parse_notify()
  lang_notify()
  standard_substitutes()
  unquote()
  read_repository()
  read()
  add()
  delete()
  delete_user()
  add_struct()
  delete_struct()
  quote()
  save_repository()
  create_defaults()
  update_data()
  change()
  commit()
  verify_basic_settings()
  sub_get_mailsvr_port()
  sub_default_userid()
  email_address()
  sub_default_address()
  create_email_preferences()


Classe: preferences  - X-Ref

preferences class used for setting application preferences

the prefs are read into 4 arrays:
$data the effective prefs used everywhere in phpgw, they are merged from the other 3 arrays
$user the stored user prefs, only used for manipulating and storeing the user prefs
$default the default preferences, always used when the user has no own preference set
$forced forced preferences set by the admin, they take precedence over user or default prefs

preferences($account_id = '')   X-Ref
Standard constructor for setting $this->account_id


parse_notify($msg,$values=array()   X-Ref
parses a notify and replaces the substitutes

param: string $msg message to parse / substitute
param: array $values=array() extra vars to replace in addition to $this->values, vars are in an array with \
param: boolean $use_standard_values=true should the standard values are used
return: string with parsed notify-msg

lang_notify($msg,$vals=array()   X-Ref
replaces the english key's with translated ones, or if $un_lang the opposite

param: string $msg message to translate
param: array $values=array() extra vars to replace in addition to $this->values, vars are in an array with \
param: boolean $un_lang=false if true translate back
return: string

standard_substitutes()   X-Ref
define some standard substitues-values and use them on the prefs, if needed


unquote(&$arr)   X-Ref
unquote (stripslashes) recursivly the whole array

param: array &$arr array to unquote (var-param!)

read_repository()   X-Ref
read preferences from the repository

the function ready all 3 prefs user/default/forced and merges them to the effective ones

return: array with effective prefs ($this->data)

read()   X-Ref
read preferences from repository and stores in an array

return: array containing the effective user preferences

add($app_name,$var,$value = ')   X-Ref
add preference to $app_name a particular app

the effective prefs ($this->data) are updated to reflect the change

param: string $app_name name of the app
param: string $var name of preference to be stored
param: mixed $value='##undef##' value of the preference, if not given $GLOBALS[$var] is used
param: $type='user' of preference to set: forced, default, user
return: array with new effective prefs (even when forced or default prefs are set !)

delete($app_name, $var = False,$type = 'user')   X-Ref
delete preference from $app_name

the effektive prefs ($this->data) are updated to reflect the change

param: string $app_name name of app
param: string $var=false variable to be deleted
param: string $type='user' of preference to set: forced, default, user
return: array with new effective prefs (even when forced or default prefs are deleted!)

delete_user($accountid)   X-Ref
delete all prefs of a given user

param: int $accountid

add_struct($app_name,$var,$value = '')   X-Ref
add complex array data preference to $app_name a particular app

param: string $app_name name of the app
param: string $var array keys separated by '/', eg. 'ex_accounts/1'
param: mixed $value='' value of the preference
return: array with new effective prefs (even when forced or default prefs are deleted!)

delete_struct($app_name, $var = '')   X-Ref
delete complex array data preference from $app_name

param: $app_name name of app
param: $var array keys separated by '/', eg. 'ex_accounts/1'
return: array with new effective prefs (even when forced or default prefs are deleted!)

quote(&$arr)   X-Ref
quote (addslashes) recursivly the whole array

param: array &$arr array to quote (var-param!)

save_repository($update_session_info = False,$type='user')   X-Ref
save the the preferences to the repository

User prefs for saveing are in $this->user not in $this->data, which are the effectiv prefs only!

param: boolean $update_session_info=false old param, seems not to be used
param: string $type='user' which prefs to update: user/default/forced
return: array with new effective prefs (even when forced or default prefs are deleted!)

create_defaults($account_id)   X-Ref
insert a copy of the default preferences for use by real account_id

param: int $account_id numerical id of account for which to create the prefs

update_data($data)   X-Ref
update the preferences array

param: array $data array of preferences
return: array with new effective prefs (even when forced or default prefs are deleted!)

change($app_name,$var,$value = "")   X-Ref
Pas de description

commit($update_session_info = True)   X-Ref
Pas de description

verify_basic_settings()   X-Ref
verify basic settings


sub_get_mailsvr_port($prefs, $acctnum=0)   X-Ref
Helper function for create_email_preferences, gets mail server port number.

This will generate the appropriate port number to access a
mail server of type pop3, pop3s, imap, imaps users value from
$phpgw_info['user']['preferences']['email']['mail_port'].
if that value is not set, it generates a default port for the given $server_type.
Someday, this *MAY* be
(a) a se4rver wide admin setting, or
(b)user custom preference
Until then, simply set the port number based on the mail_server_type, thereof
ONLY call this function AFTER ['email']['mail_server_type'] has been set.
author: Angles
param: $prefs - user preferences array based on element ['email'][]

sub_default_userid($account_id='')   X-Ref
Helper function for create_email_preferences, gets default userid for email

This will generate the appropriate userid for accessing an email server.
In the absence of a custom ['email']['userid'], this function should be used to set it.
param: $accountid - as determined in and/or passed to "create_email_preferences"

email_address($account_id='')   X-Ref
returns the custom email-address (if set) or generates a default one

This will generate the appropriate email address used as the "From:"
email address when the user sends email, the localpert * part. The "personal"
part is generated elsewhere.
In the absence of a custom ['email']['address'], this function should be used to set it.

param: int $accountid - as determined in and/or passed to "create_email_preferences"
return: string with email-address

sub_default_address($account_id='')   X-Ref
Pas de description

create_email_preferences($accountid='', $acctnum=0)   X-Ref
create email preferences

param: $account_id -optional defaults to : get_account_id()



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