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



[ Top ]


Method Detail

fetchLangs   [line 410]

Class: Translation2_Container_xml

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

Class Overview

Translation2_Container
   |
   --Translation2_Container_xml

Storage driver for fetching data from a XML file


Author(s):

Copyright:

  • 2004-2008 Lorenzo Alberton, Olivier Guilyardi

Methods


Child classes:

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

Inherited Variables

Inherited Methods

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 106]
Storage driver for fetching data from a XML file

Example file :

 
 
     
         
              English 
              Custom meta data
              Non disponible en français 
              iso-8859-1 
         
         
     
     
         
             
                 
void fetchLangs( )

Fetch the available langs

Overrides Translation2_Container::fetchLangs() (Fetch the available langs if they're not cached yet.)
[ Top ]

fixEmptySets   [line 338]

void fixEmptySets( array &$data)

Turn empty strings returned by XML_Unserializer into empty arrays

Note: this method is public because called statically by the t2xmlchk.php script. It is not meant to be called by user-space code.

  • Access: public

Parameters:

array   &$data   —  array of languages/pages

[ Top ]

getOne   [line 462]

string getOne( string $stringID, [string $pageID = null], [string $langID = null])

Get a single item from the container

Overrides Translation2_Container::getOne() (Get a single item from the container, without caching the whole page Containers should implement this method.)

Parameters:

string   $stringID   —  string ID
string   $pageID   —  page/group ID
string   $langID   —  language ID

[ Top ]

getPage   [line 431]

array getPage( [string $pageID = null], [string $langID = null])

Returns an array of the strings in the selected page

Overrides Translation2_Container::getPage() (Returns an array of the strings in the selected page Containers should implement this method.)

Parameters:

string   $pageID   —  page/group ID
string   $langID   —  language ID

[ Top ]

getStringID   [line 485]

string getStringID( string $string, [string $pageID = null])

Get the stringID for the given string

Overrides Translation2_Container::getStringID() (Get the stringID for the given string)

Parameters:

string   $string   —  string
string   $pageID   —  page/group ID

[ Top ]

init   [line 132]

boolean|PEAR_Error init( array $options)

Initialize the container
  • Return: object if something went wrong

Parameters:

array   $options   —  - 'filename': Path to the XML file

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:41:52 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.