Translation2
[ class tree: Translation2 ] [ index: Translation2 ] [ all elements ]

Class: Translation2_Admin_Container_xml

Source Location: /Translation2-2.0.4/Translation2/Admin/Container/xml.php

Class Overview

Translation2_Container
   |
   --Translation2_Container_xml
      |
      --Translation2_Admin_Container_xml

Storage driver for storing/fetching data to/from a XML file


Author(s):

Copyright:

  • 2004-2007 Lorenzo Alberton, Olivier Guilyardi

Methods


Inherited Variables

Inherited Methods

Class: Translation2_Container_xml

Translation2_Container_xml::fetchLangs()
Fetch the available langs
Translation2_Container_xml::fixEmptySets()
Turn empty strings returned by XML_Unserializer into empty arrays
Translation2_Container_xml::getOne()
Get a single item from the container
Translation2_Container_xml::getPage()
Returns an array of the strings in the selected page
Translation2_Container_xml::getStringID()
Get the stringID for the given string
Translation2_Container_xml::init()
Initialize the container

Class: Translation2_Container

Translation2_Container::Translation2_Container()
Constructor Has to be overwritten by each storage class
Translation2_Container::fetchLangs()
Fetch the available langs if they're not cached yet.
Translation2_Container::getLang()
Gets the current lang
Translation2_Container::getLangData()
Gets the array data for the lang
Translation2_Container::getLangs()
Gets the available languages
Translation2_Container::getOne()
Get a single item from the container, without caching the whole page Containers should implement this method.
Translation2_Container::getPage()
Returns an array of the strings in the selected page Containers should implement this method.
Translation2_Container::getStringID()
Get the stringID for the given string
Translation2_Container::raiseError()
Trigger a PEAR error
Translation2_Container::setCharset()
Set charset used to read/store the translations
Translation2_Container::setLang()
Sets the current language
Translation2_Container::_parseOptions()
Parse options passed to the container class

Class Details

[line 58]
Storage driver for storing/fetching data to/from a XML file


[ Top ]


Method Detail

add   [line 154]

true|PEAR_Error add( string $stringID, string $pageID, array $stringArray)

Add a new entry in the strings table.

Parameters:

string   $stringID     string ID
string   $pageID     page/group ID
array   $stringArray     Associative array with string translations. Sample format: array('en' => 'sample', 'it' => 'esempio')

[ Top ]

addLang   [line 79]

true|PEAR_Error addLang( array $langData, [array $options = array()])

Does nothing (here for compatibility with the container interface)

Parameters:

array   $langData     language data
array   $options     language options

[ Top ]

addLangToList   [line 99]

true|PEAR_Error addLangToList( array $langData)

Creates a new entry in the <languages> section

Parameters:

array   $langData     array('lang_id' => 'en', 'name' => 'english', 'meta' => 'some meta info', 'error_text' => 'not available', 'encoding' => 'iso-8859-1', );

[ Top ]

getPageNames   [line 274]

array getPageNames( )

Get a list of all the pageIDs.

[ Top ]

remove   [line 206]

true|PEAR_Error remove( string $stringID, string $pageID)

Remove an entry from the strings table.

Parameters:

string   $stringID     string ID
string   $pageID     page/group ID

[ Top ]

removeLang   [line 230]

true|PEAR_Error removeLang( string $langID, [boolean $force = true])

Remove all the entries for the given lang from the strings table.

Parameters:

string   $langID     language ID
boolean   $force     (ignored)

[ Top ]

removePage   [line 256]

true|PEAR_Error removePage( [string $pageID = null])

Remove all the strings in the given page/group

Parameters:

string   $pageID     page/group ID

[ Top ]

update   [line 190]

true|PEAR_Error update( string $stringID, string $pageID, array $stringArray)

Update an existing entry in the strings table.

Parameters:

string   $stringID     string ID
string   $pageID     page/group ID
array   $stringArray     Associative array with string translations. Sample format: array('en' => 'sample', 'it' => 'esempio')

[ Top ]

updateLang   [line 126]

true|PEAR_Error updateLang( array $langData)

Update the lang info in the langsAvail table

Parameters:

array   $langData     array [@see addLangToList()]

[ Top ]


Documentation generated on Mon, 06 Dec 2010 00:00:31 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.