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/Translation/Progress.php

    r847 r880  
    88
    99    $BuildNumber = GetBuildNumber($_SESSION['StatVersion']);
    10     if(is_numeric($_SESSION['language'])) $LanguageFilter = 'AND (`Language`='.$_SESSION['language'].')';
     10    if (is_numeric($_SESSION['language'])) $LanguageFilter = 'AND (`Language`='.$_SESSION['language'].')';
    1111    else $LanguageFilter = ' AND (`Language`!='.$this->System->Config['OriginalLanguage'].')';
    1212
     
    1414    $Query = '';
    1515    $DbResult = $this->Database->query($GroupListQuery);
    16     if($DbResult->num_rows > 0)
     16    if ($DbResult->num_rows > 0)
    1717    {
    18       while($DbRow = $DbResult->fetch_assoc())
     18      while ($DbRow = $DbResult->fetch_assoc())
    1919      {
    2020        $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
     
    5050      $Total = 0;
    5151      $DbResult = $this->Database->query('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.$Query.') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']);
    52       while($Group = $DbResult->fetch_assoc())
     52      while ($Group = $DbResult->fetch_assoc())
    5353      {
    5454        $Output .= '<tr><td>'.T($Group['Name']).'</td><td>'.$Group['Translated'].'</td><td>'.$Group['Total'].'</td><td>'.ProgressBar(150, $Group['Percent']).'</td></tr>';
     
    5656        $Total += $Group['Total'];
    5757      }
    58       if($Total <> 0) $TotalCount = round($Translated / $Total * 100, 2);
     58      if ($Total <> 0) $TotalCount = round($Translated / $Total * 100, 2);
    5959      else $TotalCount = 0;
    6060      $Output .= '<tr><td><strong>'.T('Total').'</strong></td><td><strong>'.$Translated.'</strong></td><td><strong>'.$Total.'</strong></td><td><strong>'.ProgressBar(150, $TotalCount).'</strong></td></tr>'.
    6161          '</table>';
    6262    }
    63     return($Output);
     63    return $Output;
    6464  }
    6565
     
    6969    $LanguageList = GetLanguageList();
    7070
    71     if(array_key_exists('Version', $_GET)) $_SESSION['StatVersion'] = $_GET['Version'];
    72     if(!array_key_exists('StatVersion', $_SESSION))
     71    if (array_key_exists('Version', $_GET)) $_SESSION['StatVersion'] = $_GET['Version'];
     72    if (!array_key_exists('StatVersion', $_SESSION))
    7373    {
    74       if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->PreferredVersionGame != ''))
     74      if ($this->System->User->Licence(LICENCE_USER) and ($this->System->User->PreferredVersionGame != ''))
    7575      {
    7676        $_SESSION['StatVersion'] = $this->System->User->PreferredVersionGame;
     
    8080    }
    8181
    82     if(!isset($_SESSION['language']))
     82    if (!isset($_SESSION['language']))
    8383    {
    84       if($this->System->User->Licence(LICENCE_USER))
     84      if ($this->System->User->Licence(LICENCE_USER))
    8585      {
    8686        $_SESSION['language'] = $this->System->User->Language;
     
    8989      }
    9090    }
    91     if(array_key_exists('language', $_GET))
     91    if (array_key_exists('language', $_GET))
    9292    {
    93       if($_GET['language'] == '') {
     93      if ($_GET['language'] == '') {
    9494        $_SESSION['language'] = '';
    9595      } else {
     
    9797      }
    9898    }
    99     if(!array_key_exists($_SESSION['language'], $LanguageList)) $_SESSION['language'] = '';
     99    if (!array_key_exists($_SESSION['language'], $LanguageList)) $_SESSION['language'] = '';
    100100
    101101    // Show client version selection
    102102    $Output = T('Client version:').' ';
    103103    $DbResult = $this->Database->query('SELECT `Version`, `Title` FROM `ClientVersion` WHERE `Imported`=1 ORDER BY `Version`');
    104     while($DbRow = $DbResult->fetch_assoc())
     104    while ($DbRow = $DbResult->fetch_assoc())
    105105      $Output .= '<a href="?Version='.$DbRow['Version'].'" title="'.$DbRow['Title'].'">'.$DbRow['Version'].'</a> ';
    106106    $Output .= '<br/>';
     
    109109    $Output .= T('Language:').' ';
    110110    $Lang = '<a href="?language=">'.T('All').'</a>';
    111     if($_SESSION['language'] == '') $Output .= '<strong>'.$Lang.'</strong> ';
     111    if ($_SESSION['language'] == '') $Output .= '<strong>'.$Lang.'</strong> ';
    112112      else $Output .= $Lang;
    113     foreach($LanguageList as $Language)
    114     if($Language['Enabled'] == 1)
     113    foreach ($LanguageList as $Language)
     114    if ($Language['Enabled'] == 1)
    115115    {
    116116      $Lang = ' <a href="?language='.$Language['Id'].'">'.T($Language['Name']).'</a>';
    117       if($Language['Id'] == $_SESSION['language']) $Output .= '<strong>'.$Lang.'</strong> ';
     117      if ($Language['Id'] == $_SESSION['language']) $Output .= '<strong>'.$Lang.'</strong> ';
    118118        else $Output .= $Lang;
    119119    }
    120120
    121     if(is_numeric($_SESSION['language'])) $LanguageName = $LanguageList[$_SESSION['language']]['Name'];
     121    if (is_numeric($_SESSION['language'])) $LanguageName = $LanguageList[$_SESSION['language']]['Name'];
    122122      else $LanguageName = T('All');
    123123    $Output .= '<br/><br/><h3>'.sprintf(T('Statistics of translation completion of language %s for version %s'), T($LanguageName), $_SESSION['StatVersion']).'</h3><br/>';
    124124    $Output .= $this->ShowStatTable();
    125125
    126     return($Output);
     126    return $Output;
    127127  }
    128128}
Note: See TracChangeset for help on using the changeset viewer.