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/Admin/Admin.php

    r859 r880  
    5252      '<a href="'.$this->System->Link('/admin/?action=merge').'">Sjednocení textů</a><br/>'.
    5353      '<small>Sjednotí stejné originální texty v databázi</small><br/><br/>';
    54     return($Output);
     54    return $Output;
    5555  }
    5656
     
    7272  function ShowPHPInfo()
    7373  {
    74     return(phpinfo());
     74    return phpinfo();
    7575  }
    7676
     
    8686      '<a href="'.$this->System->Link('/admin/?action=sqlerror').'">Chybný SQL dotaz</a><br/>'.
    8787      '<small>Vyvolá testovací chybu</small><br/><br/>';
    88     return($Output);
     88    return $Output;
    8989  }
    9090
     
    103103    );
    104104    $Output = 'Questy: <br />';
    105     while($quest = $DbResult->fetch_assoc())
     105    while ($quest = $DbResult->fetch_assoc())
    106106    {
    107107      $Output .= $quest['ID'].', ';
     
    109109    }
    110110    $Output .= '<br / ><br / >Questy nastaveny jako nedokončené!';
    111     return($Output);
     111    return $Output;
    112112  }
    113113
     
    117117
    118118    $Output = '';
    119     foreach($TranslationTree as $Group)
     119    foreach ($TranslationTree as $Group)
    120120    // $Group = $TranslationTree[1];
    121121    {
     
    130130      $DbResult = $this->System->Database->query($sql);
    131131      echo ': <br />'.$Group['TablePrefix'].': <br />';
    132       while($line = $DbResult->fetch_assoc())
     132      while ($line = $DbResult->fetch_assoc())
    133133      {
    134134        echo ($line['ID'].', ');
     
    138138      echo '<br / >Verze '.$Group['TablePrefix'].' opraveny!';
    139139    }
    140     return('Hotovo!');
     140    return 'Hotovo!';
    141141  }
    142142
     
    145145    $Text = strtolower($Text);
    146146    $Text = str_replace(' ', '', $Text);
    147     return ($Text);
     147    return $Text;
    148148  }
    149149
     
    153153
    154154    $Output = '';
    155     foreach($TranslationTree as $Group)
     155    foreach ($TranslationTree as $Group)
    156156    //  $Group = $TranslationTree[1];
    157157    {
     
    164164      $DbResult = $this->System->Database->query($sql);
    165165      echo ': <br />'.$Group['TablePrefix'].': ';
    166       while($line = $DbResult->fetch_assoc())
     166      while ($line = $DbResult->fetch_assoc())
    167167      {
    168168        $sql = 'SELECT * FROM `'.$Group['TablePrefix'] .'` as `T` '.
     
    171171        //   echo $sql;
    172172        $DbResult2 = $this->System->Database->query($sql);
    173         if($DbResult2->num_rows > 0) {
     173        if ($DbResult2->num_rows > 0) {
    174174          $line2 = $DbResult2->fetch_assoc();
    175175
    176176          $Same = true;
    177           foreach($TranslationTree[$Group['Id']]['Items'] as $Column) {
     177          foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) {
    178178            if ($this->StripText($line[$Column['Column']]) <> $this->StripText($line2[$Column['Column']]))
    179179              $Same = false;
     
    186186                ' WHERE `T`.`Entry` = '.$line['Entry'].' AND (`T`.`Take` = '.$line['ID'].' OR `T`.`Take` = '.$line2['ID'].') ';
    187187            $DbResult3 = $this->System->Database->query($sql);
    188             while($line3 = $DbResult3->fetch_assoc()) {
     188            while ($line3 = $DbResult3->fetch_assoc()) {
    189189              echo $line3['ID'].' ';
    190190              $this->System->Database->query('UPDATE `'.$Group['TablePrefix'].'` SET `VersionEnd` = '.$line2['VersionEnd'].', `VersionStart` = '.$line['VersionStart'].', `Take` = '.$line['ID'].' WHERE ID='.$line3['ID']);
     
    199199      echo('Texty '.$Group['TablePrefix'].' sjednoceny!');
    200200    }
    201     return('Hotovo!');
     201    return 'Hotovo!';
    202202  }
    203203
     
    224224        $Group = $TranslationTree[$_GET['id']];
    225225        //  $Output .= '<form action="?action=dbcstructure&amp;id='.$Group['Id'].'">';
    226         //  foreach($Group['Items'] as $GroupItem)
     226        //  foreach ($Group['Items'] as $GroupItem)
    227227        //   {
    228228          //     $Output .= $GroupItem['Column'].': <input name="'.$GroupItem['Id'].'"><br />';
     
    236236          $Group['DBCFileName'].'.dbc.csv');
    237237
    238         //while(!$File->EOF())
     238        //while (!$File->EOF())
    239239
    240240        $Output .= '<table class="BaseTable">';
     
    248248        $Output .= '</td></tr><tr><td>';
    249249        for ($i = 0; $i < substr_count($Line, ','); $i++) {
    250           foreach($Group['Items'] as $GroupItem)
     250          foreach ($Group['Items'] as $GroupItem)
    251251            $Output .=   ' <a href="'.$this->System->Link('/admin/?action=dbcstructure&amp;id='.
    252252              $Group['Id'].'&amp;GroupItem='.$GroupItem['Id'].'&amp;ColumnIndex='.$i).'">'.
     
    269269      } else {
    270270        $DbResult = $this->System->Database->query('SELECT * FROM `ClientVersion`');
    271         while($Version = $DbResult->fetch_assoc())
     271        while ($Version = $DbResult->fetch_assoc())
    272272        {
    273273          $Output .= '<a href="'.$this->System->Link('/admin/?action=dbcstructure&amp;GameVersion='.
     
    276276        $Output .= '<br /><br />';
    277277
    278         foreach($TranslationTree as $Group)
     278        foreach ($TranslationTree as $Group)
    279279        {
    280280          if ($Group['DBCFileName'] <> '')
     
    283283        }
    284284      }
    285       return($Output);
     285      return $Output;
    286286  }
    287287
     
    291291    $Output = 'Překlad rozhraní přegenerován';
    292292    $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)
    294294      $Output .= '<tr><td>'.$Index.'</td><td>'.$Item.'</td></tr>';
    295295    $Output .= '</table>';
    296296    $Output .= 'Překladové soubory zaktualizovány';
    297     return($Output);
     297    return $Output;
    298298  }
    299299
     
    302302    $this->Title = T('Administration');
    303303    $Output = '';
    304     if($this->System->User->Licence(LICENCE_ADMIN))
     304    if ($this->System->User->Licence(LICENCE_ADMIN))
    305305    {
    306       if(array_key_exists('action', $_GET))
     306      if (array_key_exists('action', $_GET))
    307307      {
    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();
    318318        else $Output .= $this->ShowMenu();
    319319      } else $Output .= $this->ShowMenu();
    320320    } else $Output .= ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    321     return($Output);
     321    return $Output;
    322322  }
    323323}
Note: See TracChangeset for help on using the changeset viewer.