Changeset 900 for trunk/Modules


Ignore:
Timestamp:
Apr 10, 2024, 11:49:39 PM (3 weeks ago)
Author:
chronos
Message:
  • Fixed: More form input fields validation.
  • Modified: Code cleanup.
Location:
trunk/Modules
Files:
11 edited

Legend:

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

    r894 r900  
    300300  if ($DbResult->num_rows == 0)
    301301  {
    302     $System->Database->query('INSERT INTO ExportTask (`Export` ,`TimeStart` ) VALUES ('.$ExportId.', NOW())');
     302    $System->Database->query('INSERT INTO `ExportTask` (`Export`, `TimeStart` ) VALUES ('.$ExportId.', NOW())');
    303303    $System->ModuleManager->Modules['Log']->WriteLog('Zadání úlohy pro vygenerování DBC souboru', LOG_TYPE_DOWNLOAD);
    304304  }
  • trunk/Modules/Export/ProcessTask.php

    r899 r900  
    156156    $this->DeleteOldFiles($Export->TempDir.'CzWoW');
    157157
    158     // copy need files
     158    // copy needed files
    159159    $this->SetProgress(5);
    160160    echo('Copy files...'."\n");
  • trunk/Modules/Forum/Forum.php

    r893 r900  
    167167    $DbResult = $this->System->Database->query('SELECT * FROM `ForumThread` WHERE 1 ORDER BY `ID` DESC '.$PageList['SQLLimit']);
    168168    while ($Line = $DbResult->fetch_assoc())
     169    {
    169170      $Output .= '<div><span style="float:right;"><strong>'.$Line['UserName'].
    170     '</strong> - ('.HumanDate($Line['Date']).')</span> <a href="?Thread='.$Line['ID'].'">'.
    171     str_replace("\n", '', htmlspecialchars($Line['Text'])).'</a></div>';
     171        '</strong> - ('.HumanDate($Line['Date']).')</span> <a href="?Thread='.$Line['ID'].'">'.
     172        str_replace("\n", '', htmlspecialchars($Line['Text'])).'</a></div>';
     173    }
    172174    $Output .= '</div>'.$PageList['Output'];
    173175    return $Output;
  • trunk/Modules/Referrer/Referrer.php

    r893 r900  
    9393    $Output .= $BannerSmall.' &nbsp;&nbsp;<textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />';
    9494
    95     if ($User->Licence(LICENCE_ADMIN)) {
    96 
    97     $MonthAge = 3;
    98     $YesNo = array('Ne', 'Ano');
    99     $Output .= '<br/><strong>'.T('Servers referring to us').':</strong> <br />
    100     <div style="font-size: 10px;">Seznam je automaticky aktualizován a zobrazeny jsou servery, ze kterých přišli uživatelé během posledních třech měsíců řazený sestupně dle nejnovějších.</div><br />';
    101 
    102     if (!$User->Licence(LICENCE_ADMIN)) $Where = ' WHERE (`Visible`=1) AND (`Parent` IS NULL)';
    103     else $Where = '';
    104     $Query = 'SELECT *, (SELECT Web FROM `Referrer` AS T4 WHERE T4.Id = T3.Parent) AS ParentName '.
     95    if ($User->Licence(LICENCE_ADMIN))
     96    {
     97      $MonthAge = 3;
     98      $YesNo = array('Ne', 'Ano');
     99      $Output .= '<br/><strong>'.T('Servers referring to us').':</strong> <br />'.
     100        '<div style="font-size: 10px;">Seznam je automaticky aktualizován a zobrazeny jsou servery, ze kterých přišli uživatelé během posledních třech měsíců řazený sestupně dle nejnovějších.</div><br />';
     101
     102      if (!$User->Licence(LICENCE_ADMIN)) $Where = ' WHERE (`Visible`=1) AND (`Parent` IS NULL)';
     103        else $Where = '';
     104      $Query = 'SELECT *, (SELECT Web FROM `Referrer` AS T4 WHERE T4.Id = T3.Parent) AS ParentName '.
    105105        'FROM (SELECT *, '.
    106106        '(`Hits` + COALESCE((SELECT SUM(`Hits`) FROM '.
     
    111111        'WHERE (`T3`.`MaxDateLast` > (NOW() - INTERVAL '.$MonthAge.' MONTH))';
    112112
    113 
    114     $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS T');
    115     $DbRow = $DbResult->fetch_row();
    116     $PageList = GetPageList($DbRow[0]);
    117 
    118     $Output .= $PageList['Output'].
    119     '<table class="BaseTable">';
    120 
    121     $TableColumns = array(
     113      $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS T');
     114      $DbRow = $DbResult->fetch_row();
     115      $PageList = GetPageList($DbRow[0]);
     116
     117      $Output .= $PageList['Output'].
     118        '<table class="BaseTable">';
     119
     120      $TableColumns = array(
    122121        array('Name' => 'Web', 'Title' => T('Address')),
    123122        array('Name' => 'MaxDateLast', 'Title' => T('Last visit')),
    124123        array('Name' => 'TotalHits', 'Title' => T('Hits')),
    125     );
    126     if ($User->Licence(LICENCE_ADMIN))
    127     {
    128       $TableColumns[] = array('Name' => 'Visible', 'Title' => T('Visible'));
    129       $TableColumns[] = array('Name' => 'Parent', 'Title' => T('Parent'));
    130       $TableColumns[] = array('Name' => 'Description', 'Title' => T('Comment'));
    131       $TableColumns[] = array('Name' => 'LastIP', 'Title' => T('Last IP address'));
    132       $TableColumns[] = array('Name' => 'Action', 'Title' => T('Actions'));
    133     }
    134     $Order = GetOrderTableHeader($TableColumns, 'MaxDateLast', 1);
    135     $Output .= $Order['Output'];
    136 
    137     $Query .= $Order['SQL'].$PageList['SQLLimit'];
    138 
    139     $DbResult = $this->Database->query($Query);
    140     while ($Line = $DbResult->fetch_assoc())
    141     {
    142       $Output .= '<tr><td><a href="'.$Line['LastURL'].'">'.$Line['Web'].'</a></td>'.
     124      );
     125      if ($User->Licence(LICENCE_ADMIN))
     126      {
     127        $TableColumns[] = array('Name' => 'Visible', 'Title' => T('Visible'));
     128        $TableColumns[] = array('Name' => 'Parent', 'Title' => T('Parent'));
     129        $TableColumns[] = array('Name' => 'Description', 'Title' => T('Comment'));
     130        $TableColumns[] = array('Name' => 'LastIP', 'Title' => T('Last IP address'));
     131        $TableColumns[] = array('Name' => 'Action', 'Title' => T('Actions'));
     132      }
     133      $Order = GetOrderTableHeader($TableColumns, 'MaxDateLast', 1);
     134      $Output .= $Order['Output'];
     135
     136      $Query .= $Order['SQL'].$PageList['SQLLimit'];
     137
     138      $DbResult = $this->Database->query($Query);
     139      while ($Line = $DbResult->fetch_assoc())
     140      {
     141        $Output .= '<tr><td><a href="'.$Line['LastURL'].'">'.$Line['Web'].'</a></td>'.
    143142          '<td>'.HumanDate($Line['MaxDateLast']).'</td>'.
    144143          '<td>'.$Line['TotalHits'].'</td>';
    145       if ($User->Licence(LICENCE_ADMIN))
    146       {
    147         $Output .=
    148         '<td>'.$YesNo[$Line['Visible']].'</td>'.
    149         '<td>'.$Line['ParentName'].'</td>'.
    150         '<td>'.$Line['Description'].'</td>'.
    151         '<td>'.$Line['LastIP'].'</td>'.
    152         '<td><a href="?action=edit&amp;id='.$Line['Id'].'">'.T('Modify').'</a> '.
    153         '<a href="?action=spam&amp;id='.$Line['Id'].'">'.T('Spam').'</a></td>';
     144        if ($User->Licence(LICENCE_ADMIN))
     145        {
     146          $Output .=
     147          '<td>'.$YesNo[$Line['Visible']].'</td>'.
     148          '<td>'.$Line['ParentName'].'</td>'.
     149          '<td>'.$Line['Description'].'</td>'.
     150          '<td>'.$Line['LastIP'].'</td>'.
     151          '<td><a href="?action=edit&amp;id='.$Line['Id'].'">'.T('Modify').'</a> '.
     152          '<a href="?action=spam&amp;id='.$Line['Id'].'">'.T('Spam').'</a></td>';
     153        }
     154        $Output .= '</tr>';
    154155      }
    155       $Output .= '</tr>';
    156     }
    157     $Output .= '</table>';
    158     $Output .= $PageList['Output'];
    159 
     156      $Output .= '</table>';
     157      $Output .= $PageList['Output'];
    160158    }
    161159    return $Output;
     
    263261  }
    264262}
    265 
  • trunk/Modules/Translation/Comparison.php

    r893 r900  
    4747    if ($User->Licence(LICENCE_USER))
    4848    {
    49     $Output = 'Text je porovnáván vždy ku předešlému (vlevo). Změny jsou zvýrazněny <span class="edit">barvou.</span><br /><br />';
     49      $Output = 'Text je porovnáván vždy ku předešlému (vlevo). Změny jsou zvýrazněny <span class="edit">barvou.</span><br /><br />';
     50 
     51      $GroupId = LoadGroupIdParameter();
     52      $Table = $TranslationTree[$GroupId]['TablePrefix'];
    5053
    51     $GroupId = LoadGroupIdParameter();
    52     $Table = $TranslationTree[$GroupId]['TablePrefix'];
     54      if (array_key_exists('entry', $_GET))
     55      {
     56        $Textentry = $_GET['entry'];
     57        if ((array_key_exists('ID1', $_GET)) and ($_GET['ID1'] <> -1))  //porovnání pouze 2 textů
     58        {
     59          $TextID1 = $_GET['ID1'];
     60          $TextID2 = $_GET['ID2'];
     61          $WhereID = ' AND ((`'.$Table.'`.`ID` = '.$TextID1.') OR (`'.$Table.'`.`ID` = '.$TextID2.'))';
     62        } else $WhereID = '';
    5363
    54     if (array_key_exists('entry', $_GET))
    55     {
    56       $Textentry = $_GET['entry'];
    57       if ((array_key_exists('ID1', $_GET)) and ($_GET['ID1'] <> -1))  //porovnání pouze 2 textů
    58       {
    59         $TextID1 = $_GET['ID1'];
    60         $TextID2 = $_GET['ID2'];
    61         $WhereID = ' AND ((`'.$Table.'`.`ID` = '.$TextID1.') OR (`'.$Table.'`.`ID` = '.$TextID2.'))';
    62       } else $WhereID = '';
    63 
    64       $DataID = $this->Database->query('SELECT `'.$Table.'`.*, `User`.`Name` AS `UserName`, '.
     64        $DataID = $this->Database->query('SELECT `'.$Table.'`.*, `User`.`Name` AS `UserName`, '.
    6565          '`Language`.`Name` AS `LanguageName` '.
    6666          'FROM '.$Table.' LEFT JOIN `User` ON `User`.`Id` = `'.$Table.'`.`User` '.
    6767          ' LEFT JOIN `Language` ON `Language`.`Id` = `'.$Table.'`.`Language` '.
    6868          'WHERE `Entry` = '.$Textentry.' '.$WhereID.' ORDER BY `Language`');
    69       while ($Line[] = $DataID->fetch_assoc());
    70       array_pop($Line);
     69        while ($Line[] = $DataID->fetch_assoc());
     70        array_pop($Line);
    7171
    72       $Output .= 'Počet porovnávaných textů: <strong>'.count($Line).'</strong><br /> ';
     72        $Output .= 'Počet porovnávaných textů: <strong>'.count($Line).'</strong><br /> ';
    7373
    74       $Output .= '<strong>Číslo textu: <a href="http://www.wowhead.com/?quest='.$Textentry.'">'.$Textentry.'</a></strong>'.
     74        $Output .= '<strong>Číslo textu: <a href="http://www.wowhead.com/?quest='.$Textentry.'">'.$Textentry.'</a></strong>'.
    7575          '<table class="BaseTable">'.
    7676          '<tr><th>Přeložil</th>';
    77       foreach ($Line as $Index => $LineItem)
    78         $Output .= '<th>'.$LineItem['UserName'].'</th>';
    79       $Output .= '</tr>'.
     77        foreach ($Line as $Index => $LineItem)
     78          $Output .= '<th>'.$LineItem['UserName'].'</th>';
     79        $Output .= '</tr>'.
    8080          '<tr>'.
    8181          '<th>ID textu</th>';
    82       foreach ($Line as $Index => $LineItem)
    83         $Output .= '<td><a href="form.php?group='.$GroupId.'&amp;ID='.$LineItem['ID'].'">'.$LineItem['ID'].'</a></td>';
    84       $Output .= '</tr>'.
     82        foreach ($Line as $Index => $LineItem)
     83          $Output .= '<td><a href="form.php?group='.$GroupId.'&amp;ID='.$LineItem['ID'].'">'.$LineItem['ID'].'</a></td>';
     84        $Output .= '</tr>'.
    8585          '<tr><th>Převzato</th>';
    86       foreach ($Line as $Index => $LineItem)
    87         $Output .= '<td><a href="form.php?group='.$GroupId.'&amp;ID='.$LineItem['Take'].'">'.$LineItem['Take'].'</a></td>';
    88       $Output .= '</tr>'.
     86        foreach ($Line as $Index => $LineItem)
     87          $Output .= '<td><a href="form.php?group='.$GroupId.'&amp;ID='.$LineItem['Take'].'">'.$LineItem['Take'].'</a></td>';
     88        $Output .= '</tr>'.
    8989          '<tr><th>'.T('Language').'</th>';
    90       foreach ($Line as $Index => $LineItem)
    91         $Output .= '<td>'.T($LineItem['LanguageName']).'</td>';
    92       $Output .= '</tr>'.
     90        foreach ($Line as $Index => $LineItem)
     91          $Output .= '<td>'.T($LineItem['LanguageName']).'</td>';
     92        $Output .= '</tr>'.
    9393          '<tr><th>'.T('Version').'</th>';
    94       foreach ($Line as $Index => $LineItem)
    95         $Output .= '<td>'.GetVersionWOW($LineItem['VersionStart']).' - '.GetVersionWOW($LineItem['VersionEnd']).'</td>';
    96       $Output .= '</tr>';
    97       foreach ($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    98       {
    99         $writethis = false;
    100         for ($i = 0; $i < count($Line); $i++)
     94        foreach ($Line as $Index => $LineItem)
     95          $Output .= '<td>'.GetVersionWOW($LineItem['VersionStart']).' - '.GetVersionWOW($LineItem['VersionEnd']).'</td>';
     96        $Output .= '</tr>';
     97        foreach ($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    10198        {
    102           if ($Line[$i][$TextItem['Column']] <> '') $writethis = true;
    103         }
    104         if ($writethis)
    105         {
    106           $Output .= '<tr><th>'.$TextItem['Name'].'</th>';
     99          $writethis = false;
    107100          for ($i = 0; $i < count($Line); $i++)
    108101          {
    109             if ($i > 0)
     102            if ($Line[$i][$TextItem['Column']] <> '') $writethis = true;
     103          }
     104          if ($writethis)
     105          {
     106            $Output .= '<tr><th>'.$TextItem['Name'].'</th>';
     107            for ($i = 0; $i < count($Line); $i++)
    110108            {
    111               $Output .= '<td>';
    112               $Output .= str_replace("\n", '<br/>', $this->CompareString(htmlspecialchars($Line[$i][$TextItem['Column']]),htmlspecialchars($Line[$i - 1][$TextItem['Column']])));
    113               $Output .= '</td>';
    114             } else $Output .= '<td>'.htmlspecialchars($Line[$i][$TextItem['Column']]).'</td>';
     109              if ($i > 0)
     110              {
     111                $Output .= '<td>';
     112                $Output .= str_replace("\n", '<br/>', $this->CompareString(htmlspecialchars($Line[$i][$TextItem['Column']]),htmlspecialchars($Line[$i - 1][$TextItem['Column']])));
     113                $Output .= '</td>';
     114              } else $Output .= '<td>'.htmlspecialchars($Line[$i][$TextItem['Column']]).'</td>';
     115            }
     116            $Output .= '</tr>';
    115117          }
    116           $Output .= '</tr>';
    117118        }
    118       }
    119       $Output .= '</table>';
    120     } else $Output .= ShowMessage('Nebylo zadáno ID.', MESSAGE_CRITICAL);
    121   } else $Output .= ShowMessage('Porovnávat můžou pouze překladatelé!', MESSAGE_CRITICAL);
     119        $Output .= '</table>';
     120      } else $Output .= ShowMessage('Nebylo zadáno ID.', MESSAGE_CRITICAL);
     121    } else $Output .= ShowMessage('Porovnávat můžou pouze překladatelé!', MESSAGE_CRITICAL);
    122122
    123123    return $Output;
  • trunk/Modules/Translation/Form.php

    r893 r900  
    2828    $Table = $TranslationTree[$GroupId]['TablePrefix'];
    2929    if (array_key_exists('action', $_GET)) $Action = $_GET['action'];
    30     else $Action = '';
     30      else $Action = '';
    3131
    3232    if (array_key_exists('ID', $_GET))
     
    5050          foreach ($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    5151            $Columns .= ' `Orig`.`'.$TextItem['Column'].'` as `Orig_'.$TextItem['Column'].'`, `Tran`.`'.$TextItem['Column'].'` as `'.$TextItem['Column'].'`,';
    52 
    5352
    5453          $sql = 'SELECT '.$Columns.' Tran.`Entry` FROM `'.$Table.'` as Tran';
     
    175174
    176175          if ($TranslationTree[$GroupId]['WowheadName'] != '')
    177             $WowheadLink = '<a href="http://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName'].
     176            $WowheadLink = '<a href="https://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName'].
    178177              '='.$LineAJ['Entry'].'">'.$LineAJ['Entry'].'</a>';
    179178          else $WowheadLink = $LineAJ['Entry'];
    180179
    181           $Output .= '<input type="hidden" name="entry" value="'.$LineAJ['Entry'].'" />
    182           <input type="hidden" name="user" value="'.$User->Id.'" />
    183           <input type="hidden" name="ID" value="'.$TextID.'" />
    184           <table class="BaseTable">
    185           <tr>
    186           <th>'.T('Text number').': '.$WowheadLink.'</th>
    187           <th>'.T('Not translated').'</th>
    188           <th>'.T('Translated').'</th>
    189           </tr>
    190           <tr>
    191           <th>'.T('Language').'</th>
    192           <td>'.T('Original').'</td>
    193           <td>';
     180          $Output .= '<input type="hidden" name="entry" value="'.$LineAJ['Entry'].'" />'.
     181            '<input type="hidden" name="user" value="'.$User->Id.'" />'.
     182            '<input type="hidden" name="ID" value="'.$TextID.'" />'.
     183            '<table class="BaseTable">'.
     184            '<tr>'.
     185            '<th>'.T('Text number').': '.$WowheadLink.'</th>'.
     186            '<th>'.T('Not translated').'</th>'.
     187            '<th>'.T('Translated').'</th>'.
     188            '</tr>'.
     189            '<tr>'.
     190            '<th>'.T('Language').'</th>'.
     191            '<td>'.T('Original').'</td>'.
     192            '<td>';
    194193          if ($Line['Language'] <> 0) $Language = $Line['Language'];
    195194          else if ($User->Id != 0)
     
    239238                if ($User->Licence(LICENCE_USER))
    240239                  $Output .= '<textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'">';
    241                 $Output .=  htmlspecialchars($Line[$TextItem['Column']]);
     240                $Output .= htmlspecialchars($Line[$TextItem['Column']]);
    242241                if ($User->Licence(LICENCE_USER)) $Output .= '</textarea></td></tr>';
    243242              }
  • trunk/Modules/Translation/LoadNames.php

    r893 r900  
    33class PageLoadNames extends Page
    44{
    5   function ReplaceTranslated($orig,$tran,$Text,$ID,$Group)
     5  function ReplaceTranslated($orig, $tran, $Text, $ID, $Group)
    66  {
    77    $tran_replace = str_replace(' ','&nbsp;',htmlspecialchars($tran));
     
    2121  }
    2222
    23   function ReplaceNotTranslated($orig,$tran,$Text,$ID,$Group)
     23  function ReplaceNotTranslated($orig, $tran, $Text, $ID, $Group)
    2424  {
    2525    $orig_replace = str_replace(' ','&nbsp;',htmlspecialchars($orig));
     
    9696          }
    9797          //$LineAJ[$Column]
    98           return $this->ColorNames(htmlspecialchars($Text),$names);
     98          return $this->ColorNames(htmlspecialchars($Text), $names);
    9999    }
    100100
  • trunk/Modules/Translation/Save.php

    r893 r900  
    1818      // Get data for english original
    1919      $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE (`Entry`='.$SourceText['Entry'].') '.
    20           'AND (`Language` = '.Core::Cast($this->System)->Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart'].') '.
    21           'AND (`VersionEnd` = '.$SourceText['VersionEnd'].')');
     20        'AND (`Language` = '.Core::Cast($this->System)->Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart'].') '.
     21        'AND (`VersionEnd` = '.$SourceText['VersionEnd'].')');
    2222      if ($DbResult->num_rows > 0)
    2323      {
  • trunk/Modules/Translation/TranslationList.php

    r893 r900  
    257257
    258258    $Query = 'SELECT `T`.`ModifyTime`, `T`.`ID`, `T`.`Entry`, `T`.`VersionStart`, `T`.`VersionEnd`, '.
    259         '`T`.`'.$TranslationTree[$Filter['Group']]['Items'][0]['Column'].'`, '.
    260         '`User`.`Name` AS `UserName`, `User`.`ID` AS `UserId`, '.
    261         '`Language`.`Name` AS `LanguageName`, `TS`.`Version` AS `VersionStartText`, `TE`.`Version` AS `VersionEndText` '.
    262         'FROM `'.$Table.'` AS `T` '.
    263         'LEFT JOIN `User` ON `User`.`ID` = `T`.`User` '.
    264         'LEFT JOIN `Language` ON `Language`.`ID` = `T`.`Language` '.
    265         'LEFT JOIN `ClientVersion` AS `TS` ON `TS`.`BuildNumber` = `T`.`VersionStart` '.
    266         'LEFT JOIN `ClientVersion` AS `TE` ON `TE`.`BuildNumber` = `T`.`VersionEnd` '.
    267         'WHERE 1 '.$Filter['SQL'];
     259      '`T`.`'.$TranslationTree[$Filter['Group']]['Items'][0]['Column'].'`, '.
     260      '`User`.`Name` AS `UserName`, `User`.`ID` AS `UserId`, '.
     261      '`Language`.`Name` AS `LanguageName`, `TS`.`Version` AS `VersionStartText`, `TE`.`Version` AS `VersionEndText` '.
     262      'FROM `'.$Table.'` AS `T` '.
     263      'LEFT JOIN `User` ON `User`.`ID` = `T`.`User` '.
     264      'LEFT JOIN `Language` ON `Language`.`ID` = `T`.`Language` '.
     265      'LEFT JOIN `ClientVersion` AS `TS` ON `TS`.`BuildNumber` = `T`.`VersionStart` '.
     266      'LEFT JOIN `ClientVersion` AS `TE` ON `TE`.`BuildNumber` = `T`.`VersionEnd` '.
     267      'WHERE 1 '.$Filter['SQL'];
    268268
    269269    // Get total item count
    270     $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS `TT`');
     270    $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$Query.') AS `TT`');   
    271271    $DbRow = $DbResult->fetch_row();
    272272    $PageList = GetPageList($DbRow[0]);
     
    274274    $Output .= $PageList['Output'];
    275275    $TableColumns = array(
    276         array('Name' => 'ID', 'Title' => T('Number')),
    277         array('Name' => 'Entry', 'Title' => T('Item')),
    278         array('Name' => $TranslationTree[$Filter['Group']]['Items'][0]['Column'], 'Title' => T('Name')),
    279         array('Name' => 'VersionStart', 'Title' => T('From version')),
    280         array('Name' => 'VersionEnd', 'Title' => T('To version')),
    281         array('Name' => 'LanguageName', 'Title' => T('Language')),
    282         array('Name' => 'UserName', 'Title' => T('Translator')),
    283         array('Name' => 'ModifyTime', 'Title' => T('Date')),
     276      array('Name' => 'ID', 'Title' => T('Number')),
     277      array('Name' => 'Entry', 'Title' => T('Item')),
     278      array('Name' => $TranslationTree[$Filter['Group']]['Items'][0]['Column'], 'Title' => T('Name')),
     279      array('Name' => 'VersionStart', 'Title' => T('From version')),
     280      array('Name' => 'VersionEnd', 'Title' => T('To version')),
     281      array('Name' => 'LanguageName', 'Title' => T('Language')),
     282      array('Name' => 'UserName', 'Title' => T('Translator')),
     283      array('Name' => 'ModifyTime', 'Title' => T('Date')),
    284284    );
    285285
    286286    $Order = GetOrderTableHeader($TableColumns, 'VersionStart', 1);
    287287    $Output .= '<table class="BaseTable">'.
    288         $Order['Output'];
     288      $Order['Output'];
    289289
    290290    $DbResult = $this->Database->query($Query.' '.$Order['SQL'].' '.$PageList['SQLLimit']);
    291291    while ($Line = $DbResult->fetch_assoc())
    292292    {
     293      $Text = $Line[$TranslationTree[$Filter['Group']]['Items'][0]['Column']];
     294      if ($Text != null) $Text = htmlspecialchars($Text);
     295
    293296      $Output .= '<tr><td><a href="'.$this->System->Link('/form.php?group='.$Filter['Group'].'&amp;ID='.$Line['ID']).'">'.$Line['ID'].'</a></td>'.
    294297        '<td>'.$Line['Entry'].'</td>'.
    295         '<td>'.htmlspecialchars($Line[$TranslationTree[$Filter['Group']]['Items'][0]['Column']]).'</td>'.
     298        '<td>'.$Text.'</td>'.
    296299        '<td><a href="'.$this->System->Link('/client-version/?action=item&amp;id='.
    297300          GetVersionWOWId($Line['VersionStart'])).'">'.GetVersionWOW($Line['VersionStart']).'</a></td>'.
     
    317320    $Total = 0;
    318321    foreach ($TranslationTree as $Group)
     322    {
    319323      if ($Group['TablePrefix'] != '')
    320324      {
     
    326330        $Total += $Line[0];
    327331      }
    328       $Output .= '<tr><td><strong>'.T('Total').'</strong></td><td><strong>'.$Total.'</strong></td></tr>'.
    329           '</table>';
    330       return $Output;
     332    }
     333    $Output .= '<tr><td><strong>'.T('Total').'</strong></td><td><strong>'.$Total.'</strong></td></tr>'.
     334      '</table>';
     335    return $Output;
    331336  }
    332337
     
    338343    $GroupId = GetParameter('group', 0, true);
    339344    if ($GroupId == 0) $Output = ShowMessage('Skupina nenalezena', MESSAGE_CRITICAL);
    340     else {
     345    else
     346    {
    341347      $Table = $TranslationTree[$GroupId]['TablePrefix'];
    342348
    343349      $Output = '<h3>'.T('Basic text filtering').'</h3><br/>'.
    344           '<table class="BaseTable"><tr><th>'.T('Link').'</th><th>'.T('Description').'</th></tr>'.
    345           '<tr><td><a title="'.T('All texts available in group').'" href="?group='.$GroupId.'&amp;state=4">'.T('All').'</a></td>'.
    346           '<td>'.T('Show all available original texts in group').'</td></tr>'.
    347           '<tr><td><a title="'.T('Translated texts, you can modify them here').'" href="?group='.$GroupId.'&amp;state=2">'.T('Translated').'</a></td>'.
    348           '<td>'.T('Show only translated texts').'</td></tr>'.
    349           '<tr><td><a title="'.T('Untranslated texts').'" href="?group='.$GroupId.'&amp;state=1">'.T('Untranslated').'</a></td>'.
    350           '<td>'.T('Not yet translated texts which need to be translated').'</td></tr>'.
    351           '<tr><td><a title="'.T('Unfinished texts').'" href="?group='.$GroupId.'&amp;state=3">'.T('Unfinished').'</a></td>'.
    352           '<td>'.T('Texts marked as unfinished').'</td></tr>';
     350        '<table class="BaseTable"><tr><th>'.T('Link').'</th><th>'.T('Description').'</th></tr>'.
     351        '<tr><td><a title="'.T('All texts available in group').'" href="?group='.$GroupId.'&amp;state=4">'.T('All').'</a></td>'.
     352        '<td>'.T('Show all available original texts in group').'</td></tr>'.
     353        '<tr><td><a title="'.T('Translated texts, you can modify them here').'" href="?group='.$GroupId.'&amp;state=2">'.T('Translated').'</a></td>'.
     354        '<td>'.T('Show only translated texts').'</td></tr>'.
     355        '<tr><td><a title="'.T('Untranslated texts').'" href="?group='.$GroupId.'&amp;state=1">'.T('Untranslated').'</a></td>'.
     356        '<td>'.T('Not yet translated texts which need to be translated').'</td></tr>'.
     357        '<tr><td><a title="'.T('Unfinished texts').'" href="?group='.$GroupId.'&amp;state=3">'.T('Unfinished').'</a></td>'.
     358        '<td>'.T('Texts marked as unfinished').'</td></tr>';
    353359
    354360      if ($User->Licence(LICENCE_USER))
     
    361367
    362368      $Output .= '<tr><td><form action="?group='.$GroupId.'&amp;entry=" method="post"><div>'.
    363           '<input type="text" name="text" size="8" />'.
    364           '<input type="submit" value="'.T('Search').'" />'.
    365           '</div></form>'.
    366           '</td><td>'.T('Search using text').'</td></tr>';
     369        '<input type="text" name="text" size="8" />'.
     370        '<input type="submit" value="'.T('Search').'" />'.
     371        '</div></form>'.
     372        '</td><td>'.T('Search using text').'</td></tr>';
    367373
    368374      $Output .= '<tr><td><form action="?group='.$GroupId.'&amp;text=" method="post"><div>'.
    369           '<input type="text" name="entry" size="8" />'.
    370           '<input type="submit" value="'.T('Search').'" />'.
    371           '</div></form>'.
    372           '</td><td>'.T('Show by datbase text ID').'</td></tr>';
     375        '<input type="text" name="entry" size="8" />'.
     376        '<input type="submit" value="'.T('Search').'" />'.
     377        '</div></form>'.
     378        '</td><td>'.T('Show by datbase text ID').'</td></tr>';
    373379
    374380      $Output .= '</table>';
     
    396402  function ShowList()
    397403  {
    398     $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
     404    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;   
    399405    $DbResult = $this->Database->query('SELECT COUNT(*) FROM `Group`');
    400406    $DbRow = $DbResult->fetch_row();
     
    448454    {
    449455      $Output = '<h3>Vložení nové překladové skupiny</h3>'.
    450           '<form action="?action=groupaddfinish" method="post">'.
    451           '<table>'.
    452           '<tr><td>Název:</td><td><input type="text" name="Name"/></td></tr>'.
    453           '<tr><td>Název tabulky v databázi:</td><td>Text<input type="text" name="TablePrefix"/></td></tr>'.
    454           '<tr><td colspan="2"><input type="submit" name="add" value="Přidat"/></td></tr>'.
    455           '</table></form>';
     456        '<form action="?action=groupaddfinish" method="post">'.
     457        '<table>'.
     458        '<tr><td>Název:</td><td><input type="text" name="Name"/></td></tr>'.
     459        '<tr><td>Název tabulky v databázi:</td><td>Text<input type="text" name="TablePrefix"/></td></tr>'.
     460        '<tr><td colspan="2"><input type="submit" name="add" value="Přidat"/></td></tr>'.
     461        '</table></form>';
    456462    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    457463    return $Output;
  • trunk/Modules/User/Profile.php

    r893 r900  
    3737
    3838    $Output .= '<h3>'.T('Exports').'</h3>'.
    39         $PageList['Output'];
     39      $PageList['Output'];
    4040
    4141    $TableColumns = array(
    42         array('Name' => 'TimeCreate', 'Title' => T('Creation time')),
    43         array('Name' => 'Title', 'Title' => T('Name')),
    44         //  array('Name' => 'UserCount', 'Title' => 'Vybraných překladatelů'),
    45         //  array('Name' => 'GroupCount', 'Title' => 'Překladových skupin'),
    46         array('Name' => 'OutputType', 'Title' => T('Output type')),
    47         array('Name' => 'ClientVersion', 'Title' => T('Client version')),
    48         array('Name' => 'UsedCount', 'Title' => T('Output inspections')),
    49         array('Name' => '', 'Title' => T('Actions')),
     42      array('Name' => 'TimeCreate', 'Title' => T('Creation time')),
     43      array('Name' => 'Title', 'Title' => T('Name')),
     44      //  array('Name' => 'UserCount', 'Title' => 'Vybraných překladatelů'),
     45      //  array('Name' => 'GroupCount', 'Title' => 'Překladových skupin'),
     46      array('Name' => 'OutputType', 'Title' => T('Output type')),
     47      array('Name' => 'ClientVersion', 'Title' => T('Client version')),
     48      array('Name' => 'UsedCount', 'Title' => T('Output inspections')),
     49      array('Name' => '', 'Title' => T('Actions')),
    5050    );
    5151    $Order = GetOrderTableHeader($TableColumns, 'TimeCreate', 1);
     
    7373    }
    7474    $Output .= '</table>'.
    75         $PageList['Output'];
     75      $PageList['Output'];
    7676
    7777    $Output .= '<div style="text-align: center;"><a href="'.$this->System->Link('/export/').'">'.T('Export page').'</a></div>';
     
    141141  {
    142142    $Output = '';
     143    if (!is_numeric($_GET['user']))
     144    {
     145      $Output .= ShowMessage('Uživatel nenalezen', MESSAGE_CRITICAL);
     146      return $Output;
     147    }
    143148    $User = ModuleUser::Cast($this->System->GetModule('User'))->User;
    144149    $Query = 'SELECT `User`.`Name`, `UserTrace`.`LastLogin`, `UserTrace`.`LastIP`, '.
     
    177182        $Output .= T('Translator is using this rules:').'<br />';
    178183        $Output .= '<ul>';
    179         while ($UserTag = $DbResult->fetch_array()) {
     184        while ($UserTag = $DbResult->fetch_array())
     185        {
    180186          $Output .= ' <li>'.$UserTag['Text'].'</li>';
    181187        }
  • trunk/Modules/User/UserList.php

    r888 r900  
    2626        $Output .= '<h3>'.sprintf(T('Users in team %s'), htmlspecialchars($Team['Name'])).'</h3>';
    2727        $TeamFilter = ' AND (`Team`='.$_GET['team'].')';
    28       } else {
     28      } else
     29      {
    2930        $Output .= ShowMessage(sprintf(T('Team %d not found'), $TeamId), MESSAGE_CRITICAL);
    3031      }
     
    6970    }
    7071    $Output .= '</table>'.
    71         $PageList['Output'];
     72      $PageList['Output'];
    7273
    7374    return $Output;
Note: See TracChangeset for help on using the changeset viewer.