You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
721 B
29 lines
721 B
<?php
|
|
class Language{
|
|
var $Labels;
|
|
function Language($LangID=1, $_module = ''){
|
|
global $DATABASE;
|
|
$this->Labels=array();
|
|
$QS="SELECT L.key, L.label FROM labels" . $_module . " L WHERE L.language_id='{$LangID}'";
|
|
$result= $DATABASE->Query($QS);
|
|
foreach ( $result as $array){
|
|
$this->Labels[$array['key']]=$array['label'];
|
|
}
|
|
}
|
|
function GetLabel($LabelKey){
|
|
global $Labels;
|
|
if (isset($this->Labels[$LabelKey])){
|
|
return $this->Labels[$LabelKey];
|
|
} else return $LabelKey;
|
|
}
|
|
function AddLabel($LabelKey, $LabelText, $LanguageID)
|
|
{
|
|
global $DATABASE;
|
|
|
|
$QS="INSERT INTO labels SET key='$LabelKey', label='$LabelText', language_id=$LanguageID";
|
|
$result= $DATABASE->Query($QS, false);
|
|
}
|
|
};
|
|
|
|
|
|
?>
|