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

    r861 r880  
    4747      'Icon' => '',
    4848    ));
    49     if(array_key_exists('Search', $this->System->ModuleManager->Modules))
     49    if (array_key_exists('Search', $this->System->ModuleManager->Modules))
    5050    {
    5151      $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    52       foreach($TranslationTree as $Group)
     52      foreach ($TranslationTree as $Group)
    5353      {
    5454        $Table = $Group['TablePrefix'];
    5555
    5656        $Columns = array('ID', 'Entry');
    57         foreach($Group['Items'] as $Item)
     57        foreach ($Group['Items'] as $Item)
    5858        {
    59           if($Item['Column'] != '') $Columns[] = $Item['Column'];
     59          if ($Item['Column'] != '') $Columns[] = $Item['Column'];
    6060        }
    6161
     
    7474    $DbResult = $this->Database->query('SELECT UNIX_TIMESTAMP(`Date`) AS `Date`, `User`.`Name` AS `UserName`, `Text` FROM `Log` '.
    7575    'JOIN `User` ON `User`.`ID` = `Log`.`User` WHERE `Type` = 1 ORDER BY `Date` DESC LIMIT 100');
    76     while($DbRow = $DbResult->fetch_assoc())
     76    while ($DbRow = $DbResult->fetch_assoc())
    7777    {
    7878      $Items[] = array
     
    9292      'Items' => $Items,
    9393    ));
    94     return($Output);
     94    return $Output;
    9595  }
    9696
     
    105105    $UnionItems = array();
    106106    $DbResult = $this->Database->query($GroupListQuery);
    107     if($DbResult->num_rows > 0)
    108     {
    109       while($DbRow = $DbResult->fetch_assoc())
     107    if ($DbResult->num_rows > 0)
     108    {
     109      while ($DbRow = $DbResult->fetch_assoc())
    110110      {
    111111        $UnionItems[] = 'SELECT `T`.`ID`, `T`.`Take`, `T`.`User`, `T`.`ModifyTime`, `T`.`Group`, `T`.`GroupName` '.
     
    122122      $DbResult = $this->Database->query($Query);
    123123      $Output .= '<table class="MiniTable"><tr><th>'.T('Date').'</th><th>'.T('Who').'</th><th>'.T('New').'</th><th>'.T('Source').'</th><th>'.T('Group').'</th></tr>';
    124       while($DbRow = $DbResult->fetch_assoc())
     124      while ($DbRow = $DbResult->fetch_assoc())
    125125      {
    126126        $Output .= '<tr><td>'.HumanDate($DbRow['ModifyTime']).'</td>'.
     
    133133    }
    134134    $Output .= '</div>';
    135     return($Output);
     135    return $Output;
    136136  }
    137137
    138138  function GetTranslationTree()
    139139  {
    140     if(isset($this->TranslationTree)) return($this->TranslationTree);
     140    if (isset($this->TranslationTree)) return $this->TranslationTree;
    141141    else {
    142142      $Result = array();
    143143      $Groups = array();
    144144      $DbResult = $this->System->Database->query('SELECT *, UNIX_TIMESTAMP(`LastImport`) AS `LastImportTime` FROM `Group`');
    145       while($DbRow = $DbResult->fetch_assoc())
     145      while ($DbRow = $DbResult->fetch_assoc())
    146146        $Groups[T($DbRow['Name'])] = $DbRow;
    147147      ksort($Groups);
    148       foreach($Groups as $Group)
     148      foreach ($Groups as $Group)
    149149      {
    150150        $Group['Items'] = array();
     
    153153      }
    154154      $DbResult = $this->System->Database->query('SELECT * FROM `GroupItem` ORDER BY `Group`, `Sequence`');
    155       while($DbRow = $DbResult->fetch_assoc())
     155      while ($DbRow = $DbResult->fetch_assoc())
    156156      {
    157157        $Result[$DbRow['Group']]['Items'][] = $DbRow;
    158158      }
    159159      $this->TranslationTree = $Result;
    160       return($Result);
     160      return $Result;
    161161    }
    162162  }
     
    168168    $Output = '<strong>'.T('Translate groups').':</strong><br /><div id="TranslationMenu">';
    169169    $DbResult = $this->System->Database->select('Group', '`Id`, `Name`', '1 ORDER BY `Name`');
    170     while($Group = $DbResult->fetch_assoc())
     170    while ($Group = $DbResult->fetch_assoc())
    171171    {
    172172      $Groups[T($Group['Name'])] = $Group;
    173173    }
    174174    ksort($Groups);
    175     foreach($Groups as $Group)
     175    foreach ($Groups as $Group)
    176176    {
    177177      $Output .= '<div id="menuitem-group'.$Group['Id'].'" onmouseover="show(\'group'.$Group['Id'].'\')" onmouseout="hide(\'group'.$Group['Id'].'\')">'.
     
    183183        '&nbsp;<a title="Přeložené texty, můžete zde hlasovat, nebo opravovat překlady" href="'.
    184184        $this->System->Link('/TranslationList.php?group='.$Group['Id'].'&amp;state=2&amp;user=0&amp;entry=&amp;text=').'">'.T('Translated').'</a><br />';
    185       if(isset($this->System->User) and $this->System->User->Licence(LICENCE_USER))
     185      if (isset($this->System->User) and $this->System->User->Licence(LICENCE_USER))
    186186      {
    187187        $Output .= '&nbsp;<a title="'.T('Unfinished translations').'" href="'.$this->System->Link('/TranslationList.php?group='.$Group['Id'].'&amp;state=3').'">'.T('Unfinished').'</a><br />'.
     
    196196    }
    197197    $Output .= '</div>';
    198     return($Output);
     198    return $Output;
    199199  }
    200200}
Note: See TracChangeset for help on using the changeset viewer.