[ 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.common.inc.php (sommaire)

(pas de description)

Poids: 2091 lignes (61 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 2 fichiers
 phpgwapi/inc/xajax.inc.php
 phpgwapi/inc/footer.inc.php

Définit 1 class

common:: (62 méthodes):
  cmp_version()
  cmp_version_long()
  array_to_string()
  generate_uid()
  get_egwId()
  sql_search()
  getInstalledLanguages()
  getPreferredLanguage()
  ldap_addslashes()
  ldapConnect()
  egw_exit()
  egw_final()
  randomstring()
  filesystem_separator()
  error_list()
  check_owner()
  display_fullname()
  grab_owner_name()
  create_tabs()
  get_app_dir()
  get_inc_dir()
  list_themes()
  list_templates()
  get_tpl_dir()
  is_image_dir()
  get_image_dir()
  get_image_path()
  find_image()
  image()
  image_on()
  navbar()
  app_header()
  egw_header()
  egw_footer()
  get_css()
  get_java_script()
  get_body_attribs()
  hex2bin()
  encrypt()
  decrypt()
  encrypt_password()
  find_portal_order()
  hook()
  hook_single()
  hook_count()
  appsession()
  show_date()
  dateformatorder()
  formattime()
  create_emailpreferences()
  check_code()
  phpgw_error()
  create_phpcode_from_array()
  debug_list_array_contents()
  debug_list_core_functions()
  next_id()
  last_id()
  get_referer()
  phpgw_exit()
  phpgw_final()
  phpgw_header()
  phpgw_footer()


Classe: common  - X-Ref

common class that contains commonly used functions

cmp_version($str1,$str2,$debug=False)   X-Ref
Compares two Version strings and return 1 if str2 is newest (bigger version number) than str1

This function checks for major version only.
param: $str1
param: $str2

cmp_version_long($str1,$str2,$debug=False)   X-Ref
Compares two Version strings and return 1 if str2 is newest (bigger version number) than str1

This function checks all fields. cmp_version() checks release version only.
param: $str1
param: $str2

array_to_string($access,$array)   X-Ref
Convert an array into the format needed for the access column

param: $access
param: $array

generate_uid($_appName, $_eventID)   X-Ref
generate a unique id, which can be used for syncronisation

param: string $_appName the appname
param: string $_eventID the id of the content
return: string the unique id

get_egwId($_globalUid)   X-Ref
get the local content id from a global UID

param: sting $_globalUid the global UID
return: int local egw content id

sql_search($table,$owner=0)   X-Ref
this function is used for searching the access fields

param: $table
param: $owner

getInstalledLanguages()   X-Ref
return an array of installed languages

return: $installedLanguages; an array containing the installed languages

getPreferredLanguage()   X-Ref
return the preferred langugae of the users

it uses HTTP_ACCEPT_LANGUAGE (from the users browser) <br>
and .... to find out which languages are installed

ldap_addslashes($string='')   X-Ref
escapes a string for use in searchfilters meant for ldap_search.

Escaped Characters are: '*', '(', ')', ' ', '\', NUL
It's actually a PHP-Bug, that we have to escape space.
For all other Characters, refer to RFC2254.
param: $string either a string to be escaped, or an array of values to be escaped

ldapConnect($host='', $dn='', $passwd='')   X-Ref
connect to the ldap server and return a handle

param: $host ldap host
param: $dn ldap_root_dn
param: $passwd ldap_root_pw

egw_exit($call_footer = False)   X-Ref
function to stop running an app

used to stop running an app in the middle of execution <br>
There may need to be some cleanup before hand
param: $call_footer boolean value to if true then call footer else exit

egw_final()   X-Ref
Pas de description

randomstring($size)   X-Ref
return a random string of size $size

param: $size int-size of random string to return

filesystem_separator()   X-Ref
Pas de description

error_list($errors,$text='Error')   X-Ref
This is used for reporting errors in a nice format.

param: $error - array of errors

check_owner($record,$link,$label,$extravars = '')   X-Ref


display_fullname($lid = '', $firstname = '', $lastname = '',$accountid=0)   X-Ref
return the fullname of a user

param: $lid='' account loginid
param: $firstname='' firstname
param: $lastname='' lastname
param: $accountid=0 id, to check if it's a user or group, otherwise the lid will be used

grab_owner_name($accountid = '')   X-Ref
grab the owner name

param: $id account id

create_tabs($tabs, $selected, $fontsize = '')   X-Ref
create tabs

param: array $tabs an array repersenting the tabs you wish to display, each element
param: mixed $selected the tab whos key is $selected will be displayed as current tab
param: $fontsize optional
return: string return html that displays the tabs

get_app_dir($appname = '')   X-Ref
get directory of application

$appname can either be passed or derived from $GLOBALS['egw_info']['flags']['currentapp'];
param: $appname name of application

get_inc_dir($appname = '')   X-Ref
get inc (include dir) of application

$appname can either be passed or derived from $GLOBALS['egw_info']['flags']['currentapp'];
param: $appname name of application

list_themes()   X-Ref
list themes available

themes can either be css file like in HEAD (if the template has a css-dir and has css-files in is) \
or ordinary .14 themes-files

list_templates()   X-Ref
List available templates

returns: array alphabetically sorted list of templates

get_tpl_dir($appname = '')   X-Ref
get template dir of an application

param: $appname appication name optional can be derived from $GLOBALS['egw_info']['flags']['currentapp'];

is_image_dir($dir)   X-Ref
checks if image_dir exists and has more than just a navbar-icon

this is just a workaround for idots, better to use find_image, which has a fallback \
on a per image basis to the default dir

get_image_dir($appname = '')   X-Ref
get image dir of an application

param: $appname application name optional can be derived from $GLOBALS['egw_info']['flags']['currentapp'];

get_image_path($appname = '')   X-Ref
get image path of an application

param: $appname appication name optional can be derived from $GLOBALS['egw_info']['flags']['currentapp'];

find_image($appname,$image)   X-Ref
Pas de description

image($appname,$image='',$ext='',$use_lang=True)   X-Ref
Pas de description

image_on($appname,$image,$extension='_on')   X-Ref
Pas de description

navbar()   X-Ref
none yet

*someone wanna add some detail here*

app_header()   X-Ref
load header.inc.php for an application


egw_header()   X-Ref
load the phpgw header


egw_footer()   X-Ref
Pas de description

get_css()   X-Ref
Used by template headers for including CSS in the header

This first loads up the basic global CSS definitions, which support
the selected user theme colors.  Next we load up the app CSS.  This is
all merged into the selected theme's css.tpl file.

author: Dave Hall (*based* on verdilak? css inclusion code)

get_java_script()   X-Ref
Used by the template headers for including javascript in the header

The method is included here to make it easier to change the js support
in phpgw.  One change then all templates will support it (as long as they
include a call to this method).

author: Dave Hall (*vaguely based* on verdilak? css inclusion code)
return: string the javascript to be included

get_body_attribs()   X-Ref
Returns on(Un)Load attributes from js class

returns: string body attributes
author: Dave Hall - skwashd at egroupware.org

hex2bin($data)   X-Ref
Pas de description

encrypt($data)   X-Ref
encrypt data passed to the function

param: $data data (string?) to be encrypted

decrypt($data)   X-Ref
decrypt $data

param: $data data to be decrypted

encrypt_password($password,$sql=False)   X-Ref
legacy wrapper for newer auth class function, encrypt_password

uses the encryption type set in setup and calls the appropriate encryption functions

param: $password password to encrypt

find_portal_order($app)   X-Ref
find the current position of the app is the users portal_order preference

param: $app application id to find current position - required

hook($location, $appname = '', $no_permission_check = False)   X-Ref
temp wrapper to new hooks class


hook_single($location, $appname = '', $no_permission_check = False)   X-Ref
temp wrapper to new hooks class


hook_count($location)   X-Ref
temp wrapper to new hooks class


appsession($data = ')   X-Ref
Pas de description

show_date($t = 0, $format = '', $adjust_to_usertime=true)   X-Ref
return a formatted timestamp or current time

param: int $t=0 timestamp, default current time
param: string $format='' timeformat, default '' = read from the user prefernces
param: boolean $adjust_to_usertime=true should datetime::tz_offset be added to $t or not, default true
return: string the formated date/time

dateformatorder($yearstr,$monthstr,$daystr,$add_seperator = False)   X-Ref
Format a date according to the user preferences

param: string $yearstr year
param: string $monthstr month
param: string $day day
param: boolean $add_seperator=false add the separator specifed in the prefs or not, default no
return: string

formattime($hour,$min,$sec='')   X-Ref
format the time takes settings from user preferences

param: int $hour hour
param: int $min minutes
param: int/string $sec='' defaults to ''
return: string formated time

create_emailpreferences($prefs='',$accountid='')   X-Ref
create email preferences

This is not the best place for it, but it needs to be shared between Aeromail and SM
param: $prefs
param: $account_id -optional defaults to : phpgw_info['user']['account_id']

check_code($code)   X-Ref
?

This will be moved into the applications area

phpgw_error($error,$line = '', $file = '')   X-Ref
process error message

param: $error error
param: $line line
param: $file file

create_phpcode_from_array($array)   X-Ref
create phpcode from array

param: $array - array

debug_list_array_contents($array)   X-Ref
return the full phpgw_info array for debugging

param: array - array

debug_list_core_functions()   X-Ref
return a list of functionsin the API


next_id($appname,$min=0,$max=0)   X-Ref
Return a value for the next id an app/class may need to insert values into LDAP

param: string $appname app-name
param: int $min=0 if != 0 minimum id
param: int $max=0 if != 0 maximum id allowed, if it would be exceeded we return false
return: int/boolean the next id or false if $max given and exceeded

last_id($appname,$min=0,$max=0)   X-Ref
Return a value for the last id entered, which an app may need to check values for LDAP

param: string $appname app-name
param: int $min=0 if != 0 minimum id
param: int $max=0 if != 0 maximum id allowed, if it would be exceeded we return false
return: int current id in the next_id table for a particular app/class or -1 for no app and false if $max is exceeded.

get_referer($default='',$referer='')   X-Ref
gets an eGW conformat referer from $_SERVER['HTTP_REFERER'], suitable for direct use in the link function

param: string $default='' default to use if referer is not set by webserver or not determinable
param: string $referer='' referer string to use, default ('') use $_SERVER['HTTP_REFERER']
return: string

phpgw_exit($call_footer = False)   X-Ref
Pas de description

phpgw_final()   X-Ref
Pas de description

phpgw_header()   X-Ref
Pas de description

phpgw_footer()   X-Ref
Pas de description



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