Changeset 893 for trunk/Modules/Export/CreateAddon.php
- Timestamp:
- Mar 6, 2023, 1:48:45 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Export/CreateAddon.php
r888 r893 5 5 class ExportAddon extends Export 6 6 { 7 8 7 // Replace special codes by lua functions 9 8 function ReplaceVarInText($string, $strlower = 'strlower') 10 9 { 11 12 10 $string = str_replace('$N', '"..'.$strlower.'(UnitName("player")).."', $string); 13 11 $string = str_replace('$n', '"..'.$strlower.'(UnitName("player")).."', $string); … … 149 147 $ID = $this->Database->query('SELECT `BuildNumber` FROM `ClientVersion` WHERE '. 150 148 ' `Imported` = 1 AND `BuildNumber` < '.$BuildNumber.' ORDER BY `BuildNumber` DESC LIMIT 1'); 151 if ($ID->num_rows > 0) { 149 if ($ID->num_rows > 0) 150 { 152 151 $ExportVersionOld = $ID->fetch_assoc(); 153 152 $ExportVersionOld = $ExportVersionOld['BuildNumber']; … … 164 163 } 165 164 } 166 165 //last version 167 166 168 167 $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersion)); … … 177 176 } 178 177 179 foreach ($TableTexts as $key => $value) { 180 $Buffer .= "\n".'["'.$key.'"]="'.$value.'",'; 181 $i++; 178 foreach ($TableTexts as $key => $value) 179 { 180 $Buffer .= "\n".'["'.$key.'"]="'.$value.'",'; 181 $i++; 182 182 } 183 184 183 185 184 $Buffer = $Buffer."\n};if not CZWOW_".$Column['AddonFileName']." then CZWOW_".$Column['AddonFileName']."=0; end; CZWOW_".$Column['AddonFileName']."=CZWOW_".$Column['AddonFileName']."+".$i.";\n"; … … 189 188 } 190 189 } 191 192 190 193 191 // Generete list file of translated … … 195 193 $Buffer = ''; 196 194 foreach ($CreatedFileList as $CreatedFile) 195 { 197 196 $Buffer .= 'CZWOW_'.str_replace('_','_count=',$CreatedFile).';'."\n"; 197 } 198 198 foreach ($TranslationTree as $Group) 199 { 199 200 foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) 200 if (($Column['AddonFileName'] != '') and (!in_array($Column['AddonFileName'].'_1', $CreatedFileList)))201 201 { 202 $Buffer .= 'CZWOW_'.$Column['AddonFileName'].'_count=0;'."\n"; 202 if (($Column['AddonFileName'] != '') and (!in_array($Column['AddonFileName'].'_1', $CreatedFileList))) 203 { 204 $Buffer .= 'CZWOW_'.$Column['AddonFileName'].'_count=0;'."\n"; 205 } 206 } 203 207 } 204 208 205 209 file_put_contents($this->TempDir.'CzWoW/'.$CountFiles, $Buffer); 206 207 210 208 211 // Generate file Translates.xml … … 210 213 $Buffer .= '<script file="'.$CountFiles.'"/>'."\n"; 211 214 foreach ($CreatedFileList as $CreatedFile) 215 { 212 216 $Buffer .= '<script file="'.$CreatedFile.'.lua"/>'."\n"; 217 } 213 218 $Buffer .= '</Ui>'; 214 219 file_put_contents($this->TempDir.'CzWoW/Translates.xml', $Buffer); 215 220 return $Output; 216 221 } 217 218 222 219 223 function MakeClientStrings() … … 282 286 283 287 '; 284 $DbResult = $ System->Database->query('SELECT * FROM `CzWoWPackageVersion` ORDER BY `Date` DESC');288 $DbResult = $this->Database->query('SELECT * FROM `CzWoWPackageVersion` ORDER BY `Date` DESC'); 285 289 while ($Line = $DbResult->fetch_assoc()) 286 290 {
Note:
See TracChangeset
for help on using the changeset viewer.