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 extends EtChatConfig
  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="./lang/"$xmlfile=""){    
  33.         
  34.         // call parent Constructor from class EtChatConfig
  35.         parent::__construct();
  36.         
  37.         // if you want to use an other lang-file then was sets in the actual session
  38.         $xmlfile (empty($xmlfile)) $_SESSION['etchat_'.$this->_prefix.'lang_xml_file'$xmlfile;
  39.  
  40.         //if still empty
  41.         if (empty($xmlfile)) $xmlfile "lang_en.xml";
  42.         
  43.         // read the whole XML-Lang file
  44.         $xml @file_get_contents($path.$xmlfile);
  45.         
  46.         // create a XMLParser obj
  47.         $parser = new XMLParser($xml);
  48.         $parser->Parse();
  49.         $this->langXmlDoc = $parser->document;
  50.     }
  51.     
  52.     /**
  53.     * Get language datasets for curent class
  54.     *
  55.     * @return XMLParser 
  56.     */
  57.     public function getLang(){    
  58.         return $this->langXmlDoc;
  59.     }
  60. }

Documentation generated on Thu, 05 May 2011 14:05:57 +0000 by phpDocumentor 1.4.3