Source for file LangXml.class.php

Documentation is available at LangXml.class.php

  1. <?php
  2. /**
  3.  * Class LangXml, lang file controller
  4.  *
  5.  * LICENSE: CREATIVE COMMONS PUBLIC LICENSE  "Namensnennung — Nicht-kommerziell 2.0"
  6.  *
  7.  * @copyright  2009 <SEDesign />
  8.  * @license    http://creativecommons.org/licenses/by-nc/2.0/de/
  9.  * @version    $3.0.6$
  10.  * @link       http://www.sedesign.de/de_produkte_chat-v3.html
  11.  * @since      File available since Alpha 1.0
  12.  */
  13.  
  14. class LangXml
  15. {
  16.     /**
  17.     * XMLParser Obj
  18.     * @var XMLParser 
  19.     */
  20.     public $langXmlDoc;
  21.     
  22.     /**
  23.     * Constructor
  24.     *
  25.     * @param  string $path relative path to language files
  26.     * @param  string $xmlfile 
  27.     * @uses XMLParser object creation
  28.     * @uses XMLParser::Parse() parse the lang file
  29.     * @uses XMLParser::$document root-tag as DOM Obj
  30.     * @return void 
  31.     */
  32.     public function __construct ($path="./"$xmlfile=""){    
  33.         
  34.         // if you want to use an other lang-file then was sets in the actual session
  35.         $xmlfile (empty($xmlfile)) $_SESSION['etchat_v3_lang_xml_file'$xmlfile;
  36.         
  37.         //if still empty
  38.         if (empty($xmlfile)) $xmlfile "lang_en.xml";
  39.         
  40.         // read the whole XML-Lang file
  41.         $xml @file_get_contents($path.'lang/'.$xmlfile);
  42.         
  43.         // create a XMLParser obj
  44.         $parser = new XMLParser($xml);
  45.         $parser->Parse();
  46.         $this->langXmlDoc = $parser->document;
  47.     }
  48.     
  49.     /**
  50.     * Get language datasets for curent class
  51.     *
  52.     * @return XMLParser 
  53.     */
  54.     public function getLang(){    
  55.         return $this->langXmlDoc;
  56.     }
  57. }

Documentation generated on Thu, 13 Aug 2009 08:21:54 +0200 by phpDocumentor 1.4.1