Web Interface For Lite Argus Control modules
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.

26 lines
707 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. class Language{
  3. var $Labels;
  4. function Language($LangID=1, $_module = ''){
  5. global $DATABASE;
  6. $this->Labels=array();
  7. $QS="SELECT key, label FROM labels" . $_module . " WHERE language_id='{$LangID}'";
  8. $result= $DATABASE->Query($QS);
  9. foreach ( $result as $array) $this->Labels[$array['key']]=$array['label'];
  10. }
  11. function GetLabel($LabelKey){
  12. //global $Labels;
  13. if (isset($this->Labels[$LabelKey])){
  14. return $this->Labels[$LabelKey];
  15. } else return $LabelKey;
  16. }
  17. function AddLabel($LabelKey, $LabelText, $LanguageID)
  18. {
  19. global $DATABASE;
  20. $QS="INSERT INTO labels SET key='$LabelKey', label='$LabelText', language_id=$LanguageID";
  21. $result= $DATABASE->Query($QS, false);
  22. }
  23. };
  24. ?>