1 | <?php
|
---|
2 |
|
---|
3 | include('includes/global.php');
|
---|
4 |
|
---|
5 | function ColorNames($Text, $names)
|
---|
6 | {
|
---|
7 |
|
---|
8 | // $buff[] = array($Line['ID'],GetIDbyName($Table),$Line[$Column],$Line['Tran']);
|
---|
9 | foreach($names as $Line) {
|
---|
10 | if ($Line[3] <> '') {
|
---|
11 | $Text = str_replace($Line[2],'<span Title="Byl nalezen překlad: '.$Line[3].'" class="edit">'.$Line[2].'</span>',$Text);
|
---|
12 | $Text = str_replace(strtolower($Line[2]),'<span Title="Byl nalezen překlad: '.$Line[3].'" class="edit">'.$Line[2].'</span>',$Text);
|
---|
13 | } else {
|
---|
14 | $Text = str_replace($Line[2],'<span Title="Jméno bylo nalezeno v názvech a můžete ho přeložit. Začnete kliknutím na: Vyhledat v názvech" class="edit">'.$Line[2].'</span>',$Text);
|
---|
15 | $Text = str_replace(strtolower($Line[2]),'<span Title="Jméno bylo nalezeno v názvech a můžete ho přeložit. Začnete kliknutím na: Vyhledat v názvech" class="edit">'.$Line[2].'</span>',$Text);
|
---|
16 | }
|
---|
17 | }
|
---|
18 | return $Text;
|
---|
19 | }
|
---|
20 |
|
---|
21 | ShowPage();
|
---|
22 |
|
---|
23 | $GroupId = LoadGroupIdParameter();
|
---|
24 | $Table = $TranslationTree[$GroupId]['TablePrefix'];
|
---|
25 | if(array_key_exists('action', $_GET)) $Action = $_GET['action'];
|
---|
26 | else $Action = '';
|
---|
27 |
|
---|
28 | if(array_key_exists('ID', $_GET))
|
---|
29 | {
|
---|
30 | $TextID = $_GET['ID'] * 1;
|
---|
31 |
|
---|
32 | $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$TextID);
|
---|
33 | $Line = mysql_fetch_assoc($DbResult);
|
---|
34 | if(!$Line) ErrorMessage('Překlad nenalezen.');
|
---|
35 |
|
---|
36 | $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE (`Language` = 0) AND (`Entry` = '.$Line['Entry'].') AND (`VersionEnd` = '.$Line['VersionEnd'].') LIMIT 1');
|
---|
37 | $LineAJ = mysql_fetch_assoc($DbResult);
|
---|
38 | if(!$Line) ErrorMessage('Anglický originál k překladu nenalezen.');
|
---|
39 |
|
---|
40 | $IDUser = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$Line['User']);
|
---|
41 | $LineUser = mysql_fetch_array($IDUser);
|
---|
42 |
|
---|
43 | echo('Skupina: <strong>'.$TranslationTree[$GroupId]['Name'].'</strong><br />');
|
---|
44 |
|
---|
45 | if(($Line['Language'] <> 0) and ($LineUser['Name'] <> ''))
|
---|
46 | echo('Přeložil: <strong>'.$LineUser['Name'].'</strong> dne '.HumanDate($Line['ModifyTime']).'<br />');
|
---|
47 | if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID']))
|
---|
48 | {
|
---|
49 | $Language = mysql_fetch_assoc($Database->SQLCommand('SELECT `Language`,`VersionStart`,`VersionEnd` FROM `'.$Table.'` WHERE `ID` = '.$Line['Take']));
|
---|
50 | // echo $Language['Language'].' '.$Line['Take'];
|
---|
51 | if($Language['Language'] <> 0)
|
---|
52 | echo('Převzato z: <a href="form.php?group='.$GroupId.'&ID='.$Line['Take'].'">'.$Line['Take'].'</a> <br />');
|
---|
53 | }
|
---|
54 | echo('Text: ');
|
---|
55 | if($Line['Language'] <> 0)
|
---|
56 | {
|
---|
57 | if($Line['Complete'] == 1) echo(' <b>Hotov</b>');
|
---|
58 | else echo(' <b> Uložen v rozepsaných</b> ');
|
---|
59 | } else echo(' <b>Anglická, původní verze</b> ');
|
---|
60 |
|
---|
61 | echo('<br />');
|
---|
62 | echo('Verze: <b>'.GetVersionWOW($Line['VersionStart']).' - '.GetVersionWOW($Line['VersionEnd'].'</b>'));
|
---|
63 | echo('<br />');
|
---|
64 |
|
---|
65 | $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`Language` <> 0) AND (`Complete` = 1)');
|
---|
66 | $Version = mysql_fetch_row($DbResult);
|
---|
67 | $Version = $Version[0];
|
---|
68 | if($Version > 0)
|
---|
69 | {
|
---|
70 | echo('<form action="comparison.php" method="get"><a href="TranslationList.php?group='.$GroupId.'&user=0&state=2&entry='.$Line['Entry'].'&text=">Počet verzí: <strong>'.$Version.'</strong></a>
|
---|
71 | <input type="hidden" name="group" value="'.$GroupId.'" />
|
---|
72 | <input type="hidden" name="entry" value="'.$Line['Entry'].'" />
|
---|
73 | <input type="hidden" name="ID2" value="'.$TextID.'" />
|
---|
74 | <select onchange="this.form.submit();" name="ID1">
|
---|
75 | <option value="-1">Vyberte text k porovnání</option>
|
---|
76 | <option value="-1">Zobrazit/porovnat všechny</option>');
|
---|
77 | $DataID = $Database->SQLCommand('SELECT *, (SELECT `User`.`Name` AS `UserName` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`ID` <> '.$Line['ID'].') AND (`Complete` = 1)');
|
---|
78 | while($version = mysql_fetch_array($DataID))
|
---|
79 | {
|
---|
80 | if ($version['ID'] == $Line['Take']) echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$version['User'].' (převzato)</option>');
|
---|
81 | else
|
---|
82 | {
|
---|
83 | if($version['Language'] == 0) $version['UserName'] = 'Předloha';
|
---|
84 | echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$Version['UserName'].' ('.GetVersionWOW($version['VersionStart']).' - '.GetVersionWOW($version['VersionEnd']).')</option>');
|
---|
85 | }
|
---|
86 | }
|
---|
87 | echo('</select></form>');
|
---|
88 | } else
|
---|
89 | {
|
---|
90 | echo('<a href="TranslationList.php?group='.$GroupId.'&user=0&state=2&entry='.$Line['Entry'].'&text=">Počet verzí: <strong>'.$Version.'</strong></a>');
|
---|
91 | }
|
---|
92 |
|
---|
93 | // Speciální znaky: $B - Odřádkování, $N - Jméno, $C - povolání
|
---|
94 | echo('<form action="save.php?group='.$GroupId.'" method="post"><div>');
|
---|
95 | if($User->Licence(LICENCE_USER))
|
---|
96 | {
|
---|
97 | if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11)) echo('<a href="dictionary.php?group='.$GroupId.'&ID='.$LineAJ['ID'].'" target="_blank" title="Zobrazit přeložené názvy věci, postav, a herních objektů k tomuto překladu">Vyhledat v názvech</a>');
|
---|
98 | echo(' <input type="submit" value="Uložit do rozepsaných" name="save" title="Klikněte na uložit pro pozdější dokončení překladu" />
|
---|
99 | <input type="submit" value="Dokončeno" name="End" title="Klikněte na Dokončeno jesli jsou všechny texty hotové a chcete již publikovat" /> ');
|
---|
100 | FollowingTran($TextID, $Table, $GroupId, true);
|
---|
101 | FollowingTran($TextID, $Table, $GroupId);
|
---|
102 | }
|
---|
103 |
|
---|
104 | if($TranslationTree[$GroupId]['WowheadName'] != '')
|
---|
105 | $WowheadLink = '<a href="http://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName'].'='.$LineAJ['Entry'].'">'.$LineAJ['Entry'].'</a>';
|
---|
106 | else $WowheadLink = $LineAJ['Entry'];
|
---|
107 |
|
---|
108 | echo('<input type="hidden" name="entry" value="'.$LineAJ['Entry'].'" />
|
---|
109 | <input type="hidden" name="user" value="'.$User->Id.'" />
|
---|
110 | <input type="hidden" name="ID" value="'.$TextID.'" />
|
---|
111 | <table class="BaseTable">
|
---|
112 | <tr>
|
---|
113 | <th>Číslo textu: '.$WowheadLink.'</th>
|
---|
114 | <th>Nepřeložené</th>
|
---|
115 | <th>Přeložené</th>
|
---|
116 | </tr>
|
---|
117 | <tr>
|
---|
118 | <th>Jazyk</th>
|
---|
119 | <td>Anglický</td>
|
---|
120 | <td>
|
---|
121 | Přeloženo do:');
|
---|
122 | if($Line['Language'] <> 0) $Language = $Line['Language'];
|
---|
123 | else if($User->Id != 0)
|
---|
124 | {
|
---|
125 | $Language = $User->Language;
|
---|
126 | } else $Language = 0;
|
---|
127 | WriteLanguages($Language);
|
---|
128 | echo('</td></tr>');
|
---|
129 |
|
---|
130 | //zvýrazňování jmen
|
---|
131 | $Text = '';
|
---|
132 | foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
|
---|
133 | if($TextItem['Visible'] == 1)
|
---|
134 | $Text = $Text.' '.$LineAJ[$TextItem['Column']];
|
---|
135 |
|
---|
136 | if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11)) {
|
---|
137 | //<span class="edit">barvou.</span>
|
---|
138 | $names = GetTranslatNames($Text,0,array('Dictionary' => 'Text','TextCreature' => 'name'));
|
---|
139 | } else {
|
---|
140 | $names = GetTranslatNames($Text,0,array('Dictionary' => 'Text'));
|
---|
141 | }
|
---|
142 | //print_r($names);
|
---|
143 |
|
---|
144 | foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
|
---|
145 | if($TextItem['Visible'] == 1)
|
---|
146 | {
|
---|
147 | if(($LineAJ[$TextItem['Column']] <> '') or ($Line[$TextItem['Column']] <> ''))
|
---|
148 | {
|
---|
149 | if ($TextItem['Name'] == 'Text' AND (($Table == 'global_strings') OR ($Table == 'glue_strings'))) echo('<tr><th>'.$LineAJ['ShortCut'].'</th>');
|
---|
150 | else echo('<tr><th>'.$TextItem['Name'].'</th>');
|
---|
151 | echo('<td>'.str_replace("\n", '<br/>', ColorNames(htmlspecialchars($LineAJ[$TextItem['Column']]),$names)).'</td>
|
---|
152 | <td><textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'">'.htmlspecialchars($Line[$TextItem['Column']]).'</textarea></td></tr>');
|
---|
153 | }
|
---|
154 | } else
|
---|
155 | {
|
---|
156 | echo('<input id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'" type="hidden" value="'.htmlspecialchars($Line[$TextItem['Column']]).'" />');
|
---|
157 | }
|
---|
158 | echo('</table></div></form>');
|
---|
159 | } else
|
---|
160 | {
|
---|
161 | // include 'ListQuests.php';
|
---|
162 | echo('Nebylo zadáno ID <a href="index.php">zpět</a>');
|
---|
163 | }
|
---|
164 |
|
---|
165 | ShowFooter();
|
---|
166 |
|
---|
167 | ?>
|
---|
168 |
|
---|