Changeset 880 for trunk/Modules/Admin
- Timestamp:
- Apr 7, 2020, 10:15:48 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Admin/Admin.php
r859 r880 52 52 '<a href="'.$this->System->Link('/admin/?action=merge').'">Sjednocení textů</a><br/>'. 53 53 '<small>Sjednotí stejné originální texty v databázi</small><br/><br/>'; 54 return ($Output);54 return $Output; 55 55 } 56 56 … … 72 72 function ShowPHPInfo() 73 73 { 74 return (phpinfo());74 return phpinfo(); 75 75 } 76 76 … … 86 86 '<a href="'.$this->System->Link('/admin/?action=sqlerror').'">Chybný SQL dotaz</a><br/>'. 87 87 '<small>Vyvolá testovací chybu</small><br/><br/>'; 88 return ($Output);88 return $Output; 89 89 } 90 90 … … 103 103 ); 104 104 $Output = 'Questy: <br />'; 105 while ($quest = $DbResult->fetch_assoc())105 while ($quest = $DbResult->fetch_assoc()) 106 106 { 107 107 $Output .= $quest['ID'].', '; … … 109 109 } 110 110 $Output .= '<br / ><br / >Questy nastaveny jako nedokončené!'; 111 return ($Output);111 return $Output; 112 112 } 113 113 … … 117 117 118 118 $Output = ''; 119 foreach ($TranslationTree as $Group)119 foreach ($TranslationTree as $Group) 120 120 // $Group = $TranslationTree[1]; 121 121 { … … 130 130 $DbResult = $this->System->Database->query($sql); 131 131 echo ': <br />'.$Group['TablePrefix'].': <br />'; 132 while ($line = $DbResult->fetch_assoc())132 while ($line = $DbResult->fetch_assoc()) 133 133 { 134 134 echo ($line['ID'].', '); … … 138 138 echo '<br / >Verze '.$Group['TablePrefix'].' opraveny!'; 139 139 } 140 return ('Hotovo!');140 return 'Hotovo!'; 141 141 } 142 142 … … 145 145 $Text = strtolower($Text); 146 146 $Text = str_replace(' ', '', $Text); 147 return ($Text);147 return $Text; 148 148 } 149 149 … … 153 153 154 154 $Output = ''; 155 foreach ($TranslationTree as $Group)155 foreach ($TranslationTree as $Group) 156 156 // $Group = $TranslationTree[1]; 157 157 { … … 164 164 $DbResult = $this->System->Database->query($sql); 165 165 echo ': <br />'.$Group['TablePrefix'].': '; 166 while ($line = $DbResult->fetch_assoc())166 while ($line = $DbResult->fetch_assoc()) 167 167 { 168 168 $sql = 'SELECT * FROM `'.$Group['TablePrefix'] .'` as `T` '. … … 171 171 // echo $sql; 172 172 $DbResult2 = $this->System->Database->query($sql); 173 if ($DbResult2->num_rows > 0) {173 if ($DbResult2->num_rows > 0) { 174 174 $line2 = $DbResult2->fetch_assoc(); 175 175 176 176 $Same = true; 177 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) {177 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) { 178 178 if ($this->StripText($line[$Column['Column']]) <> $this->StripText($line2[$Column['Column']])) 179 179 $Same = false; … … 186 186 ' WHERE `T`.`Entry` = '.$line['Entry'].' AND (`T`.`Take` = '.$line['ID'].' OR `T`.`Take` = '.$line2['ID'].') '; 187 187 $DbResult3 = $this->System->Database->query($sql); 188 while ($line3 = $DbResult3->fetch_assoc()) {188 while ($line3 = $DbResult3->fetch_assoc()) { 189 189 echo $line3['ID'].' '; 190 190 $this->System->Database->query('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = '.$line2['VersionEnd'].', `VersionStart` = '.$line['VersionStart'].', `Take` = '.$line['ID'].' WHERE ID='.$line3['ID']); … … 199 199 echo('Texty '.$Group['TablePrefix'].' sjednoceny!'); 200 200 } 201 return ('Hotovo!');201 return 'Hotovo!'; 202 202 } 203 203 … … 224 224 $Group = $TranslationTree[$_GET['id']]; 225 225 // $Output .= '<form action="?action=dbcstructure&id='.$Group['Id'].'">'; 226 // foreach ($Group['Items'] as $GroupItem)226 // foreach ($Group['Items'] as $GroupItem) 227 227 // { 228 228 // $Output .= $GroupItem['Column'].': <input name="'.$GroupItem['Id'].'"><br />'; … … 236 236 $Group['DBCFileName'].'.dbc.csv'); 237 237 238 //while (!$File->EOF())238 //while (!$File->EOF()) 239 239 240 240 $Output .= '<table class="BaseTable">'; … … 248 248 $Output .= '</td></tr><tr><td>'; 249 249 for ($i = 0; $i < substr_count($Line, ','); $i++) { 250 foreach ($Group['Items'] as $GroupItem)250 foreach ($Group['Items'] as $GroupItem) 251 251 $Output .= ' <a href="'.$this->System->Link('/admin/?action=dbcstructure&id='. 252 252 $Group['Id'].'&GroupItem='.$GroupItem['Id'].'&ColumnIndex='.$i).'">'. … … 269 269 } else { 270 270 $DbResult = $this->System->Database->query('SELECT * FROM `ClientVersion`'); 271 while ($Version = $DbResult->fetch_assoc())271 while ($Version = $DbResult->fetch_assoc()) 272 272 { 273 273 $Output .= '<a href="'.$this->System->Link('/admin/?action=dbcstructure&GameVersion='. … … 276 276 $Output .= '<br /><br />'; 277 277 278 foreach ($TranslationTree as $Group)278 foreach ($TranslationTree as $Group) 279 279 { 280 280 if ($Group['DBCFileName'] <> '') … … 283 283 } 284 284 } 285 return ($Output);285 return $Output; 286 286 } 287 287 … … 291 291 $Output = 'Překlad rozhraní přegenerován'; 292 292 $Output .= '<table class="BaseTable"><tr><th>Originál</th><th>Překlad</th></tr>'; 293 foreach ($this->System->LocaleManager->CurrentLocale->Texts->Data as $Index => $Item)293 foreach ($this->System->LocaleManager->CurrentLocale->Texts->Data as $Index => $Item) 294 294 $Output .= '<tr><td>'.$Index.'</td><td>'.$Item.'</td></tr>'; 295 295 $Output .= '</table>'; 296 296 $Output .= 'Překladové soubory zaktualizovány'; 297 return ($Output);297 return $Output; 298 298 } 299 299 … … 302 302 $this->Title = T('Administration'); 303 303 $Output = ''; 304 if ($this->System->User->Licence(LICENCE_ADMIN))304 if ($this->System->User->Licence(LICENCE_ADMIN)) 305 305 { 306 if (array_key_exists('action', $_GET))306 if (array_key_exists('action', $_GET)) 307 307 { 308 if ($_GET['action'] == 'error') $Output .= $this->TestError(12, 'test');309 else if ($_GET['action'] == 'exception') $Output .= $this->TestException(12, 'test');310 else if ($_GET['action'] == 'sqlerror') $Output .= $this->TestSQLError('SELECT dads FROM sdas');311 else if ($_GET['action'] == 'testing') $Output .= $this->Testing();312 else if ($_GET['action'] == 'phpinfo') $Output .= $this->ShowPHPInfo();313 else if ($_GET['action'] == 'locale') $Output .= $this->ShowLocale();314 else if ($_GET['action'] == 'uncomplete') $Output .= $this->Uncomplete();315 else if ($_GET['action'] == 'repairversion') $Output .= $this->RepairVersionEnd();316 else if ($_GET['action'] == 'dbcstructure') $Output .= $this->DbcStructure();317 else if ($_GET['action'] == 'merge') $Output .= $this->MergeSameText();308 if ($_GET['action'] == 'error') $Output .= $this->TestError(12, 'test'); 309 else if ($_GET['action'] == 'exception') $Output .= $this->TestException(12, 'test'); 310 else if ($_GET['action'] == 'sqlerror') $Output .= $this->TestSQLError('SELECT dads FROM sdas'); 311 else if ($_GET['action'] == 'testing') $Output .= $this->Testing(); 312 else if ($_GET['action'] == 'phpinfo') $Output .= $this->ShowPHPInfo(); 313 else if ($_GET['action'] == 'locale') $Output .= $this->ShowLocale(); 314 else if ($_GET['action'] == 'uncomplete') $Output .= $this->Uncomplete(); 315 else if ($_GET['action'] == 'repairversion') $Output .= $this->RepairVersionEnd(); 316 else if ($_GET['action'] == 'dbcstructure') $Output .= $this->DbcStructure(); 317 else if ($_GET['action'] == 'merge') $Output .= $this->MergeSameText(); 318 318 else $Output .= $this->ShowMenu(); 319 319 } else $Output .= $this->ShowMenu(); 320 320 } else $Output .= ShowMessage(T('Access denied'), MESSAGE_CRITICAL); 321 return ($Output);321 return $Output; 322 322 } 323 323 }
Note:
See TracChangeset
for help on using the changeset viewer.