Changeset 894
- Timestamp:
- Mar 6, 2023, 12:16:38 PM (21 months ago)
- Location:
- trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Application/Version.php
r893 r894 7 7 8 8 $Version = '1.0'; 9 $Revision = 89 3; // Subversion revision9 $Revision = 894; // Subversion revision 10 10 $DatabaseRevision = 891; // Database structure revision 11 11 $ReleaseDate = strtotime('2023-03-06'); -
trunk/Application/View.php
r893 r894 3 3 class BaseView extends View 4 4 { 5 public string $Title ;5 public string $Title = ''; 6 6 7 7 function ShowLocaleSelector() 8 8 { 9 //$Output .= ' <form action="?setlocale" method="get">';10 9 $Output = ' <select onchange="window.location=this.value">'; 11 10 foreach (Core::Cast($this->System)->LocaleManager->Available as $Locale) … … 45 44 46 45 $Output .= $this->ShowLocaleSelector(); 47 //$Output .= '</form>';48 46 $Output .= '</span></div>'; 49 47 return $Output; -
trunk/Install/deb/debian/control
r881 r894 8 8 Package: wowpreklad 9 9 Architecture: all 10 Depends: ${shlibs:Depends}, ${misc:Depends}, apache2, php, dbconfig-mysql 10 Depends: ${shlibs:Depends}, ${misc:Depends}, apache2, php, dbconfig-mysql, nsis 11 11 Description: World of Warcraft web translation platform. 12 12 HomePage: https://app.zdechov.net/wowpreklad -
trunk/Modules/Admin/Admin.php
r893 r894 233 233 // $Output .= '<input type="submit" value="uložit"></form>'; 234 234 235 235 $FileName = NormalizePath(dirname(__FILE__).'/../source/'.$_SESSION['GameVersion'].'/dbc/'.$Group['DBCFileName'].'.dbc.csv'); 236 236 $File = new FileStream(); 237 238 $File->OpenFile(dirname(__FILE__).'/../source/'.$_SESSION['GameVersion'].'/dbc/'. 239 $Group['DBCFileName'].'.dbc.csv'); 237 $File->OpenFile($FileName); 240 238 241 239 //while (!$File->EOF()) … … 254 252 { 255 253 foreach ($Group['Items'] as $GroupItem) 254 { 256 255 $Output .= ' <a href="'.$this->System->Link('/admin/?action=dbcstructure&id='. 257 256 $Group['Id'].'&GroupItem='.$GroupItem['Id'].'&ColumnIndex='.$i).'">'. 258 257 $GroupItem['Column'].'</a><br/>'; 259 $Output .= '</td><td>'; 258 } 259 $Output .= '</td><td>'; 260 260 } 261 261 -
trunk/Modules/Export/CreateAddon.php
r893 r894 6 6 { 7 7 // Replace special codes by lua functions 8 function ReplaceVarInText( $string, $strlower = 'strlower')8 function ReplaceVarInText(string $string, string $strlower = 'strlower'): string 9 9 { 10 10 $string = str_replace('$N', '"..'.$strlower.'(UnitName("player")).."', $string); … … 47 47 } 48 48 49 function ReplaceEnText($string) 50 { 51 // $string = mysql_escape_string($string); 49 function ReplaceEnText(string $string): string 50 { 52 51 $string = strtolower($string); 53 54 52 $string = str_replace('"', '\"', $string); 55 53 $string = str_replace('$b$b', ' ', $string); … … 62 60 $string = str_replace('\\n', ' ', $string); 63 61 $string = str_replace(' ', '', $string); 64 // while (strpos($string, ' '))65 // $string = str_replace(' ', ' ', $string);66 62 return $string; 67 63 } 68 64 69 function ReplaceCzText( $string)65 function ReplaceCzText(string $string): string 70 66 { 71 67 $string = $this->Database->real_escape_string($string); … … 76 72 } 77 73 78 function NotCancel($string) 79 { 80 //echo (strpos($string,'<html>')); 74 function NotCancel(string $string): bool 75 { 81 76 if (strpos($string,'<html>') > -1) return false; 82 77 else return true; 83 78 } 84 79 85 function my_trim( $string)80 function my_trim(string $string): string 86 81 { 87 82 $string = addslashes($string); … … 99 94 } 100 95 101 function MakeLanguageFiles() 102 { 103 global $CreatedFileList; 104 96 function MakeLanguageFiles(): string 97 { 105 98 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree(); 106 99 … … 116 109 while ($Group = $DbResult->fetch_assoc()) 117 110 { 118 //získání čísla verze pro export111 // získání čísla verze pro export 119 112 $ID = $this->Database->query('SELECT LastVersion FROM `Group` WHERE Id = '.$Group['Id']); 120 113 $LastVersion = $ID->fetch_assoc(); … … 141 134 $TableTexts = array(); 142 135 143 // old version144 // get version before136 // old version 137 // get version before 145 138 $BuildNumber = $ExportVersion; 146 139 if ($ExportVersion == '') $BuildNumber = $this->ClientVersion['BuildNumber']; … … 152 145 $ExportVersionOld = $ExportVersionOld['BuildNumber']; 153 146 154 $DbResult2 = $this->Database->query($this->BuildQuery($Group, $ExportVersionOld));147 $DbResult2 = $this->Database->query($this->BuildQuery($Group, $ExportVersionOld)); 155 148 while ($Line = $DbResult2->fetch_assoc()) 156 149 { 157 $en = trim($this->ReplaceEnText($Line['En'.$Column['Column']])); 158 $cz = $this->ReplaceCzText($Line[$Column['Column']]); 150 $Text = $Line['En'.$Column['Column']]; 151 if ($Text == null) $Text = ''; 152 $en = trim($this->ReplaceEnText($Text)); 153 $Text = $Line[$Column['Column']]; 154 if ($Text == null) $Text = ''; 155 $cz = $this->ReplaceCzText($Text); 159 156 if (($en <> '') and ($cz <> '') and ($this->NotCancel($en))) 160 157 { … … 165 162 //last version 166 163 167 $DbResult2 = $this->Database->query($this->BuildQuery($Group, $ExportVersion));164 $DbResult2 = $this->Database->query($this->BuildQuery($Group, $ExportVersion)); 168 165 while ($Line = $DbResult2->fetch_assoc()) 169 166 { 170 $en = trim($this->ReplaceEnText($Line['En'.$Column['Column']])); 171 $cz = $this->ReplaceCzText($Line[$Column['Column']]); 167 $Text = $Line['En'.$Column['Column']]; 168 if ($Text == null) $Text = ''; 169 $en = trim($this->ReplaceEnText($Text)); 170 $Text = $Line[$Column['Column']]; 171 if ($Text == null) $Text = ''; 172 $cz = $this->ReplaceCzText($Text); 172 173 if (($en <> '') and ($cz <> '') and ($this->NotCancel($en))) 173 174 { … … 221 222 } 222 223 223 function MakeClientStrings() 224 function MakeClientStrings(): void 224 225 { 225 226 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree(); … … 232 233 233 234 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `Group`.`TablePrefix` != "" AND `Group`.`Id` = 14'); 234 //$Group = $DbResult->fetch_assoc();235 235 if ($DbResult->num_rows == 0) 236 236 $CanGenerated = '-1'; … … 255 255 } 256 256 257 function MakeAddon() 257 function MakeAddon(): string 258 258 { 259 259 if (!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true); … … 264 264 } 265 265 266 function MakeReadme() 266 function MakeReadme(): void 267 267 { 268 268 $DbResult = $this->Database->query('SELECT * FROM `CzWoWPackageVersion` ORDER BY `Date` DESC'); -
trunk/Modules/Export/Export.php
r893 r894 9 9 public int $Id; 10 10 public array $AnoNe = array('Ne', 'Ano'); 11 var $WhereLang; 12 var $WhereUsers; 13 var $SelectedUsers; 14 var $UserNames; 15 var $ClientVersion; 16 var $OrderByUserList; 11 public string $WhereLang; 12 public string $WhereUsers; 13 public string $UserNames; 14 public array $ClientVersion; 15 public string $OrderByUserList; 17 16 public string $TempDir; 18 17 public string $TempDirRelative; … … 23 22 function Init() 24 23 { 25 $this->TempDir = dirname(__FILE__).'/../../'.Core::Cast($this->System)->Config['Web']['TempFolder'].'Export/'.$this->Id.'/';24 $this->TempDir = NormalizePath(dirname(__FILE__).'/../../'.Core::Cast($this->System)->Config['Web']['TempFolder'].'Export/'.$this->Id.'/'); 26 25 if (!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true); 27 26 $this->TempDirRelative = Core::Cast($this->System)->Config['Web']['TempFolder'].'Export/'.$this->Id.'/'; 28 $this->SourceDir = dirname(__FILE__).'/../../'.Core::Cast($this->System)->Config['Web']['SourceFolder'];27 $this->SourceDir = NormalizePath(dirname(__FILE__).'/../../'.Core::Cast($this->System)->Config['Web']['SourceFolder']); 29 28 $this->SourceDirRelative = Core::Cast($this->System)->Config['Web']['SourceFolder']; 30 29 if (!file_exists($this->SourceDir)) mkdir($this->SourceDir, 0777, true); … … 131 130 } 132 131 133 function NeedGeneration() 132 function NeedGeneration(): bool 134 133 { 135 134 $this->LoadFilters(); 136 $file = ''; 137 if ($this->Export['OutputType'] == 10) $file = $this->TempDir.'Instalace_CzechWoW_'.$this->ClientVersion['Version'].'.exe'; 138 if ($this->Export['OutputType'] == 9) $file = $this->TempDir.'CzWoW_DBC.zip'; 139 140 if (file_exists($file)) 141 $date = date('Y-m-d H:i',(filemtime($file))); 135 $FileName = ''; 136 if ($this->Export['OutputType'] == 10) $FileName = $this->TempDir.'Instalace_CzechWoW_'.$this->ClientVersion['Version'].'.exe'; 137 if ($this->Export['OutputType'] == 9) $FileName = $this->TempDir.'CzWoW_DBC.zip'; 138 139 if (file_exists($FileName)) 140 { 141 $Date = date('Y-m-d H:i',(filemtime($FileName))); 142 } 142 143 else return true; 143 144 144 145 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` '. 145 146 'JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id); 146 $ result = false;147 $Result = false; 147 148 while ($Group = $DbResult->fetch_assoc()) 148 149 { … … 151 152 ' JOIN `User` ON `User`.`ID`=`T`.`User`'. 152 153 ' JOIN `ExportLanguage` ON (`ExportLanguage`.`Export`='.$this->Id.')'. 153 ' WHERE ( \''.$ date.'\' < `T`.`ModifyTime`) AND (`Complete` = 1) AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].')'.154 ' WHERE ( \''.$Date.'\' < `T`.`ModifyTime`) AND (`Complete` = 1) AND (`VersionStart` <= '.$this->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$this->ClientVersion['BuildNumber'].')'. 154 155 ' '; 155 156 … … 157 158 if ($DbResult2->num_rows > 0) 158 159 { 159 $ result = true;160 } 161 } 162 return $ result;160 $Result = true; 161 } 162 } 163 return $Result; 163 164 } 164 165 … … 206 207 { 207 208 if ($GroupItem['MangosColumn'] == '') $GroupItem['MangosColumn'] = $GroupItem['Column']; 208 $Values .= ', `'.$GroupItem['MangosColumn'].'`="'.addslashes($Line[$GroupItem['Column']]).'"'; 209 $Text = $Line[$GroupItem['Column']]; 210 if ($Text == null) $Text = ''; 211 $Values .= ', `'.$GroupItem['MangosColumn'].'`="'.addslashes($Text).'"'; 209 212 } 210 213 $Values = substr($Values, 2); … … 328 331 } 329 332 330 function ExportToDBC() 333 function ExportToDBC(): string 331 334 { 332 335 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree(); 333 334 336 $this->LoadFilters(); 335 336 337 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` '. 337 338 'JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` '. … … 342 343 $this->AddProgress(2); 343 344 $Output .= $Group['Name'].', '; 344 if (file_exists($this->SourceDir.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc')) 345 346 $SourceDbcFileName = $this->SourceDir.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc'; 347 if (file_exists($SourceDbcFileName)) 345 348 { 346 349 // Load string column index list … … 364 367 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) 365 368 { 366 $DbRow[$Column['Column']] = str_replace ('$ ', '$', $DbRow[$Column['Column']]); 367 if (!$this->HaveVariable($DbRow['En'.$Column['Column']], $DbRow[$Column['Column']])) 369 if ($DbRow[$Column['Column']] != null) 370 { 371 $DbRow[$Column['Column']] = str_replace('$ ', '$', $DbRow[$Column['Column']]); 372 } 373 $EnText = $DbRow['En'.$Column['Column']]; 374 if ($EnText == null) $EnText = ''; 375 $TargetText = $DbRow[$Column['Column']]; 376 if ($TargetText == null) $TargetText = ''; 377 if (!$this->HaveVariable($EnText, $TargetText)) 368 378 { 369 379 $CanExport = false; 370 380 $Output .= ', NE='.$DbRow['ID']; 371 381 } 372 if (!$this->HaveVariable($ DbRow[$Column['Column']], $DbRow['En'.$Column['Column']]))382 if (!$this->HaveVariable($TargetText, $EnText)) 373 383 { 374 384 $CanExport = false; … … 383 393 // Open original DBC file 384 394 $SourceDBCFile = new DBCFile(); 385 $SourceDBCFile->OpenFile($ this->SourceDir.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc', $ColumnFormat);395 $SourceDBCFile->OpenFile($SourceDbcFileName, $ColumnFormat); 386 396 387 397 // Create new DBC file 388 if (!file_exists($this->TempDir.'dbc/')) mkdir($this->TempDir.'dbc/', 0777, true); 398 $DbcDir = $this->TempDir.'dbc/'; 399 if (!file_exists($DbcDir)) mkdir($DbcDir, 0777, true); 389 400 $NewDBCFile = new DBCFile(); 390 $NewDBCFile->CreateFile($ this->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc', $ColumnFormat);401 $NewDBCFile->CreateFile($DbcDir.$Group['DBCFileName'].'.dbc', $ColumnFormat); 391 402 $NewDBCFile->SetRecordCount($SourceDBCFile->GetRecordCount()); 392 403 $NewDBCFile->SetFieldCount($SourceDBCFile->GetFieldCount()); … … 436 447 } 437 448 $NewDBCFile->Commit(); 438 } else $Output .= ShowMessage('Zdrojový soubor '.$ this->SourceDirRelative.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc'.' nenalezen.'."\n", MESSAGE_CRITICAL);449 } else $Output .= ShowMessage('Zdrojový soubor '.$SourceDbcFileName.' nenalezen.'."\n", MESSAGE_CRITICAL); 439 450 } 440 451 $Output .= 'Hotovo <br />'; … … 442 453 } 443 454 444 function ExportToLua() 455 function ExportToLua(): string 445 456 { 446 457 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree(); … … 449 460 450 461 $Output = ''; 451 if (!file_exists($this->TempDir.'lua/')) mkdir($this->TempDir.'lua/', 0777, true); 462 $LuaDir = $this->TempDir.'lua/'; 463 if (!file_exists($LuaDir)) mkdir($LuaDir, 0777, true); 452 464 $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `Group`.`LuaFileName` != ""'); 453 465 while ($Group = $DbResult->fetch_assoc()) 454 466 { 455 467 $this->AddProgress(1); 456 // $this->AddProgress();457 468 $Output .= $Group['Name'].'... '; 458 469 $File = new FileStream(); 459 if (!file_exists($this->SourceDir.$this->ClientVersion['Version'].'/lua/'.$Group['LuaFileName'].'.lua')) 470 $SourceLuaFileName = $this->SourceDir.$this->ClientVersion['Version'].'/lua/'.$Group['LuaFileName'].'.lua'; 471 if (!file_exists($SourceLuaFileName)) 472 { 460 473 continue; 461 $File->OpenFile($this->SourceDir.$this->ClientVersion['Version'].'/lua/'.$Group['LuaFileName'].'.lua'); 474 } 475 $File->OpenFile($SourceLuaFileName); 462 476 $File2 = new FileStream(); 463 $File2->CreateFile($ this->TempDir.'lua/'.$Group['LuaFileName'].'.lua');477 $File2->CreateFile($LuaDir.$Group['LuaFileName'].'.lua'); 464 478 465 479 $LookupTable = array(); … … 722 736 if ($this->Export['WithDiacritic'] != 1) $Buffer = utf2ascii($Buffer); 723 737 $Buffer .= " </translation>\n". 724 "</document>";738 '</document>'; 725 739 return $Buffer; 726 740 } -
trunk/Modules/Export/ExportOutput.php
r893 r894 213 213 if ($DbResult->num_rows == 0) 214 214 { 215 $System->Database->query('INSERT INTO `ExportTask` (`Export` ,`TimeQueued` ) VALUES ('.$ExportId.', NOW())');215 $System->Database->query('INSERT INTO `ExportTask` (`Export` ,`TimeQueued`, `Progress` ) VALUES ('.$ExportId.', NOW(), 0)'); 216 216 $System->ModuleManager->Modules['Log']->WriteLog('Zadání úlohy pro vygenerování DBC souboru', LOG_TYPE_DOWNLOAD); 217 217 $System->Database->query('UPDATE `ExportTask` SET `Progress`=0 WHERE `Export`='.$Export->Id); -
trunk/Modules/Export/Page.php
r893 r894 39 39 40 40 $Output .= '<h3>'.T('List of export').'</h3>'. 41 41 $PageList['Output']; 42 42 43 43 $TableColumns = array( 44 45 46 47 48 49 50 51 52 44 array('Name' => 'TimeCreate', 'Title' => T('Time made')), 45 array('Name' => 'UserName', 'Title' => T('Translator')), 46 array('Name' => 'Title', 'Title' => T('Name od export')), 47 // array('Name' => 'UserCount', 'Title' => 'Vybraných překladatelů'), 48 // array('Name' => 'GroupCount', 'Title' => 'Překladových skupin'), 49 array('Name' => 'OutputType', 'Title' => T('Type of output')), 50 array('Name' => 'ClientVersion', 'Title' => T('Client version')), 51 array('Name' => 'UsedCount', 'Title' => T('Viewed count')), 52 array('Name' => '', 'Title' => T('Action')), 53 53 ); 54 54 $Order = GetOrderTableHeader($TableColumns, 'TimeCreate', 1); 55 55 $Output .= '<table class="BaseTable">'. 56 56 $Order['Output']; 57 57 58 58 $DbResult = $this->System->Database->query('SELECT `User`.`Name` AS `UserName`, `Export`.`Id`, `Export`.`TimeCreate`, `Export`.`Title`, `Export`.`User`, `Export`.`UsedCount`, '. … … 70 70 if ($User->Id != null) $Action .= ' <a href="?Action=Clone&ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Realy clone item?').'\');">'.T('Clone').'</a>'; 71 71 $Output .= '<tr><td>'.HumanDate($Export['TimeCreate']).'</td>'. 72 73 74 75 76 77 72 '<td><a href="'.$this->System->Link('/user/?user='.$Export['User']).'">'.$Export['UserName'].'</a></td>'. 73 '<td>'.htmlspecialchars($Export['Title']).'</td>'. 74 '<td>'.$Export['OutputType'].'</td>'. 75 '<td><a href="'.$this->System->Link('/client-version/?action=item&id='.$Export['ClientVersionId']).'">'.$Export['ClientVersion'].'</a></td>'. 76 '<td>'.$Export['UsedCount'].'</td>'. 77 '<td>'.$Action.'</td></tr>'; 78 78 } 79 79 $Output .= '</table>'. 80 80 $PageList['Output']; 81 81 82 82 return $Output; … … 93 93 { 94 94 $Output = '<form action="?Action=CreateFinish" method="post">'. 95 96 97 98 99 95 '<fieldset><legend>'.T('Creation of new export').'</legend>'. 96 '<table><tr><td>'.T('Identification').':</td><td><input type="text" name="Title" /></td></tr>'. 97 '<tr><td>'.T('Description').':</td><td><textarea name="Description" cols="54" rows="10"></textarea></td></tr>'. 98 '<tr><td colspan="2"><input type="submit" value="'.T('Create').'" /></td></tr>'. 99 '</table></fieldset></form>'; 100 100 } else $Output = ShowMessage(sprintf(T('You can\'t create another export. Max for one user is %d.'), Core::Cast($this->System)->Config['MaxExportPerUser']), MESSAGE_CRITICAL); 101 101 } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL); … … 152 152 function SaveAllUsers() 153 153 { 154 global $System; 155 $Export = new Export($System); 156 $Export->Id = $_GET['ExportId']; 157 $Export->SaveAllUsers(); 158 154 $Export = new Export($this->System); 155 $Export->Id = $_GET['ExportId']; 156 $Export->SaveAllUsers(); 159 157 } 160 158 … … 162 160 { 163 161 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 164 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();165 162 166 163 $Output = ''; … … 174 171 { 175 172 if ($_POST['Operation'] == 'Save') 176 { 177 //print_r($_POST); 173 { 178 174 // Update user selection page 179 175 foreach ($_POST as $Index => $Value) … … 197 193 } 198 194 199 if (array_key_exists('AllUsers', $_POST)) { 200 //add allusers to export 201 $this->System->Database->query('UPDATE `Export` SET `AllUsers`=1 WHERE `Id`='.$_GET['ExportId']); 202 203 //update export stat 204 $Export['AllUsers'] = 1; 205 $this->SaveAllUsers(); 206 } else { 207 //update export stat 208 $Export['AllUsers'] = 0; 209 $this->System->Database->query('UPDATE `Export` SET `AllUsers`=0 WHERE `Id`='.$_GET['ExportId']); 210 } 195 if (array_key_exists('AllUsers', $_POST)) 196 { 197 //add allusers to export 198 $this->System->Database->query('UPDATE `Export` SET `AllUsers`=1 WHERE `Id`='.$_GET['ExportId']); 199 200 //update export stat 201 $Export['AllUsers'] = 1; 202 $this->SaveAllUsers(); 203 } else 204 { 205 //update export stat 206 $Export['AllUsers'] = 0; 207 $this->System->Database->query('UPDATE `Export` SET `AllUsers`=0 WHERE `Id`='.$_GET['ExportId']); 208 } 211 209 212 210 // Recalculate sequence number … … 218 216 219 217 $TableColumns = array( 220 221 222 223 224 225 218 array('Name' => 'Name', 'Title' => T('Name')), 219 array('Name' => 'TranslatedCount', 'Title' => T('Translated count')), 220 array('Name' => 'XP', 'Title' => T('Level')), 221 array('Name' => 'XP', 'Title' => T('Experience')), 222 array('Name' => '', 'Title' => T('Select')), 223 array('Name' => 'Sequence2', 'Title' => T('Order')), 226 224 ); 227 225 $Order = GetOrderTableHeader($TableColumns, 'TranslatedCount', 1); 228 226 if ($Order['Column'] != 'Sequence2') $InitialOrder = ', '.substr($Order['SQL'], 10); 229 else $InitialOrder = '';227 else $InitialOrder = ''; 230 228 231 229 $Query = 'SELECT (@I := @I + 1) AS `Sequence2`, `TT`.* FROM (SELECT `ExportUser`.`Sequence`, `T`.`ID`, `T`.`TranslatedCount`, `T`.`Name`, `T`.`XP` FROM (SELECT `User`.`ID`, `User`.`Name`, `User`.`XP`, `TranslatedCount` FROM `User`) AS T'; … … 238 236 239 237 $Output .= '<form name="Translators" action="?Action=View&ExportId='.$_GET['ExportId'].'" method="post">'. 240 238 '<h3>'.T('Translators').'</h3>'; 241 239 if ($Editable) 242 240 { 243 241 $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'. 244 245 246 247 248 249 242 '<input type="hidden" name="Operation" value="Save"/><br />'. 243 ' <span onclick="CheckAllCheckbox();">'.CheckBox('CheckAll', False, 'CheckAll').' '.T('Select all on page').'</span> <br />'. 244 ' <span>'.CheckBox('AllUsers', $Export['AllUsers']).' '.T('Export allways from all users').'</span> '. 245 '<br />'. 246 T('Select users from list which you want to export from. And edit their order.').'<br />'. 247 T('Order is done by numeric value which is can be edit to desirable order. Lines with same number will be renumbered in ascending order.'); 250 248 } 251 249 … … 264 262 $Sequence = '<input type="text" name="seq'.$UserLine['ID'].'" style="text-align: center; width: 40px;" value="'.$UserLine['Sequence2'].'"'.$DisabledInput[$Editable].'/>'; 265 263 $Output .= '<tr>'. 266 267 268 269 270 264 '<td><a href="'.$this->System->Link('/TranslationList.php?user='.$UserLine['ID'].'&state=2&group=0').'" title="Zobrazit všechny jeho přeložené texty">'.$UserLine['Name'].'</a></td>'. 265 '<td>'.$UserLine['TranslatedCount'].'</td>'. 266 '<td>'.$XP['Level'].'</td>'. 267 '<td>'.ProgressBar(150, round($XP['XP'] / $XP['MaxXP'] * 100, 2), $XP['XP'].' / '.$XP['MaxXP']).'</td>'. 268 '<td>'.$Selection.'</td><td>'.$Sequence.'</td></tr>'; 271 269 } 272 270 $Output .= '</table>'. 273 274 271 '</form>'. 272 $PageList['Output']; 275 273 return $Output; 276 274 } … … 288 286 289 287 if (array_key_exists('Operation', $_POST)) 288 { 290 289 if ($_POST['Operation'] == 'Save') if ($Editable and array_key_exists('Title', $_POST) and array_key_exists('Description', $_POST)) 291 290 { … … 301 300 $Output .= ShowMessage('Nastavení uloženo.'); 302 301 } 303 304 if ($Export['WithDiacritic'] == 1) $WithDiacritic = ' checked="checked"'; 302 } 303 304 if ($Export['WithDiacritic'] == 1) $WithDiacritic = ' checked="checked"'; 305 305 else $WithDiacritic = ''; 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 306 $Output .= '<form action="?Action=View&Tab=0&ExportId='.$Export['Id'].'" method="post">'. 307 '<table>'; 308 if ($User->Id != null) 309 { 310 $Output .= '<input type="hidden" name="Operation" value="Save"/>'. 311 '<tr><td colspan="2">'; 312 if ($Editable) $Output .= ' <input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'; 313 $Output .= ' <a href="?Action=Clone&ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Realy clone item?').'\');">'.T('Clone').'</a> '; 314 if ($User->Licence(LICENCE_ADMIN)) 315 $Output .= CheckBox('Featured', $Export['Featured'], '', 'CheckBox', !$Editable). ' '.T('Recommended').' '; 316 $Output .= '</td></tr>'; 317 } 318 $Output .= '<tr><td>'.T('Identification').':</td><td><input type="text" style="width: 400px" name="Title" value="'.htmlspecialchars($Export['Title']).'"'.$DisabledInput[$Editable].'/></td></tr>'. 319 '<tr><td>'.T('Description').':</td><td><textarea name="Description" cols="54" rows="10"'.$DisabledTextArea[$Editable].'>'.htmlspecialchars($Export['Description']).'</textarea></td></tr>'. 320 '<tr><td>'.T('With diacritics').'</td><td><input type="checkbox" name="WithDiacritic" '.$WithDiacritic.''.$DisabledInput[$Editable].'/></td></tr>'. 321 '</table></form>'; 322 return $Output; 323 323 } 324 324 … … 326 326 { 327 327 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 328 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();329 328 330 329 $Output = ''; … … 339 338 if ($_POST['Operation'] == 'Save') 340 339 { 341 //print_r($_POST);342 340 // Update user selection page 343 341 foreach ($_POST as $Index => $Value) … … 377 375 378 376 $TableColumns = array( 379 380 381 377 array('Name' => 'Name', 'Title' => T('Name')), 378 array('Name' => '', 'Title' => T('Select')), 379 array('Name' => 'Sequence2', 'Title' => T('Order')), 382 380 ); 383 381 $Order = GetOrderTableHeader($TableColumns, 'Sequence2'); … … 394 392 395 393 $Output .= $PageList['Output']. 396 '<table class="BaseTable">'.394 '<table class="BaseTable">'. 397 395 $Order['Output']; 398 396 … … 410 408 } 411 409 $Output .= '</table>'. 412 413 410 '</form>'. 411 $PageList['Output']; 414 412 return $Output; 415 413 } … … 425 423 $Export = $DbRows->fetch_assoc(); 426 424 if ($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true; 427 else $Editable = false;425 else $Editable = false; 428 426 429 427 if (array_key_exists('Operation', $_POST)) 430 428 { 431 429 if ($_POST['Operation'] == 'Save') 432 { 433 //print_r($_POST); 430 { 434 431 // Update user selection page 435 432 foreach ($_POST as $Index => $Value) … … 459 456 if (array_key_exists('item'.$Column['Id'], $_POST)) $Selected = true; 460 457 else $Selected = false; 461 // we will save only forbitten collums and need to be visible458 // we will save only forbitten collums and need to be visible 462 459 $Selected = !$Selected; 463 460 if (!$Column['Visible']) $Selected = false; 464 461 465 $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `GroupItem`='.$Column['Id']; 466 $DbResult = $this->System->Database->query('SELECT * FROM `ExportGroupItem` '.$Condition); 467 if ($DbResult->num_rows > 0) 468 { 469 if (!$Selected) $this->System->Database->query('DELETE FROM `ExportGroupItem` '.$Condition); 470 } else 471 { 472 if ($Selected) $this->System->Database->query('INSERT INTO `ExportGroupItem` (`Export`, `GroupItem`) VALUES ('.$_GET['ExportId'].', '.$Column['Id'].')'); 473 } 474 462 $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `GroupItem`='.$Column['Id']; 463 $DbResult = $this->System->Database->query('SELECT * FROM `ExportGroupItem` '.$Condition); 464 if ($DbResult->num_rows > 0) 465 { 466 if (!$Selected) $this->System->Database->query('DELETE FROM `ExportGroupItem` '.$Condition); 467 } else 468 { 469 if ($Selected) $this->System->Database->query('INSERT INTO `ExportGroupItem` (`Export`, `GroupItem`) VALUES ('.$_GET['ExportId'].', '.$Column['Id'].')'); 470 } 475 471 } 476 472 } … … 484 480 485 481 $TableColumns = array( 486 487 488 489 // 490 // 491 482 array('Name' => '', 'Title' => T('Select')), 483 array('Name' => 'Name', 'Title' => T('Name')), 484 array('Name' => 'MangosTable', 'Title' => 'Mangos/DBC/Lua'), 485 // array('Name' => 'DBCFileName', 'Title' => 'DBC soubor'), 486 // array('Name' => 'LuaFileName', 'Title' => 'Lua soubor'), 487 array('Name' => '', 'Title' => T('Items of translation')), 492 488 ); 493 489 $Order = GetOrderTableHeader($TableColumns, 'Name'); 494 490 $Output .= '<form action="?Action=View&ExportId='.$_GET['ExportId'].'" method="post">'. 495 491 '<h3>'.T('Translation groups').'</h3>'; 496 492 if ($Editable) 497 493 { 498 494 $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'. 499 500 501 502 495 '<input type="hidden" name="Operation" value="Save"/>'. 496 ' <span onclick="CheckAllCheckbox();">'.CheckBox('CheckAll', False, 'CheckAll').' '.T('Select all').'</span> '. 497 '<br />'. 498 T('Select translation groups witch you want to export.').'<br />'; 503 499 } 504 500 … … 518 514 { 519 515 $Columns = ''; 520 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) { 516 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) 517 { 521 518 if ($Column['Visible']) $Columns .= CheckBox('item'.$Column['Id'], 522 519 !isset($GroupItems[$Column['Id']]), '', 'CheckBox', !$Editable).' '.T($Column['Name']).' <br/>'; … … 525 522 $Selection = CheckBox('sel'.$Group['Id'], $Checked, '', 'CheckBox', !$Editable); 526 523 $Output .= '<tr>'. 527 528 529 530 531 532 533 534 524 '<td>'.$Selection.'<input type="hidden" name="seq'.$Group['Id'].'"/></td>'. 525 '<td>'.T($Group['Name']).'</td><td>'; 526 if ($Group['MangosTable'] <> '') 527 $Output .= $Group['MangosTable'].'.sql '; 528 if ($Group['LuaFileName'] <> '') 529 $Output .= $Group['LuaFileName'].'.lua '; 530 if ($Group['DBCFileName'] <> '') 531 $Output .= $Group['DBCFileName'].'.dbc '; 535 532 536 533 $Output .= '</td><td>'; … … 556 553 $Export = $DbRows->fetch_assoc(); 557 554 if ($User->Licence(LICENCE_USER) and ($User->Id == $Export['User'])) $Editable = true; 558 else $Editable = false;555 else $Editable = false; 559 556 560 557 if (array_key_exists('Operation', $_POST)) 558 { 561 559 if ($_POST['Operation'] == 'Save') 562 560 { … … 567 565 } else $Output .= ShowMessage(T('Format wasn\'t selected'), MESSAGE_CRITICAL); 568 566 } 569 570 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 571 $Export = $DbResult->fetch_assoc(); 572 573 $Output .= '<h3>'.T('Format the generated output').'</h3>'. 574 '<form action="?Action=View&ExportId='.$_GET['ExportId'].'" method="post">'; 575 if ($Editable) 576 { 577 $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'. 578 '<input type="hidden" name="Operation" value="Save"/>'. 579 '<br />'; 580 } 581 $DbResult = $this->System->Database->query('SELECT * FROM `ExportOutputType` ORDER BY `Name`'); 582 while ($ExportFormat = $DbResult->fetch_assoc()) 583 { 584 $Output .= RadioButton('OutputType', $ExportFormat['Id'], $Export['OutputType'] == $ExportFormat['Id'], '', !$Editable).' '.$ExportFormat['Name'].'<br/>'; 585 } 586 $Output .= '</form>'; 567 } 568 569 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 570 $Export = $DbResult->fetch_assoc(); 571 572 $Output .= '<h3>'.T('Format the generated output').'</h3>'. 573 '<form action="?Action=View&ExportId='.$_GET['ExportId'].'" method="post">'; 574 if ($Editable) 575 { 576 $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'. 577 '<input type="hidden" name="Operation" value="Save"/>'. 578 '<br />'; 579 } 580 $DbResult = $this->System->Database->query('SELECT * FROM `ExportOutputType` ORDER BY `Name`'); 581 while ($ExportFormat = $DbResult->fetch_assoc()) 582 { 583 $Output .= RadioButton('OutputType', $ExportFormat['Id'], $Export['OutputType'] == $ExportFormat['Id'], '', !$Editable).' '.$ExportFormat['Name'].'<br/>'; 584 } 585 $Output .= '</form>'; 587 586 } else $Output .= ShowMessage(T('Item not found'), MESSAGE_CRITICAL); 588 587 } else $Output .= ShowMessage(T('Is isn\'t select'), MESSAGE_CRITICAL); … … 601 600 602 601 if (array_key_exists('Operation', $_POST)) 602 { 603 603 if (($_POST['Operation'] == 'Save') and (array_key_exists('ClientVersion', $_POST))) 604 604 { … … 606 606 $Output .= ShowMessage(T('Select saved.')); 607 607 } 608 609 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 610 $Export = $DbResult->fetch_assoc(); 611 612 if ($Export['OutputType'] == '') $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL); 613 else { 614 $Query = 'SELECT `ClientVersion`.* FROM `ExportVersion` '. 615 'LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType']; 616 617 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS `X`'); 618 $DbRow = $DbResult->fetch_row(); 619 $PageList = GetPageList($DbRow[0]); 620 621 $TableColumns = array( 622 array('Name' => 'Version', 'Title' => T('Version')), 623 array('Name' => 'BuildNumber', 'Title' => T('Build')), 624 array('Name' => 'ReleaseDate', 'Title' => T('Release date')), 625 array('Name' => 'Title', 'Title' => T('Name2')), 626 array('Name' => '', 'Title' => T('Select')), 627 ); 628 $Order = GetOrderTableHeader($TableColumns, 'BuildNumber', 1); 629 $Output .= '<form action="?Action=View&ExportId='.$_GET['ExportId'].'" method="post">'. 630 '<h3>'.T('Client version').'</h3>'; 631 632 if ($Editable) 633 { 634 $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'. 635 '<input type="hidden" name="Operation" value="Save"/>'. 636 '<br />'. 637 T('Select version of game client witch you want to export.').'<br />'; 638 } 639 $Output .= $PageList['Output']. 640 '<table class="BaseTable">'. 641 $Order['Output']; 642 643 $Query = 'SELECT * FROM ('.$Query.') AS `TX` '.$Order['SQL'].$PageList['SQLLimit']; 644 $DbResult = $this->System->Database->query($Query); 645 while ($Version = $DbResult->fetch_assoc()) 646 { 647 $Output .= '<tr><td><a href="'.$this->System->Link('/client-version/?action=item&id='.$Version['Id']).'">'. 648 $Version['Version'].'</a></td><td>'.$Version['BuildNumber'].'</td><td>'. 649 HumanDate($Version['ReleaseDate']).'</td><td>'.$Version['Title'].'</td><td>'. 650 RadioButton('ClientVersion', $Version['Id'], $Export['ClientVersion'] == $Version['Id'], '', !$Editable 651 ).'</td></tr>'; 652 653 } 654 $Output .= '</table>'. 655 '</form>'. 656 $PageList['Output']; 657 } 658 return $Output; 608 } 609 610 $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']); 611 $Export = $DbResult->fetch_assoc(); 612 613 if ($Export['OutputType'] == '') 614 { 615 $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL); 616 } else 617 { 618 $Query = 'SELECT `ClientVersion`.* FROM `ExportVersion` '. 619 'LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id`=`ExportVersion`.`ClientVersion` WHERE `ExportType`='.$Export['OutputType']; 620 621 $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS `X`'); 622 $DbRow = $DbResult->fetch_row(); 623 $PageList = GetPageList($DbRow[0]); 624 625 $TableColumns = array( 626 array('Name' => 'Version', 'Title' => T('Version')), 627 array('Name' => 'BuildNumber', 'Title' => T('Build')), 628 array('Name' => 'ReleaseDate', 'Title' => T('Release date')), 629 array('Name' => 'Title', 'Title' => T('Name2')), 630 array('Name' => '', 'Title' => T('Select')), 631 ); 632 $Order = GetOrderTableHeader($TableColumns, 'BuildNumber', 1); 633 $Output .= '<form action="?Action=View&ExportId='.$_GET['ExportId'].'" method="post">'. 634 '<h3>'.T('Client version').'</h3>'; 635 636 if ($Editable) 637 { 638 $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'. 639 '<input type="hidden" name="Operation" value="Save"/>'. 640 '<br />'. 641 T('Select version of game client witch you want to export.').'<br />'; 642 } 643 $Output .= $PageList['Output']. 644 '<table class="BaseTable">'. 645 $Order['Output']; 646 647 $Query = 'SELECT * FROM ('.$Query.') AS `TX` '.$Order['SQL'].$PageList['SQLLimit']; 648 $DbResult = $this->System->Database->query($Query); 649 while ($Version = $DbResult->fetch_assoc()) 650 { 651 $Output .= '<tr><td><a href="'.$this->System->Link('/client-version/?action=item&id='.$Version['Id']).'">'. 652 $Version['Version'].'</a></td><td>'.$Version['BuildNumber'].'</td><td>'. 653 HumanDate($Version['ReleaseDate']).'</td><td>'.$Version['Title'].'</td><td>'. 654 RadioButton('ClientVersion', $Version['Id'], $Export['ClientVersion'] == $Version['Id'], '', !$Editable 655 ).'</td></tr>'; 656 } 657 $Output .= '</table>'. 658 '</form>'. 659 $PageList['Output']; 660 } 661 return $Output; 659 662 } 660 663 … … 666 669 if ($Export['OutputType'] == '') $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL); 667 670 else if ($Export['ClientVersion'] == '') $Output .= ShowMessage(T('Export don\'t have selected version of client'), MESSAGE_CRITICAL); 668 else { 671 else 672 { 669 673 $DbResult = $this->System->Database->query('SELECT * FROM `ExportOutputType` WHERE `Id`='.$Export['OutputType']); 670 674 if ($DbResult->num_rows > 0) … … 691 695 if (($Export->Export['ClientVersion'] == '') or ($Export->ClientVersion['BuildNumber'] == '')) 692 696 $Output = ShowMessage(T('Export don\'t have selected version of client'), MESSAGE_CRITICAL); 693 else { 697 else 698 { 694 699 $GroupListQuery = 'SELECT `Group`.* FROM `Group` '. 695 700 ' JOIN `ExportGroup` ON (`ExportGroup`.`Export`='.$Export->Id.') AND (`ExportGroup`.`Group`=`Group`.`Id`)'; 696 701 $Query = ''; 697 702 $UnionItems = array(); … … 700 705 { 701 706 $UnionItems[] = 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 702 703 704 705 706 707 708 709 710 707 ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 708 ' JOIN `ExportUser` ON (`ExportUser`.`User`=`T`.`User`) AND (`ExportUser`.`Export`='.$Export->Id.') '. 709 ' JOIN `ExportLanguage` ON (`ExportLanguage`.`Export`='.$Export->Id.')'. 710 ' WHERE (`Complete` = 1) AND (`VersionStart` <= '.$Export->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$Export->ClientVersion['BuildNumber'].')'. 711 ') AS `C1`) AS `Translated`, '. 712 '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('. 713 ' SELECT `T`.* FROM `'.$DbRow['TablePrefix'].'` AS `T`'. 714 ' WHERE (`Language` = '.Core::Cast($this->System)->Config['OriginalLanguage'].') AND (`VersionStart` <= '.$Export->ClientVersion['BuildNumber'].') AND (`VersionEnd` >= '.$Export->ClientVersion['BuildNumber'].')'. 715 ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name`'; 711 716 } 712 717 $Query = substr($Query, 0, - 6); -
trunk/Modules/Export/ProcessTask.php
r890 r894 37 37 { 38 38 if (file_exists($dst)) $this->DeleteOldFiles($dst); 39 if (is_dir($src)) { 39 if (is_dir($src)) 40 { 40 41 if (!file_exists($dst)) mkdir($dst, 0777, true); 41 42 $files = scandir($src); 42 43 foreach ($files as $file) 43 if ($file != "." and $file != ".." and (!is_dir($src.'/'.$file))) $this->rcopy($src.'/'.$file, $dst.'/'.$file); 44 { 45 if (($file != ".") and ($file != "..") and (!is_dir($src.'/'.$file))) 46 $this->rcopy($src.'/'.$file, $dst.'/'.$file); 47 } 44 48 } 45 49 else if (file_exists($src)) copy($src, $dst); … … 117 121 if (function_exists('gzcompress')) 118 122 { 119 $Export->ExportToDBC();123 echo(strip_tags($Export->ExportToDBC())); 120 124 echo('Komprese...'."\n"); 121 exec('zip -r -j '.$Export->TempDir.'CzWoW_DBC.zip '.$Export->TempDir.'dbc/'); 125 $SourceDir = $Export->TempDir.'dbc/'; 126 if (file_exists($SourceDir)) 127 { 128 exec('zip -r -j '.$Export->TempDir.'CzWoW_DBC.zip '.$SourceDir); 129 } else echo('Directory doesn\'t exist '.$SourceDir); 122 130 $this->SetProgress(80); 123 131 } else echo('Funkce pro tvorbu Zip souboru není podporována!'."\n"); -
trunk/Modules/Export/files/1.12.1/install.nsi
r729 r894 12 12 ;not use !define RELEASE_DATE "2010-04-23" 13 13 !define TITLE "CzechWoW" 14 !define FULL_TITLE " Èeský pøeklad WoW"14 !define FULL_TITLE "Český překlad WoW" 15 15 !define CREATOR "Autor" 16 16 !define README "ReadMe.htm" … … 137 137 SetOutPath "$INSTDIR" 138 138 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Odinstalovat.lnk" "$INSTDIR\Uninstall.exe" 139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\ Èeské WoW.lnk" "$INSTDIR\WowLua.exe"140 141 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápov ìda.lnk" "$INSTDIR\${README}"139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\České WoW.lnk" "$INSTDIR\WowLua.exe" 140 141 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápověda.lnk" "$INSTDIR\${README}" 142 142 143 143 SectionEnd … … 149 149 SetDetailsPrint listonly 150 150 151 CreateShortCut "$DESKTOP\ Èeské WoW.lnk" "$INSTDIR\WowLua.exe"151 CreateShortCut "$DESKTOP\České WoW.lnk" "$INSTDIR\WowLua.exe" 152 152 153 153 SectionEnd … … 156 156 157 157 SetDetailsPrint textonly 158 DetailPrint "Zobrazuji dopl òující informace..."158 DetailPrint "Zobrazuji doplňující informace..." 159 159 SetDetailsPrint listonly 160 160 … … 166 166 167 167 SetDetailsPrint textonly 168 DetailPrint "Ma u WDB cache..."168 DetailPrint "Mažu WDB cache..." 169 169 SetDetailsPrint listonly 170 170 … … 192 192 !insertmacro MUI_DESCRIPTION_TEXT ${Base} "Základní soubory" 193 193 !insertmacro MUI_DESCRIPTION_TEXT ${Fonts} "Fonty do hry, pro správné zobrazování diakritiky" 194 !insertmacro MUI_DESCRIPTION_TEXT ${Interface} "P øeloí Rozhraní, Kouzla, Herní tipy, Úspìchy, Místa, Rasy postav aj."195 !insertmacro MUI_DESCRIPTION_TEXT ${Addon} "P øeloí Výpravy, Slova NPC, Kníky aj."196 !insertmacro MUI_DESCRIPTION_TEXT ${StartMenuShortCut} "P øidá zástupce do Nabídky start pro snadné pouití"197 !insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortCut} "P øidá zástupce na plochu"194 !insertmacro MUI_DESCRIPTION_TEXT ${Interface} "Přeloží Rozhraní, Kouzla, Herní tipy, Úspěchy, Místa, Rasy postav aj." 195 !insertmacro MUI_DESCRIPTION_TEXT ${Addon} "Přeloží Výpravy, Slova NPC, Knížky aj." 196 !insertmacro MUI_DESCRIPTION_TEXT ${StartMenuShortCut} "Přidá zástupce do Nabídky start pro snadné použití" 197 !insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortCut} "Přidá zástupce na plochu" 198 198 !insertmacro MUI_DESCRIPTION_TEXT ${ShowChangeLog} "Zobrazí informace o vydání" 199 !insertmacro MUI_DESCRIPTION_TEXT ${DeleteWDBCache} "Sma e vyrovnávací pamì v podsloece cache\WDB ve sloce hry. Ve zde ukládaných souborech se uchovávají anglické texty pøijaté ze serveru. Pøi zmìnì pøipojení mezi servery anglickými a èeskými servery je potøeba obsah této sloky vymazat."199 !insertmacro MUI_DESCRIPTION_TEXT ${DeleteWDBCache} "Smaže vyrovnávací paměť v podsložece cache\WDB ve složce hry. Ve zde ukládaných souborech se uchovávají anglické texty přijaté ze serveru. Při změně připojení mezi servery anglickými a českými servery je potřeba obsah této složky vymazat." 200 200 !insertmacro MUI_FUNCTION_DESCRIPTION_END 201 201 -
trunk/Modules/Export/files/2.4.3/install.nsi
r729 r894 12 12 ;not use !define RELEASE_DATE "2010-04-23" 13 13 !define TITLE "CzechWoW" 14 !define FULL_TITLE " Èeský pøeklad WoW"14 !define FULL_TITLE "Český překlad WoW" 15 15 !define CREATOR "Autor" 16 16 !define README "ReadMe.htm" … … 137 137 SetOutPath "$INSTDIR" 138 138 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Odinstalovat.lnk" "$INSTDIR\Uninstall.exe" 139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\ Èeské WoW.lnk" "$INSTDIR\WowLua.exe"140 141 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápov ìda.lnk" "$INSTDIR\${README}"139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\České WoW.lnk" "$INSTDIR\WowLua.exe" 140 141 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápověda.lnk" "$INSTDIR\${README}" 142 142 143 143 SectionEnd … … 149 149 SetDetailsPrint listonly 150 150 151 CreateShortCut "$DESKTOP\ Èeské WoW.lnk" "$INSTDIR\WowLua.exe"151 CreateShortCut "$DESKTOP\České WoW.lnk" "$INSTDIR\WowLua.exe" 152 152 153 153 SectionEnd … … 156 156 157 157 SetDetailsPrint textonly 158 DetailPrint "Zobrazuji dopl òující informace..."158 DetailPrint "Zobrazuji doplňující informace..." 159 159 SetDetailsPrint listonly 160 160 … … 166 166 167 167 SetDetailsPrint textonly 168 DetailPrint "Ma u WDB cache..."168 DetailPrint "Mažu WDB cache..." 169 169 SetDetailsPrint listonly 170 170 … … 192 192 !insertmacro MUI_DESCRIPTION_TEXT ${Base} "Základní soubory" 193 193 !insertmacro MUI_DESCRIPTION_TEXT ${Fonts} "Fonty do hry, pro správné zobrazování diakritiky" 194 !insertmacro MUI_DESCRIPTION_TEXT ${Interface} "P øeloí Rozhraní, Kouzla, Herní tipy, Úspìchy, Místa, Rasy postav aj."195 !insertmacro MUI_DESCRIPTION_TEXT ${Addon} "P øeloí Výpravy, Slova NPC, Kníky aj."196 !insertmacro MUI_DESCRIPTION_TEXT ${StartMenuShortCut} "P øidá zástupce do Nabídky start pro snadné pouití"197 !insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortCut} "P øidá zástupce na plochu"194 !insertmacro MUI_DESCRIPTION_TEXT ${Interface} "Přeloží Rozhraní, Kouzla, Herní tipy, Úspěchy, Místa, Rasy postav aj." 195 !insertmacro MUI_DESCRIPTION_TEXT ${Addon} "Přeloží Výpravy, Slova NPC, Knížky aj." 196 !insertmacro MUI_DESCRIPTION_TEXT ${StartMenuShortCut} "Přidá zástupce do Nabídky start pro snadné použití" 197 !insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortCut} "Přidá zástupce na plochu" 198 198 !insertmacro MUI_DESCRIPTION_TEXT ${ShowChangeLog} "Zobrazí informace o vydání" 199 !insertmacro MUI_DESCRIPTION_TEXT ${DeleteWDBCache} "Sma e vyrovnávací pamì v podsloece cache\WDB ve sloce hry. Ve zde ukládaných souborech se uchovávají anglické texty pøijaté ze serveru. Pøi zmìnì pøipojení mezi servery anglickými a èeskými servery je potøeba obsah této sloky vymazat."199 !insertmacro MUI_DESCRIPTION_TEXT ${DeleteWDBCache} "Smaže vyrovnávací paměť v podsložece cache\WDB ve složce hry. Ve zde ukládaných souborech se uchovávají anglické texty přijaté ze serveru. Při změně připojení mezi servery anglickými a českými servery je potřeba obsah této složky vymazat." 200 200 !insertmacro MUI_FUNCTION_DESCRIPTION_END 201 201 -
trunk/Modules/Export/files/3.3.5a/install.nsi
r729 r894 12 12 ;not use !define RELEASE_DATE "2010-04-23" 13 13 !define TITLE "CzechWoW" 14 !define FULL_TITLE " Èeský pøeklad WoW"14 !define FULL_TITLE "Český překlad WoW" 15 15 !define CREATOR "Autor" 16 16 !define README "ReadMe.htm" … … 137 137 SetOutPath "$INSTDIR" 138 138 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Odinstalovat.lnk" "$INSTDIR\Uninstall.exe" 139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\ Èeské WoW.lnk" "$INSTDIR\WowLua.exe"140 141 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápov ìda.lnk" "$INSTDIR\${README}"139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\České WoW.lnk" "$INSTDIR\WowLua.exe" 140 141 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápověda.lnk" "$INSTDIR\${README}" 142 142 143 143 SectionEnd … … 149 149 SetDetailsPrint listonly 150 150 151 CreateShortCut "$DESKTOP\ Èeské WoW.lnk" "$INSTDIR\WowLua.exe"151 CreateShortCut "$DESKTOP\České WoW.lnk" "$INSTDIR\WowLua.exe" 152 152 153 153 SectionEnd … … 156 156 157 157 SetDetailsPrint textonly 158 DetailPrint "Zobrazuji dopl òující informace..."158 DetailPrint "Zobrazuji doplňující informace..." 159 159 SetDetailsPrint listonly 160 160 … … 166 166 167 167 SetDetailsPrint textonly 168 DetailPrint "Ma u WDB cache..."168 DetailPrint "Mažu WDB cache..." 169 169 SetDetailsPrint listonly 170 170 … … 192 192 !insertmacro MUI_DESCRIPTION_TEXT ${Base} "Základní soubory" 193 193 !insertmacro MUI_DESCRIPTION_TEXT ${Fonts} "Fonty do hry, pro správné zobrazování diakritiky" 194 !insertmacro MUI_DESCRIPTION_TEXT ${Interface} "P øeloí Rozhraní, Kouzla, Herní tipy, Úspìchy, Místa, Rasy postav aj."195 !insertmacro MUI_DESCRIPTION_TEXT ${Addon} "P øeloí Výpravy, Slova NPC, Kníky aj."196 !insertmacro MUI_DESCRIPTION_TEXT ${StartMenuShortCut} "P øidá zástupce do Nabídky start pro snadné pouití"197 !insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortCut} "P øidá zástupce na plochu"194 !insertmacro MUI_DESCRIPTION_TEXT ${Interface} "Přeloží Rozhraní, Kouzla, Herní tipy, Úspěchy, Místa, Rasy postav aj." 195 !insertmacro MUI_DESCRIPTION_TEXT ${Addon} "Přeloží Výpravy, Slova NPC, Knížky aj." 196 !insertmacro MUI_DESCRIPTION_TEXT ${StartMenuShortCut} "Přidá zástupce do Nabídky start pro snadné použití" 197 !insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortCut} "Přidá zástupce na plochu" 198 198 !insertmacro MUI_DESCRIPTION_TEXT ${ShowChangeLog} "Zobrazí informace o vydání" 199 !insertmacro MUI_DESCRIPTION_TEXT ${DeleteWDBCache} "Sma e vyrovnávací pamì v podsloece cache\WDB ve sloce hry. Ve zde ukládaných souborech se uchovávají anglické texty pøijaté ze serveru. Pøi zmìnì pøipojení mezi servery anglickými a èeskými servery je potøeba obsah této sloky vymazat."199 !insertmacro MUI_DESCRIPTION_TEXT ${DeleteWDBCache} "Smaže vyrovnávací paměť v podsložece cache\WDB ve složce hry. Ve zde ukládaných souborech se uchovávají anglické texty přijaté ze serveru. Při změně připojení mezi servery anglickými a českými servery je potřeba obsah této složky vymazat." 200 200 !insertmacro MUI_FUNCTION_DESCRIPTION_END 201 201 -
trunk/Modules/Export/files/4.3.4/install.nsi
r729 r894 12 12 ;not use !define RELEASE_DATE "2010-04-23" 13 13 !define TITLE "CzechWoW" 14 !define FULL_TITLE " Èeský pøeklad WoW"14 !define FULL_TITLE "Český překlad WoW" 15 15 !define CREATOR "Autor" 16 16 !define README "ReadMe.htm" … … 138 138 SetOutPath "$INSTDIR" 139 139 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Odinstalovat.lnk" "$INSTDIR\Uninstall.exe" 140 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\ Èeské WoW.lnk" "$INSTDIR\WowLua.exe"141 142 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápov ìda.lnk" "$INSTDIR\${README}"140 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\České WoW.lnk" "$INSTDIR\WowLua.exe" 141 142 CreateShortCut "$SMPROGRAMS\${FULL_TITLE}\Nápověda.lnk" "$INSTDIR\${README}" 143 143 144 144 SectionEnd … … 150 150 SetDetailsPrint listonly 151 151 152 CreateShortCut "$DESKTOP\ Èeské WoW.lnk" "$INSTDIR\WowLua.exe"152 CreateShortCut "$DESKTOP\České WoW.lnk" "$INSTDIR\WowLua.exe" 153 153 154 154 SectionEnd … … 157 157 158 158 SetDetailsPrint textonly 159 DetailPrint "Zobrazuji dopl òující informace..."159 DetailPrint "Zobrazuji doplňující informace..." 160 160 SetDetailsPrint listonly 161 161 … … 167 167 168 168 SetDetailsPrint textonly 169 DetailPrint "Ma u WDB cache..."169 DetailPrint "Mažu WDB cache..." 170 170 SetDetailsPrint listonly 171 171 … … 193 193 !insertmacro MUI_DESCRIPTION_TEXT ${Base} "Základní soubory" 194 194 !insertmacro MUI_DESCRIPTION_TEXT ${Fonts} "Fonty do hry, pro správné zobrazování diakritiky" 195 !insertmacro MUI_DESCRIPTION_TEXT ${Interface} "P øeloí Rozhraní, Kouzla, Herní tipy, Úspìchy, Místa, Rasy postav aj."196 !insertmacro MUI_DESCRIPTION_TEXT ${Addon} "P øeloí Výpravy, Slova NPC, Kníky aj."197 !insertmacro MUI_DESCRIPTION_TEXT ${StartMenuShortCut} "P øidá zástupce do Nabídky start pro snadné pouití"198 !insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortCut} "P øidá zástupce na plochu"195 !insertmacro MUI_DESCRIPTION_TEXT ${Interface} "Přeloží Rozhraní, Kouzla, Herní tipy, Úspěchy, Místa, Rasy postav aj." 196 !insertmacro MUI_DESCRIPTION_TEXT ${Addon} "Přeloží Výpravy, Slova NPC, Knížky aj." 197 !insertmacro MUI_DESCRIPTION_TEXT ${StartMenuShortCut} "Přidá zástupce do Nabídky start pro snadné použití" 198 !insertmacro MUI_DESCRIPTION_TEXT ${DesktopShortCut} "Přidá zástupce na plochu" 199 199 !insertmacro MUI_DESCRIPTION_TEXT ${ShowChangeLog} "Zobrazí informace o vydání" 200 !insertmacro MUI_DESCRIPTION_TEXT ${DeleteWDBCache} "Sma e vyrovnávací pamì v podsloece cache\WDB ve sloce hry. Ve zde ukládaných souborech se uchovávají anglické texty pøijaté ze serveru. Pøi zmìnì pøipojení mezi servery anglickými a èeskými servery je potøeba obsah této sloky vymazat."200 !insertmacro MUI_DESCRIPTION_TEXT ${DeleteWDBCache} "Smaže vyrovnávací paměť v podsložece cache\WDB ve složce hry. Ve zde ukládaných souborech se uchovávají anglické texty přijaté ze serveru. Při změně připojení mezi servery anglickými a českými servery je potřeba obsah této složky vymazat." 201 201 !insertmacro MUI_FUNCTION_DESCRIPTION_END 202 202 -
trunk/Modules/Export/files/5.4.0/install.nsi
r729 r894 12 12 ;not use !define RELEASE_DATE "2010-04-23" 13 13 !define TITLE "CzechWoW" 14 !define FULL_TITLE " Èeský pøeklad WoW"14 !define FULL_TITLE "Český překlad WoW" 15 15 !define CREATOR "Autor" 16 16 !define README "ReadMe.htm" … … 119 119 120 120 SetDetailsPrint textonly 121 DetailPrint "Zobrazuji dopl òující informace..."121 DetailPrint "Zobrazuji doplňující informace..." 122 122 SetDetailsPrint listonly 123 123 … … 129 129 130 130 SetDetailsPrint textonly 131 DetailPrint "Ma u WDB cache..."131 DetailPrint "Mažu WDB cache..." 132 132 SetDetailsPrint listonly 133 133 … … 155 155 !insertmacro MUI_DESCRIPTION_TEXT ${Base} "Základní soubory" 156 156 !insertmacro MUI_DESCRIPTION_TEXT ${Fonts} "Fonty do hry, pro správné zobrazování diakritiky" 157 !insertmacro MUI_DESCRIPTION_TEXT ${Addon} "P øeloí Výpravy, Slova NPC, Kníky aj."157 !insertmacro MUI_DESCRIPTION_TEXT ${Addon} "Přeloží Výpravy, Slova NPC, Knížky aj." 158 158 !insertmacro MUI_DESCRIPTION_TEXT ${ShowChangeLog} "Zobrazí informace o vydání" 159 !insertmacro MUI_DESCRIPTION_TEXT ${DeleteWDBCache} "Sma e vyrovnávací pamì v podsloece cache\WDB ve sloce hry. Ve zde ukládaných souborech se uchovávají anglické texty pøijaté ze serveru. Pøi zmìnì pøipojení mezi servery anglickými a èeskými servery je potøeba obsah této sloky vymazat."159 !insertmacro MUI_DESCRIPTION_TEXT ${DeleteWDBCache} "Smaže vyrovnávací paměť v podsložece cache\WDB ve složce hry. Ve zde ukládaných souborech se uchovávají anglické texty přijaté ze serveru. Při změně připojení mezi servery anglickými a českými servery je potřeba obsah této složky vymazat." 160 160 !insertmacro MUI_FUNCTION_DESCRIPTION_END 161 161 -
trunk/Modules/Import/Import.php
r888 r894 3 3 include_once(dirname(__FILE__).'/../../includes/dbc.php'); 4 4 include_once(dirname(__FILE__).'/Manage.php'); 5 6 5 7 6 class ModuleImport extends Module … … 38 37 function SetVersion($Version) 39 38 { 40 global $System; 41 42 $DbResult = $System->Database->query('SELECT * FROM `ClientVersion` WHERE `Version` = "'.$Version.'"'); 39 $DbResult = $this->System->Database->query('SELECT * FROM `ClientVersion` WHERE `Version` = "'.$Version.'"'); 43 40 $this->Version = $DbResult->fetch_assoc(); 44 41 } … … 68 65 $DbRowBefore = $DbResultBefore->fetch_assoc(); 69 66 70 if ($this->HaveSameText($this->Group, $DbRowBefore, $Value) and ($DbResultBefore->num_rows > 0) 67 if ($this->HaveSameText($this->Group, $DbRowBefore, $Value) and ($DbResultBefore->num_rows > 0)) 71 68 { 72 69 $insert = false; 73 if ($this->Group['Id'] == 1) { 70 if ($this->Group['Id'] == 1) 71 { 74 72 $set = ' , EndText = "'.$Value['EndText'].'" , ObjectiveText1 = "'.$Value['ObjectiveText1'].'"'.' , ObjectiveText2 = "'.$Value['ObjectiveText2'].'"'.' , ObjectiveText3 = "'.$Value['ObjectiveText3'].'"'.' , ObjectiveText4 = "'.$Value['ObjectiveText4'].'"'; 75 73 } else $set = ''; … … 80 78 if ($this->HaveSameText($this->Group, $DbRowAfter, $Value) and ($DbResultAfter->num_rows > 0)) 81 79 { 82 83 if ($this->Group['Id'] == 1) {84 $set = ' , EndText = "'.$Value['EndText'].'" , ObjectiveText1 = "'.$Value['ObjectiveText1'].'"'.' , ObjectiveText2 = "'.$Value['ObjectiveText2'].'"'.' , ObjectiveText3 = "'.$Value['ObjectiveText3'].'"'.' , ObjectiveText4 = "'.$Value['ObjectiveText4'].'"';85 } else $set = '';86 $this->System->Database->query('UPDATE `'.$this->Group['TablePrefix'].'` SET `VersionStart` = "'.$this->Version['BuildNumber'].'" '.$set.' WHERE `ID`='.$DbRowAfter['ID']);87 echo('a ');88 80 $insert = false; 81 if ($this->Group['Id'] == 1) 82 { 83 $set = ' , EndText = "'.$Value['EndText'].'" , ObjectiveText1 = "'.$Value['ObjectiveText1'].'"'.' , ObjectiveText2 = "'.$Value['ObjectiveText2'].'"'.' , ObjectiveText3 = "'.$Value['ObjectiveText3'].'"'.' , ObjectiveText4 = "'.$Value['ObjectiveText4'].'"'; 84 } else $set = ''; 85 $this->System->Database->query('UPDATE `'.$this->Group['TablePrefix'].'` SET `VersionStart` = "'.$this->Version['BuildNumber'].'" '.$set.' WHERE `ID`='.$DbRowAfter['ID']); 86 echo('a '); 89 87 } else 90 88 { 91 92 if (isset($DbRowAfter['VersionStart'])) { 93 if ($DbRowAfter['VersionStart'] <= $this->Version['BuildNumber']) { 89 if (isset($DbRowAfter['VersionStart'])) 90 { 91 if ($DbRowAfter['VersionStart'] <= $this->Version['BuildNumber']) 92 { 94 93 echo('Allready imported '.$DbRowBefore['Entry'].' '); 95 94 $insert = false; 96 95 } 97 96 } 98 if (isset($DbRowBefore['VersionEnd'])) { 99 if ($DbRowBefore['VersionEnd'] >= $this->Version['BuildNumber']) { 97 if (isset($DbRowBefore['VersionEnd'])) 98 { 99 if ($DbRowBefore['VersionEnd'] >= $this->Version['BuildNumber']) 100 { 100 101 echo('Allready imported '.$DbRowBefore['Entry'].' '); 101 102 $inserted = false; … … 103 104 } 104 105 105 //if [DEPRECATED] do not import 106 foreach ($this->Group['Items'] as $GroupItem) { 107 if (false !== strpos($Value[$GroupItem['Column']],'[DEPRECATED')) { 106 // if [DEPRECATED] do not import 107 foreach ($this->Group['Items'] as $GroupItem) 108 { 109 if (false !== strpos($Value[$GroupItem['Column']],'[DEPRECATED')) 110 { 108 111 echo('d '.$DbRowBefore['Entry'].' '); 109 112 $insert = false; … … 111 114 } 112 115 113 if ($insert) { 116 if ($insert) 117 { 114 118 $insert = false; 115 119 foreach ($this->Group['Items'] as $GroupItem) … … 125 129 if ($insert) 126 130 { 127 128 131 $Columns = '`Entry`, `Language`, `VersionStart`, `VersionEnd`'; 129 132 $Values = $Value['Entry'].', 0, '.$this->Version['BuildNumber'].', '.$this->Version['BuildNumber']; … … 135 138 $this->System->Database->query('INSERT `'.$this->Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 136 139 137 echo 140 echo(' 138 141 '.$Value['Entry'].' = '.$DbRowBefore['VersionStart'].'.'.$DbRowBefore['VersionEnd'].'< '.$this->Version['BuildNumber'].' <'.$DbRowAfter['VersionStart'].'.'.$DbRowAfter['VersionEnd'].'... '.$DbRowMiddle['VersionStart'].' '.$DbRowMiddle['VersionEnd'].' 139 ' ;142 '); 140 143 141 144 if (false !== strpos($Values,'[DEPRECATED')) 142 echo $Values;145 echo($Values); 143 146 144 147 echo('# '); … … 171 174 if ($Value[$GroupItem['Column']] <> '') $insert = true; 172 175 } 173 if ($insert) { 176 if ($insert) 177 { 174 178 $this->System->Database->query('INSERT `'.$this->Group['TablePrefix'].'` ('.$Columns.') VALUES ('.$Values.')'); 175 179 $InsertId = $this->System->Database->insert_id; … … 183 187 function ImportLUA() 184 188 { 185 global $PatchVersion;186 187 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();188 189 $Output = 'Načítání textů z LUA souboru...'; 189 190 190 191 if (($this->Group['LuaFileName'] != '') and ($this->Group['TablePrefix'] != '')) 191 192 { 192 193 $Output .= '<br />'.$this->Group['Name'].'<br />'; 193 $Output .= '<br />'.$this->Group['Name'].'<br />'; 194 194 // if ($this->Group['LastVersion'] < $this->Version['BuildNumber'] + 1) 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 195 { 196 $File = new FileStream(); 197 198 $File->OpenFile(dirname(__FILE__).'/../../source/'.$this->Version['Version'].'/lua/'.$this->Group['LuaFileName'].'.lua'); 199 $this->NewItemCount = 0; 200 $Count = 0; 201 while (!$File->EOF()) 202 { 203 $Line = $File->ReadLine(); 204 if (strpos($Line, '=') !== false) 205 { 206 $LineParts = explode('=', $Line, 2); 207 $Value['ShortCut'] = trim($LineParts[0]); 208 $Line = trim($LineParts[1]); 209 if ($Line[0] == '"') 210 { 211 // Quoted string value 212 $Line = substr($Line, 1); // Skip start qoute 213 $TempLine = str_replace('\"', ' ', $Line); // Temporary remove slashed quotes 214 $Value['Text'] = substr($Line, 0, strpos($TempLine, '"')); 215 $Value['Text'] = str_replace('\n', "\n", $Value['Text']); 216 $Value['Text'] = addslashes(stripslashes($Value['Text'])); 217 $Line = trim(substr($Line, strpos($TempLine, '"') + 1)); // Skip closing quote and semicolon 218 } else 219 { 220 // Nonstring value 221 $Value['Text'] = substr($Line, 0, strpos($Line, ';')); 222 } 223 $Line = substr($Line, strpos($Line, ';') + 1); 224 $Value['Comment'] = addslashes(stripslashes(substr($Line, 3))); // Skip " --" 225 226 $this->InsertItem($Value); 227 }; 228 $Count++; 229 } 230 $Output .= '<br />Celkem: '.$Count.' Nových: '.$this->NewItemCount.'<br />'; 231 $this->UpdateLastVersion(); 232 } 233 // else $Output .= ShowMessage('Již importován pro verzi '.$this->Version['Version'], MESSAGE_CRITICAL); 234 } else $Output .= ShowMessage('Není definováno jméno zdrojového souboru', MESSAGE_CRITICAL); 235 235 $Output .= ShowMessage('Dokončeno.'); 236 236 return $Output; … … 239 239 function UpdateTranslated() 240 240 { 241 global $PatchVersion, $Config;242 243 241 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree(); 244 242 $Output = '<br /><br />Začínám se synchronizací VersionEnd u přeložených textů<br />'; … … 249 247 while ($do) 250 248 { 251 $DbResult = $this->System->Database->query('SELECT `gs_tran`.`ID`, '.252 '`gs_tran`.`VersionEnd` AS `VersionEnd_tran`, '.253 '`gs_tran`.`VersionStart` AS `VersionStart_tran`, '.254 '`gs_orig`.`VersionEnd` AS `VersionEnd_orig`, '.255 '`gs_orig`.`VersionStart` AS `VersionStart_orig` FROM `'.249 $DbResult = $this->System->Database->query('SELECT `gs_tran`.`ID`, '. 250 '`gs_tran`.`VersionEnd` AS `VersionEnd_tran`, '. 251 '`gs_tran`.`VersionStart` AS `VersionStart_tran`, '. 252 '`gs_orig`.`VersionEnd` AS `VersionEnd_orig`, '. 253 '`gs_orig`.`VersionStart` AS `VersionStart_orig` FROM `'. 256 254 $Group['TablePrefix'].'` AS `gs_tran` JOIN `'.$Group['TablePrefix']. 257 '` AS `gs_orig` ON `gs_orig`.`ID` = `gs_tran`.`Take` WHERE '.258 '`gs_tran`.`VersionEnd` <> `gs_orig`.`VersionEnd` OR `gs_tran`.`VersionStart` <> `gs_orig`.`VersionStart`');255 '` AS `gs_orig` ON `gs_orig`.`ID` = `gs_tran`.`Take` WHERE '. 256 '`gs_tran`.`VersionEnd` <> `gs_orig`.`VersionEnd` OR `gs_tran`.`VersionStart` <> `gs_orig`.`VersionStart`'); 259 257 $do = ($DbResult->num_rows > 0); 260 258 while ($DbRow = $DbResult->fetch_assoc()) … … 293 291 294 292 if ($this->Group['Id'] == 1) 295 while ($part = substr($old, strpos($old, '<'), strpos($old, '>')-strpos($old, '<'))) 296 if ($part <> '') { 297 $old = str_replace($part.'>', '', $old); 298 } 293 { 294 while ($part = substr($old, strpos($old, '<'), strpos($old, '>')-strpos($old, '<'))) 295 { 296 if ($part <> '') 297 { 298 $old = str_replace($part.'>', '', $old); 299 } 300 } 301 } 299 302 300 303 if (($GroupItem['MangosColumn'] <> '') and ($Group['MangosDatabase'] == 'mangos')) … … 319 322 320 323 if ($this->Group['Id'] == 1) 321 while ($part = substr($new, strpos($new, '<'), strpos($new, '>')-strpos($new, '<'))) 322 if ($part <> '') { 323 $new = str_replace($part.'>', '', $new); 324 } 324 { 325 while ($part = substr($new, strpos($new, '<'), strpos($new, '>')-strpos($new, '<'))) 326 { 327 if ($part <> '') 328 { 329 $new = str_replace($part.'>', '', $new); 330 } 331 } 332 } 325 333 326 334 if (($old == 'null') or ($old == 'NULL')) $old = ''; … … 344 352 function ImportDBC() 345 353 { 346 global $System, $Config; 347 348 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree(); 354 global $System; 355 349 356 $Output = 'Načítání textů z DBC souboru...'; 350 357 if (($this->Group['DBCFileName'] != '') and ($this->Group['TablePrefix'] != '')) … … 381 388 $ColumnValue = ''; 382 389 foreach ($Columns as $Column) 390 { 383 391 $ColumnValue .= '_'.$DBCFile->GetUint($I, $Column); 392 } 384 393 $ColumnValue = substr($ColumnValue, 1); 385 394 $Value[$this->Group['PrimaryKeyItem']] = $ColumnValue; … … 410 419 function ImportSQL() 411 420 { 412 global $PatchVersion;413 414 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();415 421 $Output = ''; 416 422 $File = new FileStream(); … … 418 424 $this->NewItemCount = 0; 419 425 $Count = 0; 420 $ folow_structure = false;426 $FollowStructure = false; 421 427 $i = 0; 422 428 while ((!$File->EOF())) … … 427 433 { 428 434 $Line = ''; 429 $ folow_structure = true;435 $FollowStructure = true; 430 436 $i = 0; 431 437 } 432 if ((strpos($Line, ';') !== false) and ($folow_structure == true)) 433 { 434 $folow_structure = false; 435 // echo ('Struktura: <br />'); 436 // print_r($structure); 437 // echo ('<br /><br />'); 438 } 439 if (($folow_structure == true) and ($Line != '')) 438 if ((strpos($Line, ';') !== false) and ($FollowStructure == true)) 439 { 440 $FollowStructure = false; 441 } 442 if (($FollowStructure == true) and ($Line != '')) 440 443 { 441 444 $str = substr($Line, 0, strpos($Line, '`')); … … 446 449 } 447 450 448 // data451 // data 449 452 if ((strpos($Line, 'INSERT INTO `'.$this->Group['MangosTable'].'`') !== false) and (isset($structure))) 450 453 { … … 503 506 $Value[$column] = ''; 504 507 } 505 // echo ($column.'-"'.$Value[$column].'"<br>');506 508 } 507 509 foreach ($this->Group['Items'] as $GroupItem) 508 510 { 509 511 if ($GroupItem['MangosColumn'] != '') 512 { 510 513 if (isset($Value[$GroupItem['MangosColumn']])) 514 { 511 515 $Value[$GroupItem['Column']] = $Value[$GroupItem['MangosColumn']]; 512 else { 516 } 517 else 518 { 513 519 $Value[$GroupItem['Column']] = ''; 514 520 $Value[$GroupItem['MangosColumn']] =''; 515 521 } 522 } 516 523 } 517 524 … … 520 527 $ColumnValue = ''; 521 528 foreach ($Columns as $Column) 529 { 522 530 $ColumnValue .= '_'.$Value[$Column]; 531 } 523 532 $ColumnValue = substr($ColumnValue, 1); 524 533 $Value[$this->Group['PrimaryKeyItem']] = $ColumnValue; … … 533 542 } 534 543 535 function UpdateLastVersion() { 544 function UpdateLastVersion() 545 { 536 546 $DbResult = $this->System->Database->query('SELECT * FROM `Group` WHERE `Id`='.$this->Group['Id']); 537 547 $Version = $DbResult->fetch_assoc(); -
trunk/Modules/Import/generatecodeXML.php
r880 r894 1 1 <?php 2 2 3 $depth = array(); 3 4 //$xml_buffer = array(); -
trunk/includes/Global.php
r893 r894 818 818 return preg_replace($find, $replace, $text); 819 819 } 820 821 function NormalizePath(string $Path): string 822 { 823 $Segments = explode('/', $Path); 824 $Result = array(); 825 for ($I = 0; $I < count($Segments); $I++) 826 { 827 $Segment = $Segments[$I]; 828 if (($Segment == '.') || ((strlen($Segment) == 0) && ($I > 0) && ($I < count($Segments) - 1))) 829 { 830 continue; 831 } 832 if ($Segment == '..') 833 { 834 array_pop($Result); 835 } else 836 { 837 array_push($Result, $Segment); 838 } 839 } 840 return implode('/', $Result); 841 }
Note:
See TracChangeset
for help on using the changeset viewer.