source: branches/3/class/translation.php@ 35

Last change on this file since 35 was 35, checked in by maron, 16 years ago

Zobrazení překladů

File size: 1.5 KB
Line 
1<?php
2
3 class translation
4 { // BEGIN class translation
5 // variables
6 var $id, $data, $text;
7
8 // constructor
9 function translation($id, $database, $GetText = true)
10 { // BEGIN constructor
11 $this->id = $id;
12 $this->database = $database;
13 $this->GetData();
14 if ($GetText and isset($this->data)) $this->GetText();
15 } // END constructor
16
17 function GetData()
18 { // BEGIN function GetData
19 $Query = $this->database->query('SELECT *,(SELECT Id FROM `TextGroup` WHERE
20 `Index` = `cz`.`Index` AND `Group` = `cz`.`Group` AND `Language` = 1)
21 as en_Id FROM TextGroup as cz WHERE Id="'.$this->id.'"');
22 if($Query->num_rows > 0) {
23 $Row = $Query->fetch_array();
24 $this->data = $Row;
25 $result = $this->data;
26 } else $result = TRANSLATION_MISSING;
27
28 return $result;
29 } // END function GetData
30
31 function SetData($data)
32 { // BEGIN function SetData
33
34 } // END function SetData
35
36 function GetText()
37 { // BEGIN function GetText
38 $Query = $this->database->query("SELECT `Text`,`Translation`.`Name`, `Translation`.`MangosColumn` FROM `Text`
39JOIN `Translation` ON `Translation`.`Id` = `Text`.`GroupItem`
40 WHERE `TranslationGroup` = ".$this->id."");
41 while ($Row = $Query->fetch_array()) {
42 $this->text[$Row['Name']] = $Row['Text'];
43 }
44 $this->data['text'] = $this->text;
45 } // END function GetText
46
47 } // END class translation
48
49?>
Note: See TracBrowser for help on using the repository browser.