iTx Technologies offre gratuitement
cet espace pour SugarCRM !

title

Body

[fermer]

/include/Localization/ -> Localization.php (sommaire)

(aucune description)

Taille du fichier: 646 lignes (21 kb)
Inclus ou requis: 2 fois
Réferencé: 2 fois
Inclus ou requis: 0 fichiers

Définit la class 1 class

Localization:: (27 methods):
  Localization()
  getLocaleConfigDefaults()
  getPrecedentPreference()
  loadCurrencies()
  getCurrencies()
  getDefaultCurrencies()
  translateStringPack()
  translateForEmail()
  prepBeanForExport()
  translateCharset()
  translateCharsetMIME()
  normalizeCharset()
  getCharsetSelect()
  getExportCharset()
  getOutboundEmailCharset()
  getDecimalSeparator()
  getNumberGroupingSeparator()
  getPrecision()
  getLocaleFormattedNumber()
  getNumberJs()
  formatNumber()
  setSigDigits()
  getLocaleFormatMacro()
  getLocaleFormattedName()
  getNameJs()
  setPreview()
  detectCharset()


Classe: Localization  - X-Ref

Localization()   X-Ref
sole constructor


getLocaleConfigDefaults()   X-Ref
returns an array of Sugar Config defaults that are determined by locale settings

return: array

getPrecedentPreference($prefName, $user=null)   X-Ref
abstraction of precedence

param: string prefName Name of preference to retrieve based on overrides
param: object user User in focus, default null (current_user)
return: string pref Most significant preference

loadCurrencies()   X-Ref
wrapper for whatever currency system we implement


getCurrencies()   X-Ref
getter for currencies array

return: array $this->currencies returns array( id => array(name => X, etc

getDefaultCurrencies()   X-Ref
retrieves default OOTB currencies for sugar_config and installer.

return: array ret Array of default currencies keyed by ISO4217 code

translateStringPack($strings, $charset)   X-Ref
returns a mod|app_strings array in the target charset

param: array strings $mod_string, et.al.
param: string charset Target charset
return: array Translated string pack

translateForEmail($var)   X-Ref
translates the passed variable for email sending (export)

param: mixed the var (array or string) to translate
return: mixed the translated variable

prepBeanForExport($bean)   X-Ref
prepares a bean for export by translating any text fields into the export
character set

param: bean object A SugarBean
return: bean object The bean with translated strings

translateCharset($string, $fromCharset, $toCharset='UTF-8')   X-Ref
translates a character set from one encoding to another encoding

param: string string the string to be translated
param: string fromCharset the charset the string is currently in
param: string toCharset the charset to translate into (defaults to UTF-8)
return: string the translated string

translateCharsetMIME($string, $fromCharset, $toCharset='UTF-8', $encoding="Q")   X-Ref
translates a character set from one to another, and the into MIME-header friendly format


normalizeCharset($charset)   X-Ref
Aucune description

getCharsetSelect()   X-Ref
returns an array of charsets with keys for available translations; appropriate for get_select_options_with_id()


getExportCharset($charset='', $user=null)   X-Ref
returns the charset preferred in descending order: User, Sugar Config, DEFAULT

param: string charset to override ALL, pass a valid charset here
return: string charset the chosen character set

getOutboundEmailCharset($user=null)   X-Ref
returns the charset preferred in descending order: User, Sugar Config, DEFAULT

return: string charset the chosen character set

getDecimalSeparator($user=null)   X-Ref
Aucune description

getNumberGroupingSeparator($user=null)   X-Ref
Aucune description

getPrecision($user=null)   X-Ref
Aucune description

getLocaleFormattedNumber($number, $currencySymbol='', $is_currency=true, $user=null)   X-Ref
returns a number formatted by user preference or system default

param: string number Number to be formatted and returned
param: string currencySymbol Currency symbol if override is necessary
param: bool is_currency Flag to also return the currency symbol
return: string Formatted number

getNumberJs()   X-Ref
returns Javascript to format numbers and currency for ***DISPLAY***


formatNumber(n, sep, dec, precision)   X-Ref
Aucune description

setSigDigits()   X-Ref
Aucune description

getLocaleFormatMacro($user=null)   X-Ref
get's the Name format macro string, preferring $current_user

return: string format Name Format macro for locale

getLocaleFormattedName($firstName, $lastName, $salutationKey='', $title='', $format="", $user=null)   X-Ref
returns formatted name according to $current_user's locale settings

param: string firstName
param: string lastName
param: string salutation
param: string title
param: string format If a particular format is desired, then pass this optional parameter as a simple string.
return: string formattedName

getNameJs($first='', $last='', $salutation='', $title='')   X-Ref
outputs some simple Javascript to show a preview of Name format in "My Account" and "Admin->Localization"

param: string first First Name, use app_strings default if not specified
param: string last Last Name, use app_strings default if not specified
param: string salutation Saluation, use app_strings default if not specified
return: string some Javascript

setPreview()   X-Ref
Aucune description

detectCharset($str)   X-Ref
Attempts to detect the charset used in the string

param: $str string
return: string



Generé en: Thu Mar 4 09:44:50 2010 | Cross-referenced par PHPXref 0.7