id = $id; $this->database = $database; $this->GetData(); if ($GetText and isset($this->data)) $this->GetText(); } // END constructor function GetData() { // BEGIN function GetData $Query = $this->database->query('SELECT *,(SELECT Id FROM `TextGroup` WHERE `Index` = `cz`.`Index` AND `Group` = `cz`.`Group` AND `Language` = 1) as en_Id FROM TextGroup as cz WHERE Id="'.$this->id.'"'); if($Query->num_rows > 0) { $Row = $Query->fetch_array(); $this->data = $Row; $result = $this->data; } else $result = TRANSLATION_MISSING; return $result; } // END function GetData function SetData($data) { // BEGIN function SetData } // END function SetData function GetText() { // BEGIN function GetText $Query = $this->database->query("SELECT `Text`,`Translation`.`Name`, `Translation`.`MangosColumn` FROM `Text` JOIN `Translation` ON `Translation`.`Id` = `Text`.`GroupItem` WHERE `TranslationGroup` = ".$this->id.""); while ($Row = $Query->fetch_array()) { $this->text[$Row['Name']] = $Row['Text']; } $this->data['text'] = $this->text; } // END function GetText } // END class translation ?>