Source for file LangXml.class.php
Documentation is available at
LangXml.class.php
<?php
/**
* Class LangXml, lang file controller
*
* LICENSE: CREATIVE COMMONS PUBLIC LICENSE "Namensnennung — Nicht-kommerziell 2.0"
*
*
@copyright
2009 <SEDesign />
*
@license
http://creativecommons.org/licenses/by-nc/2.0/de/
*
@version
$3.0.6$
*
@link
http://www.sedesign.de/de_produkte_chat-v3.html
*
@since
File available since Alpha 1.0
*/
class
LangXml
extends
EtChatConfig
{
/**
* XMLParser Obj
*
@var
XMLParser
*/
public
$langXmlDoc
;
/**
* Constructor
*
*
@param
string
$path
relative path to language files
*
@param
string
$xmlfile
*
@uses
XMLParser object creation
*
@uses
XMLParser::Parse() parse the lang file
*
@uses
XMLParser::$document root-tag as DOM Obj
*
@return
void
*/
public
function
__construct
(
$path
=
"./"
,
$xmlfile
=
""
)
{
// call parent Constructor from class EtChatConfig
parent
::
__construct
(
)
;
// if you want to use an other lang-file then was sets in the actual session
$xmlfile
=
(
empty
(
$xmlfile
))
?
$_SESSION
[
'etchat_'
.
$this
->
_prefix
.
'lang_xml_file'
]
:
$xmlfile
;
//if still empty
if
(
empty
(
$xmlfile
))
$xmlfile
=
"lang_en.xml"
;
// read the whole XML-Lang file
$xml
=
@
file_get_contents
(
$path
.
'lang/'
.
$xmlfile
)
;
// create a XMLParser obj
$parser
= new
XMLParser
(
$xml
)
;
$parser
->
Parse
(
)
;
$this
->
langXmlDoc
=
$parser
->
document
;
}
/**
* Get language datasets for curent class
*
*
@return
XMLParser
*/
public
function
getLang
(
)
{
return
$this
->
langXmlDoc
;
}
}
Documentation generated on Tue, 22 Dec 2009 09:42:49 +0100 by
phpDocumentor 1.4.1