Ignore:
Timestamp:
Mar 6, 2023, 1:48:45 AM (22 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/Translation/Progress.php

    r888 r893  
    99    $BuildNumber = GetBuildNumber($_SESSION['StatVersion']);
    1010    if (is_numeric($_SESSION['language'])) $LanguageFilter = 'AND (`Language`='.$_SESSION['language'].')';
    11     else $LanguageFilter = ' AND (`Language`!='.$this->System->Config['OriginalLanguage'].')';
     11    else $LanguageFilter = ' AND (`Language`!='.Core::Cast($this->System)->Config['OriginalLanguage'].')';
    1212
    1313    $GroupListQuery = 'SELECT `Id`, `TablePrefix`, `Name` FROM `Group`';
     
    2525          '(SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
    2626          'SELECT `T`.`Entry` FROM `'.$DbRow['TablePrefix'].'` AS `T` '.
    27           'WHERE (`Language` = '.$this->System->Config['OriginalLanguage'].') '.
     27          'WHERE (`Language` = '.Core::Cast($this->System)->Config['OriginalLanguage'].') '.
    2828          'AND (`VersionStart` <= '.$BuildNumber.') AND (`VersionEnd` >= '.$BuildNumber.')'.
    2929          ') AS `C2`) AS `Total`, "'.$DbRow['Name'].'" AS `Name` UNION ';
     
    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>'.
    61           '</table>';
     61        '</table>';
    6262    }
    6363    return $Output;
     
    6666  function Show(): string
    6767  {
     68    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
    6869    $this->Title = T('Progress');
    6970    $LanguageList = GetLanguageList();
     
    7273    if (!array_key_exists('StatVersion', $_SESSION))
    7374    {
    74       if ($this->System->User->Licence(LICENCE_USER) and ($this->System->User->PreferredVersionGame != ''))
     75      if ($User->Licence(LICENCE_USER) and ($User->PreferredVersionGame != ''))
    7576      {
    76         $_SESSION['StatVersion'] = $this->System->User->PreferredVersionGame;
    77       } else {
    78         $_SESSION['StatVersion'] = $this->System->Config['Web']['GameVersion'];
     77        $_SESSION['StatVersion'] = $User->PreferredVersionGame;
     78      } else
     79      {
     80        $_SESSION['StatVersion'] = Core::Cast($this->System)->Config['Web']['GameVersion'];
    7981      }
    8082    }
     
    8284    if (!isset($_SESSION['language']))
    8385    {
    84       if ($this->System->User->Licence(LICENCE_USER))
     86      if ($User->Licence(LICENCE_USER))
    8587      {
    86         $_SESSION['language'] = $this->System->User->Language;
    87       } else {
     88        $_SESSION['language'] = $User->Language;
     89      } else
     90      {
    8891        $_SESSION['language'] = '';
    8992      }
     
    9396      if ($_GET['language'] == '') {
    9497        $_SESSION['language'] = '';
    95       } else {
     98      } else
     99      {
    96100        $_SESSION['language'] = $_GET['language'] * 1;
    97101      }
     
    103107    $DbResult = $this->Database->query('SELECT `Version`, `Title` FROM `ClientVersion` WHERE `Imported`=1 ORDER BY `Version`');
    104108    while ($DbRow = $DbResult->fetch_assoc())
     109    {
    105110      $Output .= '<a href="?Version='.$DbRow['Version'].'" title="'.$DbRow['Title'].'">'.$DbRow['Version'].'</a> ';
     111    }
    106112    $Output .= '<br/>';
    107113
Note: See TracChangeset for help on using the changeset viewer.