Ignore:
Timestamp:
Mar 6, 2023, 1:48:45 AM (21 months ago)
Author:
chronos
Message:
  • Fixed: Class types casting for better type checking.
  • Fixed: XML direct export.
  • Modified: User class instance moved from Core class to ModuleUser class.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Export/CreateAddon.php

    r888 r893  
    55class ExportAddon extends Export
    66{
    7 
    87  // Replace special codes by lua functions
    98  function ReplaceVarInText($string, $strlower = 'strlower')
    109  {
    11 
    1210    $string = str_replace('$N', '"..'.$strlower.'(UnitName("player")).."', $string);
    1311    $string = str_replace('$n', '"..'.$strlower.'(UnitName("player")).."', $string);
     
    149147        $ID = $this->Database->query('SELECT `BuildNumber` FROM `ClientVersion` WHERE '.
    150148        ' `Imported` = 1 AND `BuildNumber` < '.$BuildNumber.' ORDER BY  `BuildNumber` DESC LIMIT 1');
    151         if ($ID->num_rows > 0) {
     149        if ($ID->num_rows > 0)
     150        {
    152151          $ExportVersionOld = $ID->fetch_assoc();
    153152          $ExportVersionOld = $ExportVersionOld['BuildNumber'];
     
    164163          }
    165164        }
    166                 //last version
     165        //last version
    167166
    168167        $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersion));
     
    177176        }
    178177
    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++;
    182182        }
    183 
    184183
    185184        $Buffer = $Buffer."\n};if not CZWOW_".$Column['AddonFileName']." then CZWOW_".$Column['AddonFileName']."=0; end; CZWOW_".$Column['AddonFileName']."=CZWOW_".$Column['AddonFileName']."+".$i.";\n";
     
    189188      }
    190189    }
    191 
    192190
    193191    // Generete list file of translated
     
    195193    $Buffer = '';
    196194    foreach ($CreatedFileList as $CreatedFile)
     195    {
    197196      $Buffer .= 'CZWOW_'.str_replace('_','_count=',$CreatedFile).';'."\n";
     197    }
    198198    foreach ($TranslationTree as $Group)
     199    {
    199200      foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)
    200       if (($Column['AddonFileName'] != '') and (!in_array($Column['AddonFileName'].'_1', $CreatedFileList)))
    201201      {
    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      }
    203207    }
    204208
    205209    file_put_contents($this->TempDir.'CzWoW/'.$CountFiles, $Buffer);
    206 
    207210
    208211    // Generate file Translates.xml
     
    210213    $Buffer .= '<script file="'.$CountFiles.'"/>'."\n";
    211214    foreach ($CreatedFileList as $CreatedFile)
     215    {
    212216      $Buffer .= '<script file="'.$CreatedFile.'.lua"/>'."\n";
     217    }
    213218    $Buffer .= '</Ui>';
    214219    file_put_contents($this->TempDir.'CzWoW/Translates.xml', $Buffer);
    215220    return $Output;
    216221  }
    217 
    218222
    219223  function MakeClientStrings()
     
    282286
    283287    ';
    284     $DbResult = $System->Database->query('SELECT * FROM `CzWoWPackageVersion` ORDER BY `Date` DESC');
     288    $DbResult = $this->Database->query('SELECT * FROM `CzWoWPackageVersion` ORDER BY `Date` DESC');
    285289    while ($Line = $DbResult->fetch_assoc())
    286290    {
Note: See TracChangeset for help on using the changeset viewer.