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.

33 lines
853 B

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