Class CMS_language

Description

Class CMS_language

Manages a language representation

Located in /automne/classes/common/language.php (line 29)

CMS_grandFather
   |
   --CMS_language
Method Summary
 static string getMessages (integer $messageId, [string $module = MOD_STANDARD_CODENAME])
 void __construct ([ $code = ''])
 Id createMessage (string $sCodename, array $aMessages)
 boolean deleteMessage ( $sCodename,  $iId)
 boolean endPrefetch ([string $module = MOD_STANDARD_CODENAME])
 string getCode ()
 string getDateFormat ()
 string getDateFormatMask ()
 string getJsMessage (integer $messageId, [array(string) $parameters = false], [string $module = MOD_STANDARD_CODENAME])
 string getLabel ()
 string getMessage (integer $messageId, [array(string) $parameters = false], [string $module = MOD_STANDARD_CODENAME], [boolean $usePriority = true])
 array(string) getModulesDenied ()
 the getNextMessageId ( $sCodename)
 boolean setAvailableForBackoffice ( $status)
 boolean setCode ( $code)
 boolean setDateFormat ( $format)
 boolean setLabel ( $label)
 array(string) setModulesDenied ( $modules)
 boolean startPrefetch ([string $module = MOD_STANDARD_CODENAME])
 boolean updateMessage (string $sCodename, integer $iId, array $aMessages)
 boolean writeToPersistence ()
 string _getOldMessage (integer $messageId, [array(string) $parameters = false], [string $module = ''])
 string _getPrefetchedMessage (integer $messageId, [string $module = MOD_STANDARD_CODENAME])
 boolean _storeMessage (integer $messageId, [string $module = MOD_STANDARD_CODENAME], string $message)
Methods
static getMessages (line 228)

Get all the messages

  • access: public
static string getMessages (integer $messageId, [string $module = MOD_STANDARD_CODENAME])
  • integer $messageId: The ID of the message to get
  • string $module: The codename of the module owner of the message
Constructor __construct (line 87)

Constructor.

Build the language by its code

  • access: public
void __construct ([ $code = ''])
  • $code
createMessage (line 583)

Create messages.

  • return: of the inserted message.
Id createMessage (string $sCodename, array $aMessages)
  • string $sCodename: Module's codename.
  • array $aMessages: Localised message. $sLanguageCode => $sMessage
deleteMessage (line 630)

Delete messages.

  • var: Module's codename.
boolean deleteMessage ( $sCodename,  $iId)
  • $sCodename
  • $iId
endPrefetch (line 499)

End prefetching for a given module

  • End constant declarion comparaison
  • Get all messages for all new constants declared

  • access: public
boolean endPrefetch ([string $module = MOD_STANDARD_CODENAME])
  • string $module: The codename of the module owner of the message
getCode (line 326)

Get the code.

  • return: The language code
  • access: public
string getCode ()
getDateFormat (line 368)

Get the date format.

  • return: The language date format
  • access: public
string getDateFormat ()
getDateFormatMask (line 465)

Get the date format mask.

  • return: The language date format mask
  • access: public
string getDateFormatMask ()
getJsMessage (line 316)

Get the message with simple quotes escaped

  • access: public
string getJsMessage (integer $messageId, [array(string) $parameters = false], [string $module = MOD_STANDARD_CODENAME])
  • integer $messageId: The ID of the message to get
  • array(string) $parameters: An array of parameters which will replace %s in the returned string
  • string $module: The codename of the module owner of the message
getLabel (line 347)

Get the label.

  • return: The language label
  • access: public
string getLabel ()
getMessage (line 133)

Get the message translated into the specified language

  • access: public
string getMessage (integer $messageId, [array(string) $parameters = false], [string $module = MOD_STANDARD_CODENAME], [boolean $usePriority = true])
  • integer $messageId: The ID of the message to get
  • array(string) $parameters: An array of parameters which will replace %s in the returned string
  • string $module: The codename of the module owner of the message
  • boolean $usePriority: : If message does not exists, use language priority to get it (default : true).
getModulesDenied (line 410)

Get the array of modules codenames which can't use this language in their backoffice.

  • access: public
array(string) getModulesDenied ()
getNextMessageId (line 564)

Return the next module message id

  • return: highest module message id + 1
the getNextMessageId ( $sCodename)
  • $sCodename
isAvailableForBackoffice (line 389)

Is this language available for backoffice use ?

  • access: public
boolean isAvailableForBackoffice ()
setAvailableForBackoffice (line 399)

Is this language available for backoffice use ?

  • access: public
boolean setAvailableForBackoffice ( $status)
  • $status
setCode (line 336)

Set the code.

  • access: public
boolean setCode ( $code)
  • $code
setDateFormat (line 378)

Set the date format.

  • access: public
boolean setDateFormat ( $format)
  • $format
setLabel (line 357)

Set the label.

  • access: public
boolean setLabel ( $label)
  • $label
setModulesDenied (line 420)

Set the array of modules codenames which can't use this language in their backoffice.

  • access: public
array(string) setModulesDenied ( $modules)
  • $modules
startPrefetch (line 480)

Start prefetching for a given module

  • Start constant declarion comparaison

  • access: public
boolean startPrefetch ([string $module = MOD_STANDARD_CODENAME])
  • string $module: The codename of the module owner of the message
updateMessage (line 606)

Update messages.

boolean updateMessage (string $sCodename, integer $iId, array $aMessages)
  • string $sCodename: Module's codename.
  • integer $iId: Messages id.
  • array $aMessages: Localised message. $sLanguageCode => $sMessage
writeToPersistence (line 434)

Writes the language Data into persistence (MySQL for now).

  • return: true on success, false on failure
  • access: public
boolean writeToPersistence ()
_getOldMessage (line 259)

Get the message translated into the specified language old function keeped for compatibility with old modules

  • access: private
string _getOldMessage (integer $messageId, [array(string) $parameters = false], [string $module = ''])
  • integer $messageId: The ID of the message to get
  • array(string) $parameters: An array of parameters which will replace %s in the returned string
  • string $module: The codename of the module owner of the message
_getPrefetchedMessage (line 553)

Get a message stored

  • return: if message is already prefetched, false otherwise
  • access: private
string _getPrefetchedMessage (integer $messageId, [string $module = MOD_STANDARD_CODENAME])
  • integer $messageId: The message Id to store
  • string $module: The codename of the module owner of the message
_storeMessage (line 540)

Store a message already loaded from DB for further access

  • access: private
boolean _storeMessage (integer $messageId, [string $module = MOD_STANDARD_CODENAME], string $message)
  • integer $messageId: The message Id to store
  • string $module: The codename of the module owner of the message
  • string $message: The message to store

Inherited Methods

Inherited From CMS_grandFather

 CMS_grandFather::autoload()
 CMS_grandFather::hasError()
 CMS_grandFather::log()
 CMS_grandFather::PHPErrorHandler()
 CMS_grandFather::raiseError()
 CMS_grandFather::setDebug()
 CMS_grandFather::setLog()
 CMS_grandFather::_raiseError()
 CMS_grandFather::__call()
Class Constants

Documentation generated on Wed, 15 Feb 2012 15:31:33 +0100 by phpDocumentor 1.4.3