Ignore:
Timestamp:
Apr 7, 2020, 10:15:48 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
File:
1 edited

Legend:

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

    r859 r880  
    1717    $string = str_replace('$r', '"..'.$strlower.'(UnitRace("player")).."', $string);
    1818    $Gender = '$G';
    19     while(strpos($string, $Gender) !== false)
     19    while (strpos($string, $Gender) !== false)
    2020    {
    2121      $Before = substr($string, 0, strpos($string, $Gender));
     
    3030    }
    3131    $Gender = '$g';
    32     while(strpos($string, $Gender) !== false)
     32    while (strpos($string, $Gender) !== false)
    3333    {
    3434      $Before = substr($string, 0, strpos($string, $Gender));
     
    4646    $string = str_replace("\r", '', $string);
    4747    $string = str_replace("\n", '\r\n', $string);
    48     return($string);
     48    return $string;
    4949  }
    5050
     
    6464    $string = str_replace('\\n', ' ', $string);
    6565    $string = str_replace(' ', '', $string);
    66 //    while(strpos($string, '  '))
     66//    while (strpos($string, '  '))
    6767//      $string = str_replace('  ', ' ', $string);
    68     return($string);
     68    return $string;
    6969  }
    7070
     
    7575    $string = str_replace('$b', '\r\n', $string);
    7676    $string = $this->ReplaceVarInText($string,'');
    77     return($string);
     77    return $string;
    7878  }
    7979
     
    8181  {
    8282    //echo (strpos($string,'<html>'));
    83     if (strpos($string,'<html>') > -1) return(false);
    84       else return(true);
     83    if (strpos($string,'<html>') > -1) return false;
     84      else return true;
    8585  }
    8686
     
    9898    $string = str_replace('\\\\124', '\\124',$string);
    9999
    100     return ($string);
     100    return $string;
    101101  }
    102102
     
    113113    $CreatedFileListCount = array();
    114114
    115     if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/', 0777, true);
     115    if (!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/', 0777, true);
    116116
    117117    $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `Group`.`TablePrefix` != ""');
    118     while($Group = $DbResult->fetch_assoc())
     118    while ($Group = $DbResult->fetch_assoc())
    119119    {
    120120    //získání čísla verze pro export
     
    126126      else $ExportVersion = '';
    127127
    128       foreach($TranslationTree[$Group['Id']]['Items'] as $Column)
    129       if($Column['AddonFileName'] != '')
     128      foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)
     129      if ($Column['AddonFileName'] != '')
    130130      {
    131131        $this->AddProgress(1);
    132         if(!isset($CreatedFileListCount[$Column['AddonFileName']]))
     132        if (!isset($CreatedFileListCount[$Column['AddonFileName']]))
    133133        $CreatedFileListCount[$Column['AddonFileName']] = 0;
    134134        $CreatedFileListCount[$Column['AddonFileName']]++;
     
    149149        $ID = $this->Database->query('SELECT `BuildNumber` FROM `ClientVersion` WHERE '.
    150150        ' `Imported` = 1 AND `BuildNumber` < '.$BuildNumber.' ORDER BY  `BuildNumber` DESC LIMIT 1');
    151         if($ID->num_rows > 0) {
     151        if ($ID->num_rows > 0) {
    152152          $ExportVersionOld = $ID->fetch_assoc();
    153153          $ExportVersionOld = $ExportVersionOld['BuildNumber'];
    154154
    155155          $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersionOld));
    156           while($Line = $DbResult2->fetch_assoc())
     156          while ($Line = $DbResult2->fetch_assoc())
    157157          {
    158158            $en = trim($this->ReplaceEnText($Line['En'.$Column['Column']]));
    159159            $cz = $this->ReplaceCzText($Line[$Column['Column']]);
    160             if(($en <> '') and ($cz <> '') and ($this->NotCancel($en)))
     160            if (($en <> '') and ($cz <> '') and ($this->NotCancel($en)))
    161161            {
    162162               $TableTexts[$en] = $cz;
     
    167167
    168168        $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersion));
    169         while($Line = $DbResult2->fetch_assoc())
     169        while ($Line = $DbResult2->fetch_assoc())
    170170        {
    171171          $en = trim($this->ReplaceEnText($Line['En'.$Column['Column']]));
    172172          $cz = $this->ReplaceCzText($Line[$Column['Column']]);
    173           if(($en <> '') and ($cz <> '') and ($this->NotCancel($en)))
     173          if (($en <> '') and ($cz <> '') and ($this->NotCancel($en)))
    174174          {
    175175             $TableTexts[$en] = $cz;
     
    177177        }
    178178
    179         foreach($TableTexts as $key => $value) {
     179        foreach ($TableTexts as $key => $value) {
    180180            $Buffer .= "\n".'["'.$key.'"]="'.$value.'",';
    181181            $i++;
     
    194194    $CountFiles = 'CountFiles.lua';
    195195    $Buffer = '';
    196     foreach($CreatedFileList as $CreatedFile)
     196    foreach ($CreatedFileList as $CreatedFile)
    197197      $Buffer .= 'CZWOW_'.str_replace('_','_count=',$CreatedFile).';'."\n";
    198     foreach($TranslationTree as $Group)
    199       foreach($TranslationTree[$Group['Id']]['Items'] as $Column)
     198    foreach ($TranslationTree as $Group)
     199      foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)
    200200      if (($Column['AddonFileName'] != '') and (!in_array($Column['AddonFileName'].'_1', $CreatedFileList)))
    201201      {
     
    209209    $Buffer = '<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/.\FrameXML\UI.xsd">'."\n";
    210210    $Buffer .= '<script file="'.$CountFiles.'"/>'."\n";
    211     foreach($CreatedFileList as $CreatedFile)
     211    foreach ($CreatedFileList as $CreatedFile)
    212212      $Buffer .= '<script file="'.$CreatedFile.'.lua"/>'."\n";
    213213    $Buffer .= '</Ui>';
    214214    file_put_contents($this->TempDir.'CzWoW/Translates.xml', $Buffer);
    215     return($Output);
     215    return $Output;
    216216  }
    217217
     
    235235
    236236    $DbResult = $this->Database->query($this->BuildQuery($Group,$CanGenerated));
    237     while($Line = $DbResult->fetch_array())
     237    while ($Line = $DbResult->fetch_array())
    238238    {
    239239      $Original = $this->my_trim($Line['En'.$Column['Column']]);
    240240      $Translated = $this->my_trim($Line[$Column['Column']]);
    241       if($this->ClientVersion['Version'] == '2.4.3')
     241      if ($this->ClientVersion['Version'] == '2.4.3')
    242242      {
    243243        $Original = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Original);
     
    247247    }
    248248
    249     if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/',0777, true);
     249    if (!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/',0777, true);
    250250    file_put_contents($this->TempDir.'CzWoW/LocalizationStrings.lua', $Buffer);
    251251  }
     
    253253  function MakeAddon()
    254254  {
    255     if(!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true);
     255    if (!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true);
    256256    $Output = $this->MakeLanguageFiles();
    257257    $Output .= $this->MakeClientStrings();
    258258    // $Output .= MakeMainScript($Setting);
    259     return($Output);
     259    return $Output;
    260260  }
    261261
     
    283283    ';
    284284    $DbResult = $System->Database->query('SELECT * FROM `CzWoWPackageVersion` ORDER BY `Date` DESC');
    285     while($Line = $DbResult->fetch_assoc())
     285    while ($Line = $DbResult->fetch_assoc())
    286286    {
    287287      $Buffer .='
Note: See TracChangeset for help on using the changeset viewer.