Changeset 880 for trunk/Modules


Ignore:
Timestamp:
Apr 7, 2020, 10:15:48 PM (5 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
Location:
trunk/Modules
Files:
43 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}
  • trunk/Modules/AoWoW/AoWoW.php

    r838 r880  
    2323      'Icon' => '',
    2424    ));
    25     if(array_key_exists('Search', $this->System->ModuleManager->Modules))
     25    if (array_key_exists('Search', $this->System->ModuleManager->Modules))
    2626      $this->System->ModuleManager->Modules['Search']->RegisterSearch('aowow',
    2727      T('AoWoW'), array(), '', $this->System->Link('/aowow/?search='));
  • trunk/Modules/ClientVersion/ClientVersion.php

    r843 r880  
    3131  function Show()
    3232  {
    33     if(array_key_exists('action', $_GET))
     33    if (array_key_exists('action', $_GET))
    3434    {
    35       if($_GET['action'] == 'item') $Output = $this->ShowItem();
     35      if ($_GET['action'] == 'item') $Output = $this->ShowItem();
    3636      else $Output = $this->ShowList();
    3737    } else $Output = $this->ShowList();
    38     return($Output);
     38    return $Output;
    3939  }
    4040
    4141  function ShowItem()
    4242  {
    43     if(array_key_exists('id', $_GET))
     43    if (array_key_exists('id', $_GET))
    4444    {
    4545      $YesNo = array('Ne', 'Ano');
    4646      $DbResult = $this->System->Database->query('SELECT * FROM `ClientVersion` WHERE `Id`='.($_GET['id']*1));
    47       if($DbResult->num_rows > 0)
     47      if ($DbResult->num_rows > 0)
    4848      {
    4949        $Version = $DbResult->fetch_assoc();
     
    6060        '</table>';
    6161        $Output .= '<div><a href="?">'.T('All versions list').'</a></div>';
    62         if($Version['Imported'])
     62        if ($Version['Imported'])
    6363          $Output .= '<div><a href="'.$this->System->Link('/progress/?Version='.
    6464            $Version['Version']).'">'.T('Progress').'</a></div>';
    6565      } else $Output = ShowMessage(T('Item not found'), MESSAGE_CRITICAL);
    6666    } else $Output = ShowMessage(T('Item not found'), MESSAGE_CRITICAL);
    67     return($Output);
     67    return $Output;
    6868  }
    6969
     
    9292
    9393    $DbResult = $this->System->Database->query('SELECT * FROM ClientVersion '.$Order['SQL'].$PageList['SQLLimit']);
    94     while($Version = $DbResult->fetch_assoc())
     94    while ($Version = $DbResult->fetch_assoc())
    9595    {
    9696      $Output .= '<tr><td><a href="?action=item&amp;id='.$Version['Id'].'">'.
     
    101101    $Output .= '</table>'.
    102102      $PageList['Output'];
    103     return($Output);
     103    return $Output;
    104104  }
    105105}
  • trunk/Modules/Dictionary/Dictionary.php

    r861 r880  
    2525      'Icon' => '',
    2626    ), 1);
    27     if(array_key_exists('Search', $this->System->ModuleManager->Modules))
     27    if (array_key_exists('Search', $this->System->ModuleManager->Modules))
    2828      $this->System->ModuleManager->Modules['Search']->RegisterSearch('dictionary',
    2929      T('Dictionary'), array('Text', 'Description'),
     
    6565
    6666    // $buff[] = array($Line['ID'],GetIDbyName($Table),$Line[$Column],$Line['Tran']);
    67     foreach($buff as $Line)
     67    foreach ($buff as $Line)
    6868    {
    6969      if ($mode == 0)
     
    8383    }
    8484    $Output .= '</table>';
    85     return($Output);
     85    return $Output;
    8686  }
    8787
     
    8989  {
    9090    $Output = '';
    91     if($this->System->User->Licence(LICENCE_USER))
     91    if ($this->System->User->Licence(LICENCE_USER))
    9292    {
    9393      $Output .= '<form action="?action=save" method="post">'.
     
    103103        '</form>';
    104104    } else $Output .= ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    105     return($Output);
     105    return $Output;
    106106  }
    107107
    108108  function DictionarySave()
    109109  {
    110     if($this->System->User->Licence(LICENCE_USER))
    111     {
    112       if(array_key_exists('Original', $_POST) and array_key_exists('Translated', $_POST) and array_key_exists('Description', $_POST))
     110    if ($this->System->User->Licence(LICENCE_USER))
     111    {
     112      if (array_key_exists('Original', $_POST) and array_key_exists('Translated', $_POST) and array_key_exists('Description', $_POST))
    113113      {
    114114        // Check if original text exists and determine entry id
    115115        $DbResult = $this->Database->query('SELECT * FROM `Dictionary` WHERE '.
    116116          '`Text` = "'.$_POST['Original'].'" AND `Language`= '.$this->System->Config['OriginalLanguage']);
    117         if($DbResult->num_rows > 0)
     117        if ($DbResult->num_rows > 0)
    118118        {
    119119          $DbRow = $DbResult->fetch_assoc();
     
    130130        $DbResult = $this->Database->query('SELECT `Id` FROM `Dictionary` WHERE '.
    131131          '`Entry` = '.$Entry.' AND `Language`='.$_POST['Language'].' AND `User`='.$this->System->User->Id);
    132         if($DbResult->num_rows > 0)
     132        if ($DbResult->num_rows > 0)
    133133        {
    134134          $DbRow = $DbResult->fetch_assoc();
     
    142142      } else $Output = ShowMessage(T('You have to fill all column of form.'), MESSAGE_CRITICAL);
    143143    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    144     return($Output);
     144    return $Output;
    145145  }
    146146
    147147  function DictionaryRemove()
    148148  {
    149     if($this->System->User->Licence(LICENCE_USER))
     149    if ($this->System->User->Licence(LICENCE_USER))
    150150    {
    151151      $this->Database->query('DELETE FROM `Dictionary` WHERE (`User`='.$this->System->User->Id.') AND (`Id`='.($_GET['id'] * 1).')');
    152152      $Output = ShowMessage(T('Record removed'));
    153153    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    154     return($Output);
     154    return $Output;
    155155  }
    156156
    157157  function DictionaryModify()
    158158  {
    159     if($this->System->User->Licence(LICENCE_USER))
     159    if ($this->System->User->Licence(LICENCE_USER))
    160160    {
    161161      $DbResult = $this->Database->query('SELECT * FROM `Dictionary` WHERE `Id`='.($_GET['id'] * 1));
    162       if($DbResult->num_rows > 0)
     162      if ($DbResult->num_rows > 0)
    163163      {
    164164        $DbRow = $DbResult->fetch_assoc();
     
    180180      } else $Output = ShowMessage(T('Item not found'), MESSAGE_CRITICAL);
    181181    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    182     return($Output);
     182    return $Output;
    183183  }
    184184
     
    189189    $Output = '';
    190190    $GroupId = LoadGroupIdParameter();
    191     if(array_key_exists('mode', $_GET)) $mode = $_GET['mode'];
     191    if (array_key_exists('mode', $_GET)) $mode = $_GET['mode'];
    192192    else $mode = 0; //0 = exact names, 1=all names, 2=nontranslated
    193193    $Table = $TranslationTree[$GroupId]['TablePrefix'];
    194194
    195     if(array_key_exists('ID', $_GET))
     195    if (array_key_exists('ID', $_GET))
    196196    {
    197197      $TextID = $_GET['ID'];
     
    202202      $DbResult = $this->Database->query('SELECT * FROM '.$Table.' WHERE ID = '.$TextID);
    203203      $Line = $DbResult->fetch_assoc();
    204       if(!$Line) $Output .= ShowMessage(T('Translation not found'), MESSAGE_CRITICAL);
     204      if (!$Line) $Output .= ShowMessage(T('Translation not found'), MESSAGE_CRITICAL);
    205205      else
    206206      {
    207207        $Text = '';
    208         foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
     208        foreach ($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    209209          $Text .= ' '.$Line[$TextItem['Column']];
    210210        $Output .= $this->WriteTranslatNames($Text, $mode);
    211211      }
    212212    }
    213     return($Output);
     213    return $Output;
    214214  }
    215215
     
    221221      '<table style="width: 100%; height: 100%;">';
    222222
    223     if(array_key_exists('search', $_GET)) $Search = $_GET['search'];
     223    if (array_key_exists('search', $_GET)) $Search = $_GET['search'];
    224224      else $Search = '';
    225225
     
    227227      <input type="text" value="'.$Search.'" name="search" size="30" />
    228228      <input type="submit" value="'.T('Search').'" />';
    229     if($this->System->User->Licence(LICENCE_USER))
     229    if ($this->System->User->Licence(LICENCE_USER))
    230230      $Output .= ' <a href="?action=insert">'.T('Add word').'</a>';
    231231
     
    233233      '<tr><td>'.T('Language').': ';
    234234    $Lang = '<a href="?language=">'.T('All').'</a>';
    235     if($_SESSION['language'] == '') $Output .= '<strong>'.$Lang.'</strong> ';
     235    if ($_SESSION['language'] == '') $Output .= '<strong>'.$Lang.'</strong> ';
    236236      else $Output .= $Lang;
    237     foreach($LanguageList as $Language)
    238       if($Language['Enabled'] == 1)
     237    foreach ($LanguageList as $Language)
     238      if ($Language['Enabled'] == 1)
    239239      {
    240240        $Lang = ' <a href="?language='.$Language['Id'].'">'.T($Language['Name']).'</a>';
    241         if($Language['Id'] == $_SESSION['language']) $Output .= '<strong>'.$Lang.'</strong> ';
     241        if ($Language['Id'] == $_SESSION['language']) $Output .= '<strong>'.$Lang.'</strong> ';
    242242          else $Output .= $Lang;
    243243      }
     
    245245      '<tr><td>';
    246246
    247     if(!is_numeric($_SESSION['language'])) $LanguageFilter = '';
     247    if (!is_numeric($_SESSION['language'])) $LanguageFilter = '';
    248248      else $LanguageFilter = ' AND (`T1`.`Language` = '.$_SESSION['language'].')';
    249249
    250     if($Search <> '')
     250    if ($Search <> '')
    251251    {
    252252      $Condition = ' AND (LOWER(`T1`.`Text`) LIKE LOWER("%'.$Search.'%")) OR '.
     
    270270    $Output .= $PageList['Output'];
    271271
    272     if(is_numeric($_SESSION['language'])) $LanguageName = $LanguageList[$_SESSION['language']]['Name'];
     272    if (is_numeric($_SESSION['language'])) $LanguageName = $LanguageList[$_SESSION['language']]['Name'];
    273273      else $LanguageName = T('Translation');
    274274    $TableColumns = array(
     
    276276      array('Name' => 'Translated', 'Title' => T($LanguageName)),
    277277    );
    278     if(!is_numeric($_SESSION['language'])) $TableColumns[] = array('Name' => 'LangName', 'Title' => T('Language'));
     278    if (!is_numeric($_SESSION['language'])) $TableColumns[] = array('Name' => 'LangName', 'Title' => T('Language'));
    279279    $TableColumns[] = array('Name' => 'Description', 'Title' => T('Description'));
    280280    $TableColumns[] = array('Name' => 'UserName', 'Title' => T('Translator'));
    281     if($this->System->User->Licence(LICENCE_USER)) $TableColumns[] = array('Name' => '', 'Title' => T('Action'));
     281    if ($this->System->User->Licence(LICENCE_USER)) $TableColumns[] = array('Name' => '', 'Title' => T('Action'));
    282282    $Order = GetOrderTableHeader($TableColumns, 'Original');
    283283    $Output .= '<table class="BaseTable">'.$Order['Output'];
     
    285285    $sql_page = $sql.$Order['SQL'].$PageList['SQLLimit'];
    286286    $DbResult = $this->Database->query($sql_page);
    287     while($Line = $DbResult->fetch_assoc())
     287    while ($Line = $DbResult->fetch_assoc())
    288288    {
    289289      $Output .= '<tr>'.
    290290        '<td>'.htmlspecialchars($Line['Original']).'</td>'.
    291291        '<td><strong>'.htmlspecialchars($Line['Translated']).'</strong></td>';
    292       if(!is_numeric($_SESSION['language'])) $Output .= '<td>'.T($Line['LangName']).'</td>';
     292      if (!is_numeric($_SESSION['language'])) $Output .= '<td>'.T($Line['LangName']).'</td>';
    293293      $Output .= '<td>'.htmlspecialchars($Line['Description']).'</td>'.
    294294        '<td><a href="'.$this->System->Link('/user/?user='.$Line['UserId']).'">'.
    295295        $Line['UserName'].'</a></td>';
    296       if($this->System->User->Licence(LICENCE_USER))
    297       {
    298         if($Line['UserId'] == $this->System->User->Id)
     296      if ($this->System->User->Licence(LICENCE_USER))
     297      {
     298        if ($Line['UserId'] == $this->System->User->Id)
    299299          $Output .= '<td><a href="?action=remove&amp;id='.$Line['Id'].
    300300            '" onclick="return confirmAction(\''.T('Do you really want to delete item?').'\');">'.T('Delete').'</a>'.
     
    308308      '</td></tr>'.
    309309      '</table></form>';
    310     return($Output);
     310    return $Output;
    311311  }
    312312
     
    319319    $LanguageList = GetLanguageList();
    320320
    321     if(!isset($_SESSION['language']))
    322     {
    323       if($this->System->User->Licence(LICENCE_USER))
     321    if (!isset($_SESSION['language']))
     322    {
     323      if ($this->System->User->Licence(LICENCE_USER))
    324324      {
    325325        $_SESSION['language'] = $this->System->User->Language;
    326326      } else $_SESSION['language'] = '';
    327327    }
    328     if(array_key_exists('language', $_GET))
    329     {
    330       if($_GET['language'] == '') $_SESSION['language'] = '';
     328    if (array_key_exists('language', $_GET))
     329    {
     330      if ($_GET['language'] == '') $_SESSION['language'] = '';
    331331        else $_SESSION['language'] = $_GET['language'] * 1;
    332332    }
     
    335335
    336336    $ShowList = true;
    337     if(array_key_exists('action', $_GET))
    338     {
    339       if($_GET['action'] == 'group')
     337    if (array_key_exists('action', $_GET))
     338    {
     339      if ($_GET['action'] == 'group')
    340340      {
    341341        $Output .= $this->DictionaryGroup();
    342342        $ShowList = false;
    343343      }
    344       else if($_GET['action'] == 'insert') $Output .= $this->DictionaryInsert();
    345       else if($_GET['action'] == 'save') $Output .= $this->DictionarySave();
    346       else if($_GET['action'] == 'remove') $Output .= $this->DictionaryRemove();
    347       else if($_GET['action'] == 'modify') $Output .= $this->DictionaryModify();
     344      else if ($_GET['action'] == 'insert') $Output .= $this->DictionaryInsert();
     345      else if ($_GET['action'] == 'save') $Output .= $this->DictionarySave();
     346      else if ($_GET['action'] == 'remove') $Output .= $this->DictionaryRemove();
     347      else if ($_GET['action'] == 'modify') $Output .= $this->DictionaryModify();
    348348      else $Output .= ShowMessage(T('Unknown action'), MESSAGE_CRITICAL);
    349349    }
    350     if($ShowList == true) $Output .= $this->DictionaryShow();
    351     return($Output);
     350    if ($ShowList == true) $Output .= $this->DictionaryShow();
     351    return $Output;
    352352  }
    353353}
  • trunk/Modules/Download/Download.php

    r850 r880  
    7474  '<a href="'.$fileslink.'/DBCtoCSV.exe">DBCtoCSV</a> - '.T('tool for transform DBC files to CSV').'<br />'.
    7575  '<a href="'.$fileslink.'/ClientDBExtractor.exe">ClientDBExtractor.exe</a> - '.T('tool for exporting dbc files from game client').'<br />';
    76   return($Output);
     76  return $Output;
    7777  }
    7878
     
    144144      $PageList['Output'];
    145145
    146     return($Output);
     146    return $Output;
    147147  }
    148148
     
    154154    else $Output .= $this->ShowDownload();
    155155
    156     return($Output);
     156    return $Output;
    157157  }
    158158}
  • trunk/Modules/Error/Error.php

    r860 r880  
    2323  function DoStart()
    2424  {
    25     if(isset($this->System->Config['Web']['ShowPHPError']))
     25    if (isset($this->System->Config['Web']['ShowPHPError']))
    2626      $this->ErrorHandler->ShowError = $this->System->Config['Web']['ShowPHPError'];
    2727      else $this->ErrorHandler->ShowError = true;
     
    3636  function DoError($Error)
    3737  {
    38     foreach($this->OnError as $OnError)
     38    foreach ($this->OnError as $OnError)
    3939      call_user_func($OnError, $Error);
    4040  }
  • trunk/Modules/Export/CreateAddon.php

    r859 r880  
    1717    $string = str_replace('$r', '"..'.$strlower.'(UnitRace("player")).."', $string);
    1818    $Gender = '$G';
    19     while(strpos($string, $Gender) !== false)
     19    while (strpos($string, $Gender) !== false)
    2020    {
    2121      $Before = substr($string, 0, strpos($string, $Gender));
     
    3030    }
    3131    $Gender = '$g';
    32     while(strpos($string, $Gender) !== false)
     32    while (strpos($string, $Gender) !== false)
    3333    {
    3434      $Before = substr($string, 0, strpos($string, $Gender));
     
    4646    $string = str_replace("\r", '', $string);
    4747    $string = str_replace("\n", '\r\n', $string);
    48     return($string);
     48    return $string;
    4949  }
    5050
     
    6464    $string = str_replace('\\n', ' ', $string);
    6565    $string = str_replace(' ', '', $string);
    66 //    while(strpos($string, '  '))
     66//    while (strpos($string, '  '))
    6767//      $string = str_replace('  ', ' ', $string);
    68     return($string);
     68    return $string;
    6969  }
    7070
     
    7575    $string = str_replace('$b', '\r\n', $string);
    7676    $string = $this->ReplaceVarInText($string,'');
    77     return($string);
     77    return $string;
    7878  }
    7979
     
    8181  {
    8282    //echo (strpos($string,'<html>'));
    83     if (strpos($string,'<html>') > -1) return(false);
    84       else return(true);
     83    if (strpos($string,'<html>') > -1) return false;
     84      else return true;
    8585  }
    8686
     
    9898    $string = str_replace('\\\\124', '\\124',$string);
    9999
    100     return ($string);
     100    return $string;
    101101  }
    102102
     
    113113    $CreatedFileListCount = array();
    114114
    115     if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/', 0777, true);
     115    if (!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/', 0777, true);
    116116
    117117    $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `Group`.`TablePrefix` != ""');
    118     while($Group = $DbResult->fetch_assoc())
     118    while ($Group = $DbResult->fetch_assoc())
    119119    {
    120120    //získání čísla verze pro export
     
    126126      else $ExportVersion = '';
    127127
    128       foreach($TranslationTree[$Group['Id']]['Items'] as $Column)
    129       if($Column['AddonFileName'] != '')
     128      foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)
     129      if ($Column['AddonFileName'] != '')
    130130      {
    131131        $this->AddProgress(1);
    132         if(!isset($CreatedFileListCount[$Column['AddonFileName']]))
     132        if (!isset($CreatedFileListCount[$Column['AddonFileName']]))
    133133        $CreatedFileListCount[$Column['AddonFileName']] = 0;
    134134        $CreatedFileListCount[$Column['AddonFileName']]++;
     
    149149        $ID = $this->Database->query('SELECT `BuildNumber` FROM `ClientVersion` WHERE '.
    150150        ' `Imported` = 1 AND `BuildNumber` < '.$BuildNumber.' ORDER BY  `BuildNumber` DESC LIMIT 1');
    151         if($ID->num_rows > 0) {
     151        if ($ID->num_rows > 0) {
    152152          $ExportVersionOld = $ID->fetch_assoc();
    153153          $ExportVersionOld = $ExportVersionOld['BuildNumber'];
    154154
    155155          $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersionOld));
    156           while($Line = $DbResult2->fetch_assoc())
     156          while ($Line = $DbResult2->fetch_assoc())
    157157          {
    158158            $en = trim($this->ReplaceEnText($Line['En'.$Column['Column']]));
    159159            $cz = $this->ReplaceCzText($Line[$Column['Column']]);
    160             if(($en <> '') and ($cz <> '') and ($this->NotCancel($en)))
     160            if (($en <> '') and ($cz <> '') and ($this->NotCancel($en)))
    161161            {
    162162               $TableTexts[$en] = $cz;
     
    167167
    168168        $DbResult2 = $this->Database->query($this->BuildQuery($Group,$ExportVersion));
    169         while($Line = $DbResult2->fetch_assoc())
     169        while ($Line = $DbResult2->fetch_assoc())
    170170        {
    171171          $en = trim($this->ReplaceEnText($Line['En'.$Column['Column']]));
    172172          $cz = $this->ReplaceCzText($Line[$Column['Column']]);
    173           if(($en <> '') and ($cz <> '') and ($this->NotCancel($en)))
     173          if (($en <> '') and ($cz <> '') and ($this->NotCancel($en)))
    174174          {
    175175             $TableTexts[$en] = $cz;
     
    177177        }
    178178
    179         foreach($TableTexts as $key => $value) {
     179        foreach ($TableTexts as $key => $value) {
    180180            $Buffer .= "\n".'["'.$key.'"]="'.$value.'",';
    181181            $i++;
     
    194194    $CountFiles = 'CountFiles.lua';
    195195    $Buffer = '';
    196     foreach($CreatedFileList as $CreatedFile)
     196    foreach ($CreatedFileList as $CreatedFile)
    197197      $Buffer .= 'CZWOW_'.str_replace('_','_count=',$CreatedFile).';'."\n";
    198     foreach($TranslationTree as $Group)
    199       foreach($TranslationTree[$Group['Id']]['Items'] as $Column)
     198    foreach ($TranslationTree as $Group)
     199      foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)
    200200      if (($Column['AddonFileName'] != '') and (!in_array($Column['AddonFileName'].'_1', $CreatedFileList)))
    201201      {
     
    209209    $Buffer = '<Ui xmlns="http://www.blizzard.com/wow/ui/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.blizzard.com/wow/ui/.\FrameXML\UI.xsd">'."\n";
    210210    $Buffer .= '<script file="'.$CountFiles.'"/>'."\n";
    211     foreach($CreatedFileList as $CreatedFile)
     211    foreach ($CreatedFileList as $CreatedFile)
    212212      $Buffer .= '<script file="'.$CreatedFile.'.lua"/>'."\n";
    213213    $Buffer .= '</Ui>';
    214214    file_put_contents($this->TempDir.'CzWoW/Translates.xml', $Buffer);
    215     return($Output);
     215    return $Output;
    216216  }
    217217
     
    235235
    236236    $DbResult = $this->Database->query($this->BuildQuery($Group,$CanGenerated));
    237     while($Line = $DbResult->fetch_array())
     237    while ($Line = $DbResult->fetch_array())
    238238    {
    239239      $Original = $this->my_trim($Line['En'.$Column['Column']]);
    240240      $Translated = $this->my_trim($Line[$Column['Column']]);
    241       if($this->ClientVersion['Version'] == '2.4.3')
     241      if ($this->ClientVersion['Version'] == '2.4.3')
    242242      {
    243243        $Original = str_replace("|Hchannel:%d|h[%s]|h", '[%s]', $Original);
     
    247247    }
    248248
    249     if(!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/',0777, true);
     249    if (!file_exists($this->TempDir.'CzWoW/')) mkdir($this->TempDir.'CzWoW/',0777, true);
    250250    file_put_contents($this->TempDir.'CzWoW/LocalizationStrings.lua', $Buffer);
    251251  }
     
    253253  function MakeAddon()
    254254  {
    255     if(!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true);
     255    if (!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true);
    256256    $Output = $this->MakeLanguageFiles();
    257257    $Output .= $this->MakeClientStrings();
    258258    // $Output .= MakeMainScript($Setting);
    259     return($Output);
     259    return $Output;
    260260  }
    261261
     
    283283    ';
    284284    $DbResult = $System->Database->query('SELECT * FROM `CzWoWPackageVersion` ORDER BY `Date` DESC');
    285     while($Line = $DbResult->fetch_assoc())
     285    while ($Line = $DbResult->fetch_assoc())
    286286    {
    287287      $Buffer .='
  • trunk/Modules/Export/Export.php

    r879 r880  
    1717  {
    1818    $this->TempDir = dirname(__FILE__).'/../../'.$this->System->Config['Web']['TempFolder'].'Export/'.$this->Id.'/';
    19     if(!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true);
     19    if (!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true);
    2020    $this->TempDirRelative = $this->System->Config['Web']['TempFolder'].'Export/'.$this->Id.'/';
    2121    $this->SourceDir = dirname(__FILE__).'/../../'.$this->System->Config['Web']['SourceFolder'];
    2222    $this->SourceDirRelative = $this->System->Config['Web']['SourceFolder'];
    23     if(!file_exists($this->SourceDir)) mkdir($this->SourceDir, 0777, true);
     23    if (!file_exists($this->SourceDir)) mkdir($this->SourceDir, 0777, true);
    2424  }
    2525
     
    2929    if ($Export['AllUsers']) {
    3030      $DbResult2 = $this->System->Database->query('SELECT ID FROM `User` WHERE `ID` NOT IN(SELECT `User` FROM `ExportUser` WHERE `Export`='.$this->Id.')');
    31       while($UserLine = $DbResult2->fetch_assoc())
     31      while ($UserLine = $DbResult2->fetch_assoc())
    3232      {
    3333            $Condition = ' WHERE `Export`='.$this->Id.' AND `User`='.$UserLine['ID'];
    3434            $DbResult = $this->System->Database->query('SELECT * FROM `ExportUser` '.$Condition); //,MAX(`Sequence`) as MaxSequence
    35             if($DbResult->num_rows > 0)
     35            if ($DbResult->num_rows > 0)
    3636            {
    3737            //  $this->System->Database->query('UPDATE `ExportUser` SET `Sequence`='.$Value.$Condition);
     
    5050  {
    5151    $DbResult = $this->Database->query('SELECT * FROM `Export` WHERE `Id`='.$this->Id);
    52     if($DbResult->num_rows == 0) throw new Exception('Export '.$this->Id.' neexistuje');
     52    if ($DbResult->num_rows == 0) throw new Exception('Export '.$this->Id.' neexistuje');
    5353    $this->Export = $DbResult->fetch_assoc();
    5454
     
    5858      'LEFT JOIN `User` ON `User`.`ID`=`ExportUser`.`User` '.
    5959      'WHERE `ExportUser`.`Export`='.$this->Id.' ORDER BY `ExportUser`.`Sequence`');
    60     while($UserLine = $DbResult->fetch_assoc())
     60    while ($UserLine = $DbResult->fetch_assoc())
    6161    {
    6262      $this->UserNames .= ', '.$UserLine['Name'];
     
    6464    $this->UserNames = substr($this->UserNames, 2);
    6565
    66     if($this->Export['ClientVersion'] != '')
     66    if ($this->Export['ClientVersion'] != '')
    6767    {
    6868      $DbResult = $this->Database->query('SELECT * FROM `ClientVersion` WHERE `Id`='.$this->Export['ClientVersion']);
     
    8282
    8383    $DbResultItem = $this->System->Database->query('SELECT * FROM `ExportGroupItem` WHERE `Export`='.$this->Id);
    84     while($GroupItem = $DbResultItem->fetch_assoc())
     84    while ($GroupItem = $DbResultItem->fetch_assoc())
    8585    {
    8686      $GroupItems[$GroupItem['GroupItem']] = 1;
     
    8888    // Build selected columns
    8989    $Columns = '';
    90     foreach($TranslationTree[$Group['Id']]['Items'] as $Column) {
     90    foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) {
    9191      if (!isset($GroupItems[$Column['Id']])) $Columns .= ' `T`.`'.$Column['Column'].'` AS `'.$Column['Column'].'`, ';
    9292    }
     
    104104    // Build columns for english texts
    105105    $OriginalColumns = '';
    106     foreach($TranslationTree[$Group['Id']]['Items'] as $Column) {
     106    foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) {
    107107      $OriginalColumns .= ' `T3`.`'.$Column['Column'].'` AS `En'.$Column['Column'].'`, ';
    108108      if (isset($GroupItems[$Column['Id']]))
     
    117117    '(`T3`.`VersionStart` = `T4`.`VersionStart`) AND (`T3`.`VersionEnd` = `T4`.`VersionEnd`)';
    118118
    119     return($Query);
     119    return $Query;
    120120  }
    121121
     
    129129    if (file_exists($file))
    130130      $date = date('Y-m-d H:i',(filemtime($file)));
    131     else return(true);
     131    else return true;
    132132  // echo $file;
    133133
     
    135135      'JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id);
    136136    $result = false;
    137     while($Group = $DbResult->fetch_assoc())
     137    while ($Group = $DbResult->fetch_assoc())
    138138    {
    139139      $Query = 'SELECT * FROM `'.$Group['TablePrefix'].'` AS `T`'.
     
    149149        }
    150150    }
    151     return($result);
     151    return $result;
    152152  }
    153153
     
    172172    $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` '.
    173173      'JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id);
    174     while($Group = $DbResult->fetch_assoc())
     174    while ($Group = $DbResult->fetch_assoc())
    175175    {
    176176      $Buffer .= $Group['TablePrefix'].', ';
     
    180180    $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` '.
    181181      'JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id);
    182     while($Group = $DbResult->fetch_assoc())
    183     {
    184       if($Group['MangosTable'] != '')
     182    while ($Group = $DbResult->fetch_assoc())
     183    {
     184      if ($Group['MangosTable'] != '')
    185185      {
    186186        $Buffer .= "\n\n-- ".$Group['Name']."\n\n";
    187187        $DbResult2 = $this->Database->query($this->BuildQuery($Group));
    188         if($DbResult2->num_rows > 0)
    189         while($Line = $DbResult2->fetch_array())
     188        if ($DbResult2->num_rows > 0)
     189        while ($Line = $DbResult2->fetch_array())
    190190        {
    191191          $Values = '';
    192           foreach($TranslationTree[$Group['Id']]['Items'] as $GroupItem)
    193           if($GroupItem['Column'] != $Group['PrimaryKeyItem']) // Do not update primary key
     192          foreach ($TranslationTree[$Group['Id']]['Items'] as $GroupItem)
     193          if ($GroupItem['Column'] != $Group['PrimaryKeyItem']) // Do not update primary key
    194194          {
    195             if($GroupItem['MangosColumn'] == '') $GroupItem['MangosColumn'] = $GroupItem['Column'];
     195            if ($GroupItem['MangosColumn'] == '') $GroupItem['MangosColumn'] = $GroupItem['Column'];
    196196            $Values .= ', `'.$GroupItem['MangosColumn'].'`="'.addslashes($Line[$GroupItem['Column']]).'"';
    197197          }
     
    200200          // Get multicolumn index
    201201          $ColumnItems = explode(',', $Group['MangosTableIndex']);
    202           if(count($ColumnItems) > 1)
     202          if (count($ColumnItems) > 1)
    203203          {
    204204            $Where = 'CONCAT(';
    205             foreach($ColumnItems as $ColumnItem)
     205            foreach ($ColumnItems as $ColumnItem)
    206206              $Where .= '`'.$ColumnItem.'`, "_", ';
    207207            $Where = substr($Where, 0, -7).')';
     
    216216      }
    217217    }
    218     if($this->Export['WithDiacritic'] != 1) $Buffer = utf2ascii($Buffer);
    219     return($Buffer);
     218    if ($this->Export['WithDiacritic'] != 1) $Buffer = utf2ascii($Buffer);
     219    return $Buffer;
    220220  }
    221221
     
    243243      'aowow_skill' => 'skillID',
    244244    );
    245     foreach($AoWoWTables as $AoWoWTable => $IndexColum)
     245    foreach ($AoWoWTables as $AoWoWTable => $IndexColum)
    246246    {
    247247      $Buffer .= '--'.$AoWoWTable.', ';
     
    249249      $Query = 'SELECT `name`,`'.$IndexColum.'` FROM `'.$AoWoWTable.'`';
    250250      $DbResult = $Database2->query($Query);
    251       while($Line = $DbResult->fetch_assoc())
     251      while ($Line = $DbResult->fetch_assoc())
    252252      {
    253253        $Ori_text = $Line['name'];
     
    259259        $Tran = $DbResult2->fetch_assoc();
    260260        //echo ($Line['name'].'='.$Tran['tran']);
    261         if($Tran['Tran'] == '')
     261        if ($Tran['Tran'] == '')
    262262        {
    263263          $DbResult2 = $Database2->query('SELECT `OptionText` AS `En`,
     
    270270        }
    271271
    272         if($Tran['Tran'] <> '')
     272        if ($Tran['Tran'] <> '')
    273273          $Buffer .= 'UPDATE `'.$AoWoWTable.'` SET `name` = "'.addslashes($Tran['Tran']).'" WHERE '.$IndexColum.' = '.$Line[$IndexColum].' ;'."\n";
    274274      }
     
    276276    }
    277277    */
    278     if($this->Export['WithDiacritic'] != 1) $Buffer = utf2ascii($Buffer);
    279     return($Buffer);
     278    if ($this->Export['WithDiacritic'] != 1) $Buffer = utf2ascii($Buffer);
     279    return $Buffer;
    280280  }
    281281
     
    299299          if (false === strpos($String2,$varible)) {
    300300              //  echo $varible;
    301             return(false);
     301            return false;
    302302          }
    303303      }
    304304    }
    305     return (true);
     305    return true;
    306306  }
    307307
     
    324324      'WHERE `ExportGroup`.`Export`='.$this->Id.' AND `Group`.`DBCFileName` != ""');
    325325    $Output = 'Počet generovaných skupin: '.$DbResult->num_rows."\n";
    326     while($Group = $DbResult->fetch_assoc())
     326    while ($Group = $DbResult->fetch_assoc())
    327327    {
    328328      $this->AddProgress(2);
    329329      $Output .= $Group['Name'].', ';
    330       if(file_exists($this->SourceDir.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc'))
     330      if (file_exists($this->SourceDir.$this->ClientVersion['Version'].'/dbc/'.$Group['DBCFileName'].'.dbc'))
    331331      {
    332332        // Load string column index list
     
    335335        $ColumnIndexes = array();
    336336        $ColumnFormat = array();
    337         while($DbRow = $DbResult2->fetch_assoc())
     337        while ($DbRow = $DbResult2->fetch_assoc())
    338338        {
    339339          $ColumnFormat[$DbRow['ColumnIndex']] = FORMAT_STRING;
     
    344344        $LookupTable = array();
    345345        $DbResult2 = $this->Database->query($this->BuildQuery($Group));
    346         while($DbRow = $DbResult2->fetch_assoc()) {
     346        while ($DbRow = $DbResult2->fetch_assoc()) {
    347347          //Export only if translate have same varible %
    348348          $CanExport = true;
    349           foreach($TranslationTree[$Group['Id']]['Items'] as $Column)  {
     349          foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)  {
    350350            $DbRow[$Column['Column']] = str_replace ( '$ ','$',$DbRow[$Column['Column']]);
    351351            if (!$this->HaveVarible($DbRow['En'.$Column['Column']],$DbRow[$Column['Column']])) {
     
    369369
    370370        // Create new DBC file
    371         if(!file_exists($this->TempDir.'dbc/')) mkdir ($this->TempDir.'dbc/', 0777, true);
     371        if (!file_exists($this->TempDir.'dbc/')) mkdir ($this->TempDir.'dbc/', 0777, true);
    372372        $NewDBCFile = new DBCFile();
    373373        $NewDBCFile->CreateFile($this->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc', $ColumnFormat);
     
    381381        $RowCount = $SourceDBCFile->GetRecordCount();
    382382        $FieldCount = $SourceDBCFile->GetFieldCount();
    383         for($Row = 0; $Row < $RowCount; $Row++)
     383        for ($Row = 0; $Row < $RowCount; $Row++)
    384384        {
    385385          $Line = $SourceDBCFile->GetLine($Row);
     
    388388          $PrimaryKeyItem = '';
    389389          $ColumnItems = explode(',', $Group['DBCIndex']);
    390           if(count($ColumnItems) > 1)
     390          if (count($ColumnItems) > 1)
    391391          {
    392             foreach($ColumnItems as $ColumnItem)
     392            foreach ($ColumnItems as $ColumnItem)
    393393              $PrimaryKeyItem .= $Line[$ColumnItem].'_';
    394394            $PrimaryKeyItem = substr($PrimaryKeyItem, 0, -1);
    395395          } else $PrimaryKeyItem = $Line[$Group['DBCIndex']];
    396396
    397           if(array_key_exists($PrimaryKeyItem, $LookupTable))
     397          if (array_key_exists($PrimaryKeyItem, $LookupTable))
    398398          {
    399399            // Replace text columns
    400400            $LookupTableItem = $LookupTable[$PrimaryKeyItem];
    401             foreach($TranslationTree[$Group['Id']]['Items'] as $GroupItem)
     401            foreach ($TranslationTree[$Group['Id']]['Items'] as $GroupItem)
    402402            {
    403               if(array_key_exists($GroupItem['Id'], $ColumnIndexes))
     403              if (array_key_exists($GroupItem['Id'], $ColumnIndexes))
    404404                $Line[$ColumnIndexes[$GroupItem['Id']]] = $LookupTableItem[$GroupItem['Column']];
    405405            }
     
    409409          // Show completion progress
    410410          $Progress = round($Row / $RowCount * 100);
    411           if($Progress != $OldProgress)
     411          if ($Progress != $OldProgress)
    412412          {
    413413            if (($Group['Id'] == 13) and ($Progress <> 100)) $this->AddProgress(0.01);
     
    422422    }
    423423    $Output .= 'Hotovo <br />';
    424     return($Output);
     424    return $Output;
    425425  }
    426426
     
    432432
    433433    $Output = '';
    434     if(!file_exists($this->TempDir.'lua/')) mkdir($this->TempDir.'lua/', 0777, true);
     434    if (!file_exists($this->TempDir.'lua/')) mkdir($this->TempDir.'lua/', 0777, true);
    435435    $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id.' AND `Group`.`LuaFileName` != ""');
    436     while($Group = $DbResult->fetch_assoc())
     436    while ($Group = $DbResult->fetch_assoc())
    437437    {
    438438      $this->AddProgress(1);
     
    448448      $LookupTable = array();
    449449      $DbResult2 = $this->Database->query($this->BuildQuery($Group));
    450       while($DbRow = $DbResult2->fetch_assoc()) {
     450      while ($DbRow = $DbResult2->fetch_assoc()) {
    451451          $CanExport = true;
    452           foreach($TranslationTree[$Group['Id']]['Items'] as $Column)  {
     452          foreach ($TranslationTree[$Group['Id']]['Items'] as $Column)  {
    453453          //  if (strpos($DbRow[$Column['Column']],'\\'))
    454454           //   $CanExport = false;
     
    502502      }
    503503
    504       while(!$File->EOF())
     504      while (!$File->EOF())
    505505      {
    506506        $Line = $File->ReadLine();
    507         if(strpos($Line, '=') !== false)
     507        if (strpos($Line, '=') !== false)
    508508        {
    509509          $LineParts = explode('=', $Line, 2);
     
    511511          $Line = trim($LineParts[1]);
    512512
    513           if($Line[0] == '"')
     513          if ($Line[0] == '"')
    514514          {
    515515            // Quoted string value
     
    532532          $Value['Comment'] = addslashes(stripslashes(substr($Line, 3))); // Skip " --"
    533533
    534           if(array_key_exists($Value['ShortCut'], $LookupTable))
     534          if (array_key_exists($Value['ShortCut'], $LookupTable))
    535535          {
    536536            $DbRow = $LookupTable[$Value['ShortCut']];
     
    548548          }
    549549          $NewLine = $Value['ShortCut'].' = "'.$Value['Text'].'";';
    550           //if($Value['Comment'] != '') $NewLine .= ' -- '.$Value['Comment'];
     550          //if ($Value['Comment'] != '') $NewLine .= ' -- '.$Value['Comment'];
    551551          $NewLine .= "\r\n";
    552552          $File2->WriteLine($NewLine);
     
    555555      $Output .= 'Hotovo <br/>';
    556556    }
    557     return($Output);
     557    return $Output;
    558558  }
    559559
     
    656656    "    <author>".$this->System->User->Name."</author>\n".
    657657    "    <contributors>\n";
    658     foreach(explode(',', $this->UserNames) as $UserName)
     658    foreach (explode(',', $this->UserNames) as $UserName)
    659659      $Buffer .= "      <user>".$UserName."</user>\n";
    660660    $Buffer .=
     
    665665    $DbResult = $this->Database->query('SELECT `Group`.* FROM `ExportGroup` '.
    666666      'JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$this->Id);
    667     while($Group = $DbResult->fetch_assoc())
    668     {
    669       if($Group['MangosTable'] == '')
     667    while ($Group = $DbResult->fetch_assoc())
     668    {
     669      if ($Group['MangosTable'] == '')
    670670      {
    671671        $Group['MangosTable'] = $Group['TablePrefix'];
     
    674674      $Buffer .= '    <group id="'.$Group['Id'].'" name="'.$Group['TablePrefix'].'">'."\n";
    675675      $DbResult2 = $this->Database->query($this->BuildQuery($Group));
    676       while($Line = $DbResult2->fetch_assoc())
     676      while ($Line = $DbResult2->fetch_assoc())
    677677      {
    678678        $Buffer .= '      <item id="'.$Line['Entry'].'" user="'.$Line['UserName'].'">'."\n";
    679679        $Values = '';
    680         foreach($TranslationTree[$Group['Id']]['Items'] as $GroupItem)
     680        foreach ($TranslationTree[$Group['Id']]['Items'] as $GroupItem)
    681681        {
    682           if($GroupItem['MangosColumn'] == '') $GroupItem['MangosColumn'] = $GroupItem['Column'];
    683           if($Line[$GroupItem['Column']] != '')
     682          if ($GroupItem['MangosColumn'] == '') $GroupItem['MangosColumn'] = $GroupItem['Column'];
     683          if ($Line[$GroupItem['Column']] != '')
    684684          $Buffer .= '        <text index="'.$GroupItem['Id'].'" name="'.
    685685            $GroupItem['Column'].'">'.addslashes($Line[$GroupItem['Column']]).'</text>'."\n";
     
    689689      $Buffer .= "    </group>\n";
    690690    }
    691     if($this->Export['WithDiacritic'] != 1) $Buffer = utf2ascii($Buffer);
     691    if ($this->Export['WithDiacritic'] != 1) $Buffer = utf2ascii($Buffer);
    692692    $Buffer .= "  </translation>\n".
    693693  "</document>";
    694     return($Buffer);
     694    return $Buffer;
    695695  }
    696696}
     
    732732      '((`Export`.`OutputType` = 9) OR (`Export`.`OutputType` = 10)) AND '.
    733733      '(`TimeFinish` IS NULL) OR (`Export` ='.$TaskId.') ORDER BY `TimeQueued`'); // `Export`='.$Export->Id
    734     while($Task = $DbResult->fetch_assoc())
     734    while ($Task = $DbResult->fetch_assoc())
    735735    {
    736736      $Export = '<a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$Task['Export']).'">'.$Task['Export'].'</a>';
     
    744744      // Show estimated time to complete
    745745      $PrefixMultiplier = new PrefixMultiplier();
    746       if($Task['Progress'] > 0) {
     746      if ($Task['Progress'] > 0) {
    747747        $ElapsedTime = time() - MysqlDateTimeToTime($Task['TimeStart']);
    748748        $Output .= T('Elapsed time').': <strong>'.$PrefixMultiplier->Add($ElapsedTime, '', 4, 'Time').'</strong> / ';
     
    752752      $Output .= '</div>';
    753753
    754       if($Task['Progress'] > 99)
     754      if ($Task['Progress'] > 99)
    755755        $Output .= '<script type="text/javascript" language="JavaScript" charset="utf-8">'.
    756756        'setTimeout("parent.location.href=\''.$this->System->Link('/export/?Action=View&Tab=7&ExportId='.$TaskId).'\'", 500)'.
    757757        '</script>';
    758758    }
    759     return($Output);
     759    return $Output;
    760760  }
    761761}
  • trunk/Modules/Export/ExportOutput.php

    r867 r880  
    1010{
    1111  $FileList = scandir($Path);
    12   foreach($FileList as $FileName)
    13   {
    14     if(file_exists($Path.$FileName) and ($FileName != '.') and ($FileName != '..'))
     12  foreach ($FileList as $FileName)
     13  {
     14    if (file_exists($Path.$FileName) and ($FileName != '.') and ($FileName != '..'))
    1515    {
    16       if(is_dir($Path.$FileName)) CreateZipFromDir($Zip, $Path.$FileName.'/', $ZipPath.$FileName.'/');
     16      if (is_dir($Path.$FileName)) CreateZipFromDir($Zip, $Path.$FileName.'/', $ZipPath.$FileName.'/');
    1717        else $Zip->addFile(file_get_contents($Path.$FileName), $ZipPath.$FileName);
    1818    }
     
    2828  $Export->Id = $ExportId;
    2929  $Export->Init();
    30   if(function_exists('gzcompress'))
     30  if (function_exists('gzcompress'))
    3131  {
    3232    $SaveFilename = $Export->TempDir.'CzAoWoW_SQL.zip';
     
    4545    '<a href="'.$System->Link('/'.$Export->TempDirRelative.'CzAoWoW_SQL.zip').'">'.$SQLFilename.'</a><br />'.
    4646    'Pokud se vám zdá, že filtr na export nefunguje, vymažte si vyrovnávací paměť prohlížeče a zkuste stáhnout soubor znovu.';
    47   return($Output);
     47  return $Output;
    4848}
    4949
     
    5858     htmlspecialchars($Export->ExportToAoWoWSQL()).
    5959    '</pre>';
    60   return($Output );
     60  return $Output ;
    6161}
    6262
     
    6969  $Export->Id = $ExportId;
    7070  $Export->Init();
    71   if(function_exists('gzcompress'))
     71  if (function_exists('gzcompress'))
    7272  {
    7373    $SaveFilename = $Export->TempDir.'CzWoW_SQL.zip';
     
    8686    '<a href="'.$System->Link('/'.$Export->TempDirRelative.'CzWoW_SQL.zip').'">'.$SQLFilename.'</a><br />'.
    8787    'Pokud se vám zdá, že filtr na export nefunguje, vymažte si vyrovnávací paměť prohlížeče a zkuste stáhnout soubor znovu.';
    88   return($Output);
     88  return $Output;
    8989}
    9090
     
    9999    htmlspecialchars($Export->ExportToMangosSQL()).
    100100    '</pre>';
    101   return($Output);
     101  return $Output;
    102102}
    103103
     
    106106  global $System;
    107107
    108   if(function_exists('gzcompress'))
     108  if (function_exists('gzcompress'))
    109109  {
    110110    $Addon = new ExportAddon($System);
     
    135135    'Pokud se vám zdá, že filtr na export nefunguje, vymažte si vyrovnávací paměť prohlížeče a zkuste stáhnout soubor znovu.';
    136136  $Output .= '<br /><strong>Použití ve hře</strong><br />Menu addonu ve hře vyvoláte povelem /czwow.';
    137   return($Output);
     137  return $Output;
    138138}
    139139
     
    146146  $Export->Id = $ExportId;
    147147  $Export->Init();
    148   if(function_exists('gzcompress'))
     148  if (function_exists('gzcompress'))
    149149  {
    150150    $SaveFilename = $Export->TempDir.'CzWoW_XML.zip';
     
    163163    '<a href="'.$System->Link('/'.$Export->TempDirRelative.'CzWoW_XML.zip').'">CzWoW_SQL.zip</a><br />'.
    164164    'Pokud se vám zdá, že filtr na export nefunguje, vymažte si vyrovnávací paměť prohlížeče a zkuste stáhnout soubor znovu.';
    165   return($Output);
     165  return $Output;
    166166}
    167167
     
    176176    htmlspecialchars($Export->ExportToXML()).
    177177    '</pre>';
    178   return($Output);
     178  return $Output;
    179179}
    180180
     
    190190  $DbResult = $System->Database->query('SELECT `Id` FROM `ExportTask` WHERE (`Export` = '.$ExportId.
    191191      ') AND ((`TimeFinish` < `TimeStart`) OR (`TimeFinish` IS NULL))');
    192   if($DbResult->num_rows == 0)
    193   {
    194     if(array_key_exists('Regenerate', $_POST))
     192  if ($DbResult->num_rows == 0)
     193  {
     194    if (array_key_exists('Regenerate', $_POST))
    195195    {
    196196      $System->Database->query('UPDATE `ExportTask` SET `TimeQueued` = NOW(), `Progress`=0 , `TimeStart` = NULL, `TimeFinish` = NULL WHERE `Export` = '.$ExportId);
     
    211211
    212212  $DbResult = $System->Database->query('SELECT * FROM `ExportTask` WHERE `Export` = '.$ExportId);
    213   if($DbResult->num_rows == 0)
     213  if ($DbResult->num_rows == 0)
    214214  {
    215215    $System->Database->query('INSERT INTO `ExportTask` (`Export` ,`TimeQueued` ) VALUES ('.$ExportId.', NOW())');
     
    220220  $DbResult = $System->Database->query('SELECT `TimeFinish` FROM `ExportTask` WHERE `Export` = '.$ExportId);
    221221  $ExportTask = $DbResult->fetch_assoc();
    222   if($ExportTask['TimeFinish'] <> '')
     222  if ($ExportTask['TimeFinish'] <> '')
    223223  {
    224224    $Output .= '<strong>Souhrný balík: <a href="'.$System->Link('/'.$Export->TempDirRelative.'CzWoW_DBC.zip').'">CzWoW_DBC.zip</a></strong><br/>';
    225225    $DbResult = $System->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$Export->Id.' AND `Group`.`DBCFileName` != ""');
    226     while($Group = $DbResult->fetch_assoc())
     226    while ($Group = $DbResult->fetch_assoc())
    227227    {
    228       if(file_exists($Export->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc'))
     228      if (file_exists($Export->TempDir.'dbc/'.$Group['DBCFileName'].'.dbc'))
    229229        $Output .= '<a href="'.$System->Link('/'.$Export->TempDirRelative.'dbc/'.$Group['DBCFileName'].'.dbc').'">'.$Group['DBCFileName'].'.dbc</a><br/>';
    230230    }
     
    233233
    234234  }
    235   return($Output);
     235  return $Output;
    236236}
    237237
     
    261261    'WHERE ((`Export`.`OutputType` = 9) OR (`Export`.`OutputType` = 10)) AND '.
    262262    '(`TimeFinish` IS NULL) AND (`TimeQueued` < (NOW() - '.$Timeout.'))');
    263   if($DbResult->num_rows > 0)
     263  if ($DbResult->num_rows > 0)
    264264  {
    265265    $System->ModuleManager->Modules['Log']->WriteLog('ProcesTask nepracuje přes 2 hodiny, pravděpodobně nepracuje!', LOG_TYPE_ERROR);
    266266  }
    267   return ($Output);
     267  return $Output;
    268268}
    269269
     
    281281  $DbResult = $System->Database->query('SELECT `Id` FROM `ExportTask` WHERE (`Export` = '.$ExportId.
    282282    ') AND ((`TimeFinish` < `TimeStart`) OR (`TimeFinish` IS NULL))');
    283   if($DbResult->num_rows == 0)
    284   {
    285     if(array_key_exists('Regenerate', $_POST))
     283  if ($DbResult->num_rows == 0)
     284  {
     285    if (array_key_exists('Regenerate', $_POST))
    286286    {
    287287      $System->Database->query('UPDATE `ExportTask` SET `TimeQueued` = NOW(), `Progress`=0, `TimeStart` = NULL, `TimeFinish` = NULL WHERE `Export` = '.$ExportId);
     
    298298  // Start task for the first time if export task was not yet started
    299299  $DbResult = $System->Database->query('SELECT * FROM `ExportTask` WHERE `Export` = '.$ExportId);
    300   if($DbResult->num_rows == 0)
     300  if ($DbResult->num_rows == 0)
    301301  {
    302302    $System->Database->query('INSERT INTO ExportTask (`Export` ,`TimeStart` ) VALUES ('.$ExportId.', NOW())');
     
    306306  $DbResult = $System->Database->query('SELECT `TimeFinish` FROM `ExportTask` WHERE `Export` = '.$ExportId);
    307307  $ExportTask = $DbResult->fetch_assoc();
    308   if($ExportTask['TimeFinish'] <> '')
     308  if ($ExportTask['TimeFinish'] <> '')
    309309  {
    310310    $FileName = 'Instalace_CzechWoW_'.$Export->ClientVersion['Version'].'.exe';
     
    313313    $Output .= ShowProgress($Export);
    314314  }
    315   return($Output);
     315  return $Output;
    316316}
    317317
     
    324324  $Export->Init();
    325325
    326   if(function_exists('gzcompress'))
     326  if (function_exists('gzcompress'))
    327327  {
    328328    $Output = 'Generování lua souborů...<br />';
     
    342342    'Souhrný archív <a href="'.$System->Link('/'.$Export->TempDirRelative.'CzWoW_Lua.zip').'">CzWoW_Lua.zip</a><br />';
    343343  $DbResult = $System->Database->query('SELECT `Group`.* FROM `ExportGroup` JOIN `Group` ON `Group`.`Id` = `ExportGroup`.`Group` WHERE `ExportGroup`.`Export`='.$Export->Id.' AND `Group`.`LuaFileName` != ""');
    344   while($Group = $DbResult->fetch_assoc())
     344  while ($Group = $DbResult->fetch_assoc())
    345345  {
    346346    $Output .= '<a href="'.$System->Link('/'.$Export->TempDirRelative.'lua/'.$Group['LuaFileName'].'.lua').'">'.$Group['LuaFileName'].'.lua</a><br/>';
    347347  }
    348348  $Output .= '<br /><br /><strong>Použití ve hře</strong><br />Ze souborů vytvořte MPQ archív a nahrajte ho do hry do podsložky jako Data/enUS/patch-enUS-5.MPQ nebo Data/enUS/patch-enGB-5.MPQ. Pro starší verze hry než 3.2.0 je nutné spouštět hru pomocí programu WoWMe.exe (WoW Model Editor Fix).';
    349   return($Output);
     349  return $Output;
    350350}
    351351
    352352function ExportOutput($ExportId, $Type)
    353353{
    354   if($Type == 1) $Output = OutputMangosSQLToHTML($ExportId);
    355   else if($Type == 2) $Output = OutputMangosSQLToFile($ExportId);
    356   else if($Type == 3) $Output = OutputAoWoWToHTML($ExportId);
    357   else if($Type == 4) $Output = OutputAoWoWToFile($ExportId);
    358   else if($Type == 5) $Output = OutputXMLToHTML($ExportId);
    359   else if($Type == 6) $Output = OutputXMLToFile($ExportId);
    360   else if($Type == 7) $Output = OutputAddon($ExportId);
    361   else if($Type == 8) $Output = OutputLua($ExportId);
    362   else if($Type == 9) $Output = OutputDBCToFile($ExportId);
    363   else if($Type == 10) $Output = OutputEXEToFile($ExportId);
     354  if ($Type == 1) $Output = OutputMangosSQLToHTML($ExportId);
     355  else if ($Type == 2) $Output = OutputMangosSQLToFile($ExportId);
     356  else if ($Type == 3) $Output = OutputAoWoWToHTML($ExportId);
     357  else if ($Type == 4) $Output = OutputAoWoWToFile($ExportId);
     358  else if ($Type == 5) $Output = OutputXMLToHTML($ExportId);
     359  else if ($Type == 6) $Output = OutputXMLToFile($ExportId);
     360  else if ($Type == 7) $Output = OutputAddon($ExportId);
     361  else if ($Type == 8) $Output = OutputLua($ExportId);
     362  else if ($Type == 9) $Output = OutputDBCToFile($ExportId);
     363  else if ($Type == 10) $Output = OutputEXEToFile($ExportId);
    364364  else $Output = ShowMessage('Nebyl vybrán žádný formát výstupu.', MESSAGE_CRITICAL);
    365   return($Output);
    366 }
     365  return $Output;
     366}
  • trunk/Modules/Export/Page.php

    r864 r880  
    1717  {
    1818    $Output = '<a href="?Action=ViewList">'.T('All').'</a>';
    19     if($this->System->User->Licence(LICENCE_USER))
     19    if ($this->System->User->Licence(LICENCE_USER))
    2020    {
    2121      $Output .= ' <a href="?Action=ViewList&amp;Filter=Others">'.T('Others').'</a>'.
     
    2323    }
    2424
    25     if($this->System->User->Licence(LICENCE_USER))
     25    if ($this->System->User->Licence(LICENCE_USER))
    2626      $Output .= '<br/><div style="text-align: center;"><a href="?Action=Create">'.T('Create new export').'</a></div><br/>';
    2727
    2828    $Filter = '';
    29     if(array_key_exists('Filter', $_GET))
    30     {
    31       if($_GET['Filter'] == 'My') $Filter = ' WHERE `Export`.`User` = '.$this->System->User->Id;
    32       if($_GET['Filter'] == 'Others') $Filter = ' WHERE `Export`.`User` != '.$this->System->User->Id;
     29    if (array_key_exists('Filter', $_GET))
     30    {
     31      if ($_GET['Filter'] == 'My') $Filter = ' WHERE `Export`.`User` = '.$this->System->User->Id;
     32      if ($_GET['Filter'] == 'Others') $Filter = ' WHERE `Export`.`User` != '.$this->System->User->Id;
    3333    }
    3434
     
    6262      '(SELECT COUNT(*) FROM `ExportUser` WHERE `ExportUser`.`Export`=`Export`.`Id`) AS `UserCount` FROM `Export` '.
    6363      'LEFT JOIN `User` ON `User`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']);
    64     while($Export = $DbResult->fetch_assoc())
     64    while ($Export = $DbResult->fetch_assoc())
    6565    {
    6666      $Action = '<a href="?Action=View&amp;ExportId='.$Export['Id'].'&amp;Tab=0">'.T('View').'</a> '.
    6767        '<a href="?Action=View&amp;ExportId='.$Export['Id'].'&amp;Tab=7">'.T('Make export').'</a>';
    68       if($Export['User'] == $this->System->User->Id) $Action .= ' <a href="?Action=Delete&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Realy delete item?').'\');">'.T('Delete').'</a>';
    69       if($this->System->User->Id != null) $Action .= ' <a href="?Action=Clone&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Realy clone item?').'\');">'.T('Clone').'</a>';
     68      if ($Export['User'] == $this->System->User->Id) $Action .= ' <a href="?Action=Delete&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Realy delete item?').'\');">'.T('Delete').'</a>';
     69      if ($this->System->User->Id != null) $Action .= ' <a href="?Action=Clone&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Realy clone item?').'\');">'.T('Clone').'</a>';
    7070      $Output .= '<tr><td>'.HumanDate($Export['TimeCreate']).'</td>'.
    7171          '<td><a href="'.$this->System->Link('/user/?user='.$Export['User']).'">'.$Export['UserName'].'</a></td>'.
     
    7979        $PageList['Output'];
    8080
    81     return($Output);
     81    return $Output;
    8282  }
    8383
    8484  function ExportCreate()
    8585  {
    86     if($this->System->User->Licence(LICENCE_USER))
     86    if ($this->System->User->Licence(LICENCE_USER))
    8787    {
    8888      $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `User`='.$this->System->User->Id);
    8989      $DbRow = $DbResult->fetch_row();
    90       if($DbRow[0] < $this->System->Config['MaxExportPerUser'])
     90      if ($DbRow[0] < $this->System->Config['MaxExportPerUser'])
    9191      {
    9292        $Output = '<form action="?Action=CreateFinish" method="post">'.
     
    9898      } else $Output = ShowMessage(sprintf(T('You can\'t create another export. Max for one user is %d.'), $this->System->Config['MaxExportPerUser']), MESSAGE_CRITICAL);
    9999    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    100     return($Output);
     100    return $Output;
    101101  }
    102102
    103103  function ExportCreateFinish()
    104104  {
    105     if($this->System->User->Licence(LICENCE_USER))
    106     {
    107       if(array_key_exists('Title', $_POST) and array_key_exists('Description', $_POST))
     105    if ($this->System->User->Licence(LICENCE_USER))
     106    {
     107      if (array_key_exists('Title', $_POST) and array_key_exists('Description', $_POST))
    108108      {
    109109        $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `User`='.$this->System->User->Id);
    110110        $DbRow = $DbResult->fetch_row();
    111         if($DbRow[0] < $this->System->Config['MaxExportPerUser'])
     111        if ($DbRow[0] < $this->System->Config['MaxExportPerUser'])
    112112        {
    113113          $this->System->Database->query('INSERT INTO `Export` (`Title`, `User`, `TimeCreate`, `WithDiacritic`, `Description`) VALUES ("'.$_POST['Title'].'", '.$this->System->User->Id.', NOW(), 1, "'.$_POST['Description'].'")');
     
    120120      } else $Output = ShowMessage(T('Missing data in form.'), MESSAGE_CRITICAL);
    121121    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    122     return($Output);
     122    return $Output;
    123123  }
    124124
    125125  function ExportDelete()
    126126  {
    127     if($this->System->User->Licence(LICENCE_USER))
     127    if ($this->System->User->Licence(LICENCE_USER))
    128128    {
    129129      $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE (`Id`='.($_GET['ExportId'] * 1).') AND (`User`='.$this->System->User->Id.')');
    130       if($DbResult->num_rows > 0)
     130      if ($DbResult->num_rows > 0)
    131131      {
    132132        $this->System->Database->query('DELETE FROM `ExportGroup` WHERE `Export`='.$_GET['ExportId']);
     
    143143      } else $Output = ShowMessage(T('Export not found.'), MESSAGE_CRITICAL);
    144144    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    145     return($Output);
     145    return $Output;
    146146  }
    147147
     
    163163    $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    164164    $Export = $DbResult->fetch_assoc();
    165     if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true;
     165    if ($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true;
    166166    else $Editable = false;
    167167
    168     if(array_key_exists('Operation', $_POST))
    169     {
    170       if($_POST['Operation'] == 'Save')
     168    if (array_key_exists('Operation', $_POST))
     169    {
     170      if ($_POST['Operation'] == 'Save')
    171171      {
    172172        //print_r($_POST);
    173173        // Update user selection page
    174         foreach($_POST as $Index => $Value)
     174        foreach ($_POST as $Index => $Value)
    175175        {
    176           if(substr($Index, 0, 3) == 'seq')
     176          if (substr($Index, 0, 3) == 'seq')
    177177          {
    178178            $UserId = substr($Index, 3) * 1;
    179             if(array_key_exists('sel'.$UserId, $_POST)) $Selected = true;
     179            if (array_key_exists('sel'.$UserId, $_POST)) $Selected = true;
    180180            else $Selected = false;
    181181            $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `User`='.$UserId;
    182182            $DbResult = $this->System->Database->query('SELECT * FROM `ExportUser` '.$Condition);
    183             if($DbResult->num_rows > 0)
     183            if ($DbResult->num_rows > 0)
    184184            {
    185               if(!$Selected) $this->System->Database->query('DELETE FROM `ExportUser` '.$Condition);
     185              if (!$Selected) $this->System->Database->query('DELETE FROM `ExportUser` '.$Condition);
    186186              else $this->System->Database->query('UPDATE `ExportUser` SET `Sequence`='.$Value.$Condition);
    187187            } else
    188188            {
    189               if($Selected) $this->System->Database->query('INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$_GET['ExportId'].', '.$UserId.', '.$Value.')');
     189              if ($Selected) $this->System->Database->query('INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$_GET['ExportId'].', '.$UserId.', '.$Value.')');
    190190            }
    191191          }
     
    221221    );
    222222    $Order = GetOrderTableHeader($TableColumns, 'TranslatedCount', 1);
    223     if($Order['Column'] != 'Sequence2') $InitialOrder = ', '.substr($Order['SQL'], 10);
     223    if ($Order['Column'] != 'Sequence2') $InitialOrder = ', '.substr($Order['SQL'], 10);
    224224    else $InitialOrder = '';
    225225
     
    234234    $Output .= '<form name="Translators" action="?Action=View&amp;ExportId='.$_GET['ExportId'].'" method="post">'.
    235235        '<h3>'.T('Translators').'</h3>';
    236     if($Editable)
     236    if ($Editable)
    237237    {
    238238      $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'.
     
    252252    $this->System->Database->query('SET @I = 0');
    253253    $DbResult = $this->System->Database->query($Query);
    254     while($UserLine = $DbResult->fetch_assoc())
     254    while ($UserLine = $DbResult->fetch_assoc())
    255255    {
    256256      $XP = GetLevelMinMax($UserLine['XP']);
     
    268268        '</form>'.
    269269        $PageList['Output'];
    270     return($Output);
     270    return $Output;
    271271  }
    272272
     
    278278    $DbRows = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    279279    $Export = $DbRows->fetch_assoc();
    280     if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true;
     280    if ($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true;
    281281    else $Editable = false;
    282282
    283     if(array_key_exists('Operation', $_POST))
    284       if($_POST['Operation'] == 'Save')  if($Editable and array_key_exists('Title', $_POST) and array_key_exists('Description', $_POST))
    285       {
    286         if(array_key_exists('WithDiacritic', $_POST)) $WithDiacritic = 1;
     283    if (array_key_exists('Operation', $_POST))
     284      if ($_POST['Operation'] == 'Save')  if ($Editable and array_key_exists('Title', $_POST) and array_key_exists('Description', $_POST))
     285      {
     286        if (array_key_exists('WithDiacritic', $_POST)) $WithDiacritic = 1;
    287287        else $WithDiacritic = 0;
    288288        if (array_key_exists('Featured', $_POST)) $Export['Featured'] = 1;
     
    296296      }
    297297
    298       if($Export['WithDiacritic'] == 1) $WithDiacritic = ' checked="checked"';
     298      if ($Export['WithDiacritic'] == 1) $WithDiacritic = ' checked="checked"';
    299299      else $WithDiacritic = '';
    300300      $Output .= '<form action="?Action=View&amp;Tab=0&amp;ExportId='.$Export['Id'].'" method="post">'.
    301301          '<table>';
    302       if($this->System->User->Id != null)
     302      if ($this->System->User->Id != null)
    303303      {
    304304        $Output .= '<input type="hidden" name="Operation" value="Save"/>'.
    305305            '<tr><td colspan="2">';
    306         if($Editable) $Output .= ' <input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>';
     306        if ($Editable) $Output .= ' <input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>';
    307307        $Output .= ' <a href="?Action=Clone&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Realy clone item?').'\');">'.T('Clone').'</a> ';
    308         if($this->System->User->Licence(LICENCE_ADMIN))
     308        if ($this->System->User->Licence(LICENCE_ADMIN))
    309309          $Output .= CheckBox('Featured', $Export['Featured'], '', 'CheckBox', !$Editable). ' '.T('Recommended').' ';
    310310        $Output .= '</td></tr>';
     
    314314          '<tr><td>'.T('With diacritics').'</td><td><input type="checkbox" name="WithDiacritic" '.$WithDiacritic.''.$DisabledInput[$Editable].'/></td></tr>'.
    315315          '</table></form>';
    316       return($Output);
     316      return $Output;
    317317  }
    318318
     
    325325    $DbRows = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    326326    $Export = $DbRows->fetch_assoc();
    327     if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true;
     327    if ($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true;
    328328    else $Editable = false;
    329329
    330     if(array_key_exists('Operation', $_POST))
    331     {
    332       if($_POST['Operation'] == 'Save')
     330    if (array_key_exists('Operation', $_POST))
     331    {
     332      if ($_POST['Operation'] == 'Save')
    333333      {
    334334        //print_r($_POST);
    335335        // Update user selection page
    336         foreach($_POST as $Index => $Value)
     336        foreach ($_POST as $Index => $Value)
    337337        {
    338           if(substr($Index, 0, 3) == 'seq')
     338          if (substr($Index, 0, 3) == 'seq')
    339339          {
    340340            $LanguageId = substr($Index, 3) * 1;
    341             if(array_key_exists('sel'.$LanguageId, $_POST)) $Selected = true;
     341            if (array_key_exists('sel'.$LanguageId, $_POST)) $Selected = true;
    342342            else $Selected = false;
    343343            $Condition = ' WHERE Export='.$_GET['ExportId'].' AND `Language`='.$LanguageId;
    344344            $DbResult = $this->System->Database->query('SELECT * FROM `ExportLanguage` '.$Condition);
    345             if($DbResult->num_rows > 0)
     345            if ($DbResult->num_rows > 0)
    346346            {
    347               if(!$Selected) $this->System->Database->query('DELETE FROM `ExportLanguage` '.$Condition);
     347              if (!$Selected) $this->System->Database->query('DELETE FROM `ExportLanguage` '.$Condition);
    348348              else $this->System->Database->query('UPDATE `ExportLanguage` SET `Sequence`='.$Value.$Condition);
    349349            } else
    350350            {
    351               if($Selected) $this->System->Database->query('INSERT INTO `ExportLanguage` (`Export`, `Language`, `Sequence`) VALUES ('.$_GET['ExportId'].', '.$LanguageId.', '.$Value.')');
     351              if ($Selected) $this->System->Database->query('INSERT INTO `ExportLanguage` (`Export`, `Language`, `Sequence`) VALUES ('.$_GET['ExportId'].', '.$LanguageId.', '.$Value.')');
    352352            }
    353353          }
     
    377377    $Output .= '<form action="?Action=View&amp;ExportId='.$_GET['ExportId'].'" method="post">'.
    378378        '<h3>'.T('Languages').'</h3>';
    379     if($Editable)
     379    if ($Editable)
    380380    {
    381381      $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'.
     
    393393    $this->System->Database->query('SET @I = 0');
    394394    $DbResult = $this->System->Database->query($Query);
    395     while($Langugage = $DbResult->fetch_assoc())
     395    while ($Langugage = $DbResult->fetch_assoc())
    396396    {
    397397      $Checked = $Langugage['Sequence'] != '';
     
    405405        '</form>'.
    406406        $PageList['Output'];
    407     return($Output);
     407    return $Output;
    408408  }
    409409
     
    416416    $DbRows = $this->System->Database->query('SELECT * FROM Export WHERE Id='.$_GET['ExportId']);
    417417    $Export = $DbRows->fetch_assoc();
    418     if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true;
     418    if ($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true;
    419419    else $Editable = false;
    420420
    421     if(array_key_exists('Operation', $_POST))
    422     {
    423       if($_POST['Operation'] == 'Save')
     421    if (array_key_exists('Operation', $_POST))
     422    {
     423      if ($_POST['Operation'] == 'Save')
    424424      {
    425425        //print_r($_POST);
    426426        // Update user selection page
    427         foreach($_POST as $Index => $Value)
     427        foreach ($_POST as $Index => $Value)
    428428        {
    429           if(substr($Index, 0, 3) == 'seq')
     429          if (substr($Index, 0, 3) == 'seq')
    430430          {
    431431            $GroupId = substr($Index, 3) * 1;
    432             if(array_key_exists('sel'.$GroupId, $_POST)) $Selected = true;
     432            if (array_key_exists('sel'.$GroupId, $_POST)) $Selected = true;
    433433            else $Selected = false;
    434434            $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `Group`='.$GroupId;
    435435            $DbResult = $this->System->Database->query('SELECT * FROM `ExportGroup` '.$Condition);
    436             if($DbResult->num_rows > 0)
     436            if ($DbResult->num_rows > 0)
    437437            {
    438               if(!$Selected) $this->System->Database->query('DELETE FROM `ExportGroup` '.$Condition);
     438              if (!$Selected) $this->System->Database->query('DELETE FROM `ExportGroup` '.$Condition);
    439439            } else
    440440            {
    441               if($Selected) $this->System->Database->query('INSERT INTO `ExportGroup` (`Export`, `Group`) VALUES ('.$_GET['ExportId'].', '.$GroupId.')');
     441              if ($Selected) $this->System->Database->query('INSERT INTO `ExportGroup` (`Export`, `Group`) VALUES ('.$_GET['ExportId'].', '.$GroupId.')');
    442442            }
    443443          }
     
    446446      }
    447447      //items
    448       foreach($TranslationTree as $Group)
    449       {
    450         foreach($TranslationTree[$Group['Id']]['Items'] as $Column) {
    451           if(array_key_exists('item'.$Column['Id'], $_POST)) $Selected = true;
     448      foreach ($TranslationTree as $Group)
     449      {
     450        foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) {
     451          if (array_key_exists('item'.$Column['Id'], $_POST)) $Selected = true;
    452452          else $Selected = false;
    453453          //we will save only forbitten collums and need to be visible
     
    457457            $Condition = ' WHERE `Export`='.$_GET['ExportId'].' AND `GroupItem`='.$Column['Id'];
    458458            $DbResult = $this->System->Database->query('SELECT * FROM `ExportGroupItem` '.$Condition);
    459             if($DbResult->num_rows > 0)
     459            if ($DbResult->num_rows > 0)
    460460            {
    461               if(!$Selected) $this->System->Database->query('DELETE FROM `ExportGroupItem` '.$Condition);
     461              if (!$Selected) $this->System->Database->query('DELETE FROM `ExportGroupItem` '.$Condition);
    462462            } else
    463463            {
    464               if($Selected) $this->System->Database->query('INSERT INTO `ExportGroupItem` (`Export`, `GroupItem`) VALUES ('.$_GET['ExportId'].', '.$Column['Id'].')');
     464              if ($Selected) $this->System->Database->query('INSERT INTO `ExportGroupItem` (`Export`, `GroupItem`) VALUES ('.$_GET['ExportId'].', '.$Column['Id'].')');
    465465            }
    466466
     
    486486    $Output .= '<form action="?Action=View&amp;ExportId='.$_GET['ExportId'].'" method="post">'.
    487487        '<h3>'.T('Translation groups').'</h3>';
    488     if($Editable)
     488    if ($Editable)
    489489    {
    490490      $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'.
     
    500500
    501501    $DbResultItem = $this->System->Database->query('SELECT * FROM `ExportGroupItem` WHERE `Export`='.$_GET['ExportId']);
    502     while($GroupItem = $DbResultItem->fetch_assoc())
     502    while ($GroupItem = $DbResultItem->fetch_assoc())
    503503    {
    504504      $GroupItems[$GroupItem['GroupItem']] = 1;
     
    507507    $Query = 'SELECT * FROM ('.$Query.') AS TX '.$Order['SQL'].$PageList['SQLLimit'];
    508508    $DbResult = $this->System->Database->query($Query);
    509     while($Group = $DbResult->fetch_assoc())
     509    while ($Group = $DbResult->fetch_assoc())
    510510    {
    511511      $Columns = '';
    512       foreach($TranslationTree[$Group['Id']]['Items'] as $Column) {
     512      foreach ($TranslationTree[$Group['Id']]['Items'] as $Column) {
    513513        if ($Column['Visible']) $Columns .= CheckBox('item'.$Column['Id'],
    514514          !isset($GroupItems[$Column['Id']]), '', 'CheckBox', !$Editable).' '.T($Column['Name']).' <br/>';
     
    533533      '</form>'.
    534534      $PageList['Output'];
    535     return($Output);
     535    return $Output;
    536536  }
    537537
     
    540540    $Output = '';
    541541    $DisabledInput = array(false => ' disabled="disabled"', true => '');
    542     if(array_key_exists('ExportId', $_GET))
     542    if (array_key_exists('ExportId', $_GET))
    543543    {
    544544      $DbRows = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    545       if($DbRows->num_rows > 0)
     545      if ($DbRows->num_rows > 0)
    546546      {
    547547        $Export = $DbRows->fetch_assoc();
    548         if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true;
     548        if ($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true;
    549549        else $Editable = false;
    550550
    551         if(array_key_exists('Operation', $_POST))
    552           if($_POST['Operation'] == 'Save')
     551        if (array_key_exists('Operation', $_POST))
     552          if ($_POST['Operation'] == 'Save')
    553553          {
    554             if(array_key_exists('OutputType', $_POST) and ($_POST['OutputType'] * 1 > 0))
     554            if (array_key_exists('OutputType', $_POST) and ($_POST['OutputType'] * 1 > 0))
    555555            {
    556556              $this->System->Database->query('UPDATE Export SET OutputType='.$_POST['OutputType'].' WHERE Id='.$_GET['ExportId']);
     
    564564          $Output .= '<h3>'.T('Format the generated output').'</h3>'.
    565565              '<form action="?Action=View&amp;ExportId='.$_GET['ExportId'].'" method="post">';
    566           if($Editable)
     566          if ($Editable)
    567567          {
    568568            $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'.
     
    571571          }
    572572          $DbResult = $this->System->Database->query('SELECT * FROM `ExportOutputType` ORDER BY `Name`');
    573           while($ExportFormat = $DbResult->fetch_assoc())
     573          while ($ExportFormat = $DbResult->fetch_assoc())
    574574          {
    575575            $Output .= RadioButton('OutputType', $ExportFormat['Id'], $Export['OutputType'] == $ExportFormat['Id'], '', !$Editable).' '.$ExportFormat['Name'].'<br/>';
     
    578578      } else $Output .= ShowMessage(T('Item not found'), MESSAGE_CRITICAL);
    579579    } else $Output .= ShowMessage(T('Is isn\'t select'), MESSAGE_CRITICAL);
    580     return($Output);
     580    return $Output;
    581581  }
    582582
     
    587587    $DbRows = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    588588    $Export = $DbRows->fetch_assoc();
    589     if($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true;
     589    if ($this->System->User->Licence(LICENCE_USER) and ($this->System->User->Id == $Export['User'])) $Editable = true;
    590590    else $Editable = false;
    591591
    592     if(array_key_exists('Operation', $_POST))
    593       if(($_POST['Operation'] == 'Save') and (array_key_exists('ClientVersion', $_POST)))
     592    if (array_key_exists('Operation', $_POST))
     593      if (($_POST['Operation'] == 'Save') and (array_key_exists('ClientVersion', $_POST)))
    594594      {
    595595        $this->System->Database->query('UPDATE `Export` SET `ClientVersion`='.$_POST['ClientVersion'].' WHERE `Id`='.$_GET['ExportId']);
     
    600600      $Export = $DbResult->fetch_assoc();
    601601
    602       if($Export['OutputType'] == '') $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL);
     602      if ($Export['OutputType'] == '') $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL);
    603603      else {
    604604        $Query = 'SELECT `ClientVersion`.* FROM `ExportVersion` '.
     
    620620            '<h3>'.T('Client version').'</h3>';
    621621
    622         if($Editable)
     622        if ($Editable)
    623623        {
    624624          $Output .= '<input type="submit" value="'.T('Save').'" '.$DisabledInput[$Editable].'/>'.
     
    633633        $Query = 'SELECT * FROM ('.$Query.') AS `TX` '.$Order['SQL'].$PageList['SQLLimit'];
    634634        $DbResult = $this->System->Database->query($Query);
    635         while($Version = $DbResult->fetch_assoc())
     635        while ($Version = $DbResult->fetch_assoc())
    636636        {
    637637          $Output .= '<tr><td><a href="'.$this->System->Link('/client-version/?action=item&amp;id='.$Version['Id']).'">'.
     
    646646            $PageList['Output'];
    647647      }
    648       return($Output);
     648      return $Output;
    649649  }
    650650
     
    654654    $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    655655    $Export = $DbResult->fetch_assoc();
    656     if($Export['OutputType'] == '') $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL);
    657     else if($Export['ClientVersion'] == '') $Output .= ShowMessage(T('Export don\'t have selected version of client'), MESSAGE_CRITICAL);
     656    if ($Export['OutputType'] == '') $Output .= ShowMessage('Nevybrán typ exportu', MESSAGE_CRITICAL);
     657    else if ($Export['ClientVersion'] == '') $Output .= ShowMessage(T('Export don\'t have selected version of client'), MESSAGE_CRITICAL);
    658658    else {
    659659      $DbResult = $this->System->Database->query('SELECT * FROM `ExportOutputType` WHERE `Id`='.$Export['OutputType']);
    660       if($DbResult->num_rows > 0)
     660      if ($DbResult->num_rows > 0)
    661661      {
    662662        $DbResult = $this->System->Database->query('SELECT * FROM `ExportVersion` WHERE (`ExportType`='.$Export['OutputType'].') AND (`ClientVersion`='.$Export['ClientVersion'].')');
    663         if($DbResult->num_rows > 0)
     663        if ($DbResult->num_rows > 0)
    664664        {
    665665          if (array_key_exists('Auto', $_GET) == false)
     
    669669      } else $Output = ShowMessage(T('Format output isn\'t select').'.', MESSAGE_CRITICAL);
    670670    }
    671     return($Output);
     671    return $Output;
    672672  }
    673673
     
    679679    $Export->LoadFilters();
    680680
    681     if(($Export->Export['ClientVersion'] == '') or ($Export->ClientVersion['BuildNumber'] == ''))
     681    if (($Export->Export['ClientVersion'] == '') or ($Export->ClientVersion['BuildNumber'] == ''))
    682682      $Output = ShowMessage(T('Export don\'t have selected version of client'), MESSAGE_CRITICAL);
    683683    else {
     
    687687      $UnionItems = array();
    688688      $DbResult = $this->System->Database->query($GroupListQuery.$Where);
    689       while($DbRow = $DbResult->fetch_assoc())
     689      while ($DbRow = $DbResult->fetch_assoc())
    690690      {
    691691        $UnionItems[] = 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
     
    721721      $Translated = 0;
    722722      $Total = 0;
    723       if(count($UnionItems) > 0)
     723      if (count($UnionItems) > 0)
    724724      {
    725725        $ID = $this->System->Database->query('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.implode(' UNION ALL ', $UnionItems).') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']);
    726         while($Group = $ID->fetch_assoc())
     726        while ($Group = $ID->fetch_assoc())
    727727        {
    728728          $Output .= '<tr><td>'.T($Group['Name']).'</td><td>'.$Group['Translated'].'</td><td>'.$Group['Total'].'</td><td>'.ProgressBar(150, $Group['Percent']).'</td></tr>';
     
    731731        }
    732732      }
    733       if($Total > 0) $Percent = $Translated / $Total * 100;
     733      if ($Total > 0) $Percent = $Translated / $Total * 100;
    734734      else $Percent = 100;
    735735
     
    737737      $Output .= '</table>';
    738738    }
    739     return($Output);
     739    return $Output;
    740740  }
    741741
     
    743743  {
    744744    $Output = '';
    745     if(array_key_exists('ExportId', $_GET) and is_numeric($_GET['ExportId']))
     745    if (array_key_exists('ExportId', $_GET) and is_numeric($_GET['ExportId']))
    746746    {
    747747      $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    748       if($DbResult->num_rows > 0)
     748      if ($DbResult->num_rows > 0)
    749749      {
    750750        $Export = $DbResult->fetch_assoc();
     
    759759          T('Statistic'), T('Output')));
    760760        $Output .= '<div id="content">';
    761         if($_SESSION['Tab'] == TAB_GENERAL) $Output .= $this->ExportViewGeneral();
    762         else if($_SESSION['Tab'] == TAB_TRANSLATORS) $Output .= $this->ExportViewTranslators();
    763         else if($_SESSION['Tab'] == TAB_GROUPS) $Output .= $this->ExportViewGroups();
    764         else if($_SESSION['Tab'] == TAB_LANGUAGES) $Output .= $this->ExportViewLanguages();
    765         else if($_SESSION['Tab'] == TAB_OUTPUT_FORMAT) $Output .= $this->ExportViewOutputFormat();
    766         else if($_SESSION['Tab'] == TAB_VERSION) $Output .= $this->ExportViewVersion();
    767         else if($_SESSION['Tab'] == TAB_STAT) $Output .= $this->ExportViewStat();
    768         else if($_SESSION['Tab'] == TAB_OUTPUT) $Output .= $this->ExportViewOutput();
     761        if ($_SESSION['Tab'] == TAB_GENERAL) $Output .= $this->ExportViewGeneral();
     762        else if ($_SESSION['Tab'] == TAB_TRANSLATORS) $Output .= $this->ExportViewTranslators();
     763        else if ($_SESSION['Tab'] == TAB_GROUPS) $Output .= $this->ExportViewGroups();
     764        else if ($_SESSION['Tab'] == TAB_LANGUAGES) $Output .= $this->ExportViewLanguages();
     765        else if ($_SESSION['Tab'] == TAB_OUTPUT_FORMAT) $Output .= $this->ExportViewOutputFormat();
     766        else if ($_SESSION['Tab'] == TAB_VERSION) $Output .= $this->ExportViewVersion();
     767        else if ($_SESSION['Tab'] == TAB_STAT) $Output .= $this->ExportViewStat();
     768        else if ($_SESSION['Tab'] == TAB_OUTPUT) $Output .= $this->ExportViewOutput();
    769769        else $Output .= $this->ExportViewGeneral();
    770770
     
    772772      } else $Output .= ShowMessage(T('Export not found.'), MESSAGE_CRITICAL);
    773773    } else $Output .= ShowMessage(T('Is isn\'t select'), MESSAGE_CRITICAL);
    774     return($Output);
     774    return $Output;
    775775  }
    776776
    777777  function ExportClone()
    778778  {
    779     if($this->System->User->Licence(LICENCE_USER))
    780     {
    781       if(array_key_exists('ExportId', $_GET) and is_numeric($_GET['ExportId']))
     779    if ($this->System->User->Licence(LICENCE_USER))
     780    {
     781      if (array_key_exists('ExportId', $_GET) and is_numeric($_GET['ExportId']))
    782782      {
    783783        $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Export` WHERE `User`='.$this->System->User->Id);
    784784        $DbRow = $DbResult->fetch_row();
    785         if($DbRow[0] < $this->System->Config['MaxExportPerUser'])
     785        if ($DbRow[0] < $this->System->Config['MaxExportPerUser'])
    786786        {
    787787          $DbResult = $this->System->Database->query('SELECT * FROM `Export` WHERE `Id`='.$_GET['ExportId']);
    788           if($DbResult->num_rows > 0)
     788          if ($DbResult->num_rows > 0)
    789789          {
    790790            $DbRow = $DbResult->fetch_assoc();
     
    810810      } else $Output = ShowMessage(T('Export not found.'), MESSAGE_CRITICAL);
    811811    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    812     return($Output);
     812    return $Output;
    813813  }
    814814
     
    816816  {
    817817    $this->Title = T('Export');
    818     if(array_key_exists('Action', $_GET))
    819     {
    820       if($_GET['Action'] == 'Create') $Output = $this->ExportCreate();
    821       else if($_GET['Action'] == 'CreateFinish') $Output = $this->ExportCreateFinish();
    822       else if($_GET['Action'] == 'View') $Output = $this->ExportView();
    823       else if($_GET['Action'] == 'Delete') $Output = $this->ExportDelete();
    824       else if($_GET['Action'] == 'Clone') $Output = $this->ExportClone();
     818    if (array_key_exists('Action', $_GET))
     819    {
     820      if ($_GET['Action'] == 'Create') $Output = $this->ExportCreate();
     821      else if ($_GET['Action'] == 'CreateFinish') $Output = $this->ExportCreateFinish();
     822      else if ($_GET['Action'] == 'View') $Output = $this->ExportView();
     823      else if ($_GET['Action'] == 'Delete') $Output = $this->ExportDelete();
     824      else if ($_GET['Action'] == 'Clone') $Output = $this->ExportClone();
    825825      else $Output = $this->ExportList();
    826826    } else $Output = $this->ExportList();
    827     return($Output);
     827    return $Output;
    828828  }
    829829}
     
    839839  function Show()
    840840  {
    841     if(array_key_exists('i', $_GET))
     841    if (array_key_exists('i', $_GET))
    842842      $Output = $this->System->ModuleManager->Modules['Export']->GetTaskProgress($_GET['i'] * 1);
    843843      else $Output = 'Missing task id';
    844     return($Output);
     844    return $Output;
    845845  }
    846846}
  • trunk/Modules/Export/ProcessAoWoWExport.php

    r848 r880  
    1414$Output = '';
    1515
    16 if(defined('STDIN') == false)
     16if (defined('STDIN') == false)
    1717{
    1818  $Output = T('Access denied');
     
    2020}
    2121
    22 foreach($_SERVER['argv'] as $parameter)
     22foreach ($_SERVER['argv'] as $parameter)
    2323{
    24   if(strpos($parameter, '=') !== false)
     24  if (strpos($parameter, '=') !== false)
    2525  {
    2626    $index = substr($parameter, 0, strpos($parameter, '='));
     
    3333echo 'Generuji Export:';
    3434  $Export = new Export($System);
    35 if(!array_key_exists('AoWoWExportId', $Config)) {
     35if (!array_key_exists('AoWoWExportId', $Config)) {
    3636  $Export->Id = $Config['AoWoWExportId'];
    3737} else $Export->Id = 37;
     
    4545$UserSelection = array();
    4646$DbResult = $System->Database->query('SELECT `ID`, `XP` FROM `User`');
    47 while($DbRow = $DbResult->fetch_assoc())
     47while ($DbRow = $DbResult->fetch_assoc())
    4848{
    4949  $UserSelection[$DbRow['ID']] = $DbRow['XP'];
     
    5353// Update export user selection sequence
    5454$Sequence = 1;
    55 foreach($UserSelection as $ID => $XP)
     55foreach ($UserSelection as $ID => $XP)
    5656{
    5757  $DbResult = $System->Database->query('SELECT `Id` FROM `ExportUser` WHERE `Export` = '.$Config['AoWoWExportId'].' AND `User` = '.$ID);
    58   if($DbResult->num_rows > 0)
     58  if ($DbResult->num_rows > 0)
    5959    $Query = 'UPDATE `ExportUser` SET `Sequence` = '.$Sequence.' WHERE `Export` = '.$Config['AoWoWExportId'].' AND `User` = '.$ID;
    6060    else $Query = 'INSERT INTO `ExportUser` (`Export`, `User`, `Sequence`) VALUES ('.$Config['AoWoWExportId'].', '.$ID.', '.$Sequence.')';
     
    7070$Database2->query('SET NAMES '.$Config['Database']['Charset']);
    7171$Database2->select_db($Config['Database']['DatabaseAoWoW']);
    72 foreach($SQL as $Line)
     72foreach ($SQL as $Line)
    7373{
    7474//echo '.';
    7575  //echo($Line."\n");
    76   if(trim($Line) != '') $Database2->query($Line);
     76  if (trim($Line) != '') $Database2->query($Line);
    7777}
    7878echo 'Hotovo
     
    8383// Delete temporary cache files
    8484$Files = scandir(dirname(__FILE__).'/../../aowow/cache/mangos');
    85 foreach($Files as $File)
     85foreach ($Files as $File)
    8686{
    8787  $End = substr($File, strlen($File) - 3);
    88   if($End == 'aww') unlink(dirname(__FILE__).'/../../aowow/cache/mangos/'.$File);
     88  if ($End == 'aww') unlink(dirname(__FILE__).'/../../aowow/cache/mangos/'.$File);
    8989}
    9090$Files = scandir(dirname(__FILE__).'/../../aowow/cache/templates/wowhead');
    91 foreach($Files as $File)
     91foreach ($Files as $File)
    9292{
    9393  $End = substr($File, strlen($File) - 3);
    94   if($End == 'php') unlink(dirname(__FILE__).'/../../aowow/cache/templates/wowhead/'.$File);
     94  if ($End == 'php') unlink(dirname(__FILE__).'/../../aowow/cache/templates/wowhead/'.$File);
    9595}
    9696echo 'Hotovo
  • trunk/Modules/Export/ProcessTask.php

    r869 r880  
    2323  function DeleteOldFiles($deldir)
    2424  {
    25     if(file_exists($deldir.'/'))
     25    if (file_exists($deldir.'/'))
    2626    {
    2727      $Dir = opendir($deldir.'/') ;
    28       while(($File = readdir($Dir)) !== false)
     28      while (($File = readdir($Dir)) !== false)
    2929      {
    30         if(($File != '..') and ($File != '.') and (!is_dir($File))) unlink($deldir.'/'.$File);
     30        if (($File != '..') and ($File != '.') and (!is_dir($File))) unlink($deldir.'/'.$File);
    3131      }
    3232      closedir($Dir);
     
    5656  function MPQPack($packdir)
    5757  {
    58     if(file_exists($packdir.DIRECTORY_SEPARATOR))
     58    if (file_exists($packdir.DIRECTORY_SEPARATOR))
    5959    {
    6060      $Dir = opendir($packdir.DIRECTORY_SEPARATOR);
    61       while(($File = readdir($Dir)) !== false)
     61      while (($File = readdir($Dir)) !== false)
    6262      {
    63         if(($File != '..') and ($File != '.')) {
     63        if (($File != '..') and ($File != '.')) {
    6464          $File = str_replace('/', DIRECTORY_SEPARATOR, $File);
    6565          $InDir = '';
     
    109109    // Delete old files
    110110    $this->DeleteOldFiles($Export->TempDir.'dbc');
    111     if(file_exists($Export->TempDir.'CzWoW_DBC.zip')) unlink($Export->TempDir.'CzWoW_DBC.zip');
     111    if (file_exists($Export->TempDir.'CzWoW_DBC.zip')) unlink($Export->TempDir.'CzWoW_DBC.zip');
    112112
    113113    $this->SetProgress(20);
    114     if(function_exists('gzcompress'))
     114    if (function_exists('gzcompress'))
    115115    {
    116116      $Export->ExportToDBC();
     
    185185    global $Config;
    186186
    187     while(1)
     187    while (1)
    188188    {
    189189      $DbResult = $this->Database->query('SELECT `ExportTask`.`Id`, `ExportTask`.`Export`, '.
     
    191191        'LEFT JOIN `Export` ON `Export`.`Id` = `ExportTask`.`Export` WHERE '.
    192192        '(`ExportTask`.`TimeFinish` IS NULL) ORDER BY `TimeQueued`');
    193       while($Task = $DbResult->fetch_assoc())
     193      while ($Task = $DbResult->fetch_assoc())
    194194      {
    195195        $this->Id = $Task['Id'];
    196         if($Task['ExportId'] != '')
     196        if ($Task['ExportId'] != '')
    197197        {
    198198          try
     
    201201            $this->Database->update('ExportTask', '`Id`='.$this->Id, array('TimeStart' => 'NOW()'));
    202202
    203             if($Task['ExportOutput'] == 9)
     203            if ($Task['ExportOutput'] == 9)
    204204            {
    205205              $this->ExportDBC($Task);
    206206            } else
    207             if($Task['ExportOutput'] == 10)
     207            if ($Task['ExportOutput'] == 10)
    208208            {
    209209              $this->ExportEXE($Task);
  • trunk/Modules/Export/cmdmpqexport.php

    r867 r880  
    1717$Output = '';
    1818
    19 if(defined('STDIN') == false)
     19if (defined('STDIN') == false)
    2020{
    2121  $Output = T('Access denied');
     
    2323}
    2424
    25 foreach($_SERVER['argv'] as $parameter)
     25foreach ($_SERVER['argv'] as $parameter)
    2626{
    27   if(strpos($parameter, '=') !== false)
     27  if (strpos($parameter, '=') !== false)
    2828  {
    2929    $index = substr($parameter, 0, strpos($parameter, '='));
     
    3333  } else $_GET[$parameter] = '';
    3434}
    35 if(!array_key_exists('ExportId', $_GET) and !array_key_exists('needgeneration', $_GET) and !array_key_exists('version', $_GET) and !array_key_exists('dbc', $_GET) and !array_key_exists('lua', $_GET) and !array_key_exists('addon', $_GET)) {
     35if (!array_key_exists('ExportId', $_GET) and !array_key_exists('needgeneration', $_GET) and !array_key_exists('version', $_GET) and !array_key_exists('dbc', $_GET) and !array_key_exists('lua', $_GET) and !array_key_exists('addon', $_GET)) {
    3636  $Output .= 'Usage type_export=id_export -for export<br />';
    3737  $Output .= 'Usage ExportId=id_export - for write export info<br />';
     
    4343}
    4444                     //37
    45 if(array_key_exists('lua', $_GET)) {
     45if (array_key_exists('lua', $_GET)) {
    4646  $Export = new Export($System);
    4747  $Export->Id = $_GET['lua'];
     
    5353',$Output);
    5454}
    55 if(array_key_exists('version', $_GET)) {
     55if (array_key_exists('version', $_GET)) {
    5656  $Export = new Export($System);
    5757  $Export->Id = $_GET['version'];
     
    6363',$Output);
    6464}
    65 if(array_key_exists('dbc', $_GET)) {
     65if (array_key_exists('dbc', $_GET)) {
    6666  $Export = new Export($System);
    6767  $Export->Id = $_GET['dbc'];
     
    7373',$Output);
    7474}
    75 if(array_key_exists('addon', $_GET)) {
     75if (array_key_exists('addon', $_GET)) {
    7676    $Addon = new ExportAddon($System);
    7777    $Addon->Id = $_GET['addon'];
     
    8484}
    8585
    86 if(array_key_exists('needgeneration', $_GET)) {
     86if (array_key_exists('needgeneration', $_GET)) {
    8787  $DbRows = $System->Database->query('SELECT `ClientVersion`.`Version` AS `Version`, '.
    8888    '`Export`.`Id`,`Export`.`ClientVersion`,`Export`.`OutputType`,`Export`.`Title`,'.
     
    9696  if ($Export->NeedGeneration()) {
    9797    $DbResult = $System->Database->query('SELECT * FROM `ExportTask` WHERE `Export` = '.$Export->Id);
    98     if($DbResult->num_rows == 0)
     98    if ($DbResult->num_rows == 0)
    9999    {
    100100      $System->Database->query('INSERT INTO `ExportTask` (`Export` ,`TimeStart` ) VALUES ('.$Export->Id.', NOW())');
     
    114114}
    115115
    116 if(array_key_exists('ExportId', $_GET)) {
     116if (array_key_exists('ExportId', $_GET)) {
    117117  $Export = new Export($System);
    118118  $Export->Id = $_GET['ExportId'];
  • trunk/Modules/Forum/Forum.php

    r854 r880  
    2121      'Permission' => LICENCE_ANONYMOUS));
    2222
    23     if(array_key_exists('Search', $this->System->ModuleManager->Modules))
     23    if (array_key_exists('Search', $this->System->ModuleManager->Modules))
    2424      $this->System->ModuleManager->Modules['Search']->RegisterSearch('forum',
    2525      T('Forum'), array('UserName', 'Text'), '`ForumText`', $this->System->Link('/forum/?search='));
    26     if(array_key_exists('Search', $this->System->ModuleManager->Modules))
     26    if (array_key_exists('Search', $this->System->ModuleManager->Modules))
    2727      $this->System->ModuleManager->Modules['Search']->RegisterSearch('forumthread',
    2828      T('Name of thread forum'), array('UserName', 'Text'), '`ForumThread`',
     
    5353    $DbResult = $this->Database->query($Query);
    5454    $Output .= '<table class="MiniTable"><tr><th>'.T('Date').'</th><th>'.T('User').'</th><th>'.T('Post').'</th></tr>';
    55     while($DbRow = $DbResult->fetch_assoc())
     55    while ($DbRow = $DbResult->fetch_assoc())
    5656    {
    5757      $Output .= '<tr>'.
     
    6262    }
    6363    $Output .= '</table></div>';
    64     return($Output);
     64    return $Output;
    6565  }
    6666}
     
    7272    $Output = '';
    7373    $this->Title = T('Forum');
    74     if(array_key_exists('a', $_POST)) $Action = $_POST['a'];
    75       else if(array_key_exists('a', $_GET)) $Action = $_GET['a'];
     74    if (array_key_exists('a', $_POST)) $Action = $_POST['a'];
     75      else if (array_key_exists('a', $_GET)) $Action = $_GET['a'];
    7676       else $Action = '';
    7777    if (array_key_exists('Edit', $_GET)) {
     
    8686    if (array_key_exists('Thread', $_GET)) {
    8787      $Output .= '<h3>'.T('Forum - Thread').'</h3>';
    88       if($Action == 'add2') $Output .= $this->AddFinish();
    89       if($this->System->User->Licence(LICENCE_USER)) $Output .= $this->ShowAddForm();
     88      if ($Action == 'add2') $Output .= $this->AddFinish();
     89      if ($this->System->User->Licence(LICENCE_USER)) $Output .= $this->ShowAddForm();
    9090      $Output .= $this->ShowList();
    9191    } else {
    9292      $Output .= '<h3>'.T('Forum - List of Thread').'</h3>';
    93       if($Action == 'add2') $Output .= $this->AddFinish('ForumThread');
    94       if($this->System->User->Licence(LICENCE_USER)) $Output .= $this->ShowAddFormThread();
     93      if ($Action == 'add2') $Output .= $this->AddFinish('ForumThread');
     94      if ($this->System->User->Licence(LICENCE_USER)) $Output .= $this->ShowAddFormThread();
    9595      $Output .= $this->ShowListThread();
    9696    }
    97     return($Output);
     97    return $Output;
    9898  }
    9999
     
    104104    $DbResult = $this->System->Database->query('UPDATE `ForumText` SET `Text`="'.$_POST['text'].'" WHERE `User` = '.$this->System->User->Id.' AND `ID` = '.$_GET['Edit']);
    105105    $Output .= ShowMessage(T('Text edited.'));
    106     return ($Output);
     106    return $Output;
    107107  }
    108108
     
    110110  {
    111111    $Output = '';
    112     if($this->System->User->Licence(LICENCE_USER))
     112    if ($this->System->User->Licence(LICENCE_USER))
    113113    {
    114114      $DbResult = $this->System->Database->query('SELECT * FROM `ForumText`  WHERE `User` = '.$this->System->User->Id.' AND `ID` = '.$_GET['Edit']);
     
    118118            '<fieldset><legend>'.T('Edit message').'</legend>'.
    119119            T('User').': ';
    120         if($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />';
     120        if ($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />';
    121121          else $Output .= '<input type="text" name="user" /><br />';
    122122        $Output .= T('Message text').': ('.T('You can use').' <a href="http://www.bbcode.org/reference.php">'.T('BB code').'</a>)<br/>'.
     
    127127      } else $Output .= ShowMessage(T('You have to be registered for adding message.'), MESSAGE_CRITICAL);
    128128    }   else $Output .= ShowMessage(T('You can edit only your own message.'), MESSAGE_CRITICAL);
    129     return($Output);
     129    return $Output;
    130130  }
    131131
     
    150150    $DbResult = $this->System->Database->query('SELECT `ForumText`.`Text`, `ForumText`.`Date`, `ForumText`.`UserName`,'.
    151151    '`ForumThread`.`Text` as `ThreadName`,`ForumText`.`Thread` FROM `ForumText` '.$join.' WHERE '.$where.' ORDER BY `ForumText`.`Date` DESC '.$PageList['SQLLimit']);
    152     while($Line = $DbResult->fetch_assoc())
     152    while ($Line = $DbResult->fetch_assoc())
    153153      $Output .= '<div><a href="'.$this->System->Link('/forum/?Thread='.$Line['Thread']).'">'.
    154154      htmlspecialchars($Line['ThreadName']).'</a><br /><strong>'.$Line['UserName'].
    155155      '</strong> ('.HumanDate($Line['Date']).'): '.$parser->qparse(htmlspecialchars($Line['Text'])).'</div> ';
    156156    $Output .= '</div>'.$PageList['Output'];
    157     return($Output);
     157    return $Output;
    158158  }
    159159
     
    169169    $Output .= '<div class="shoutbox">';
    170170    $DbResult = $this->System->Database->query('SELECT * FROM `ForumThread` WHERE 1 ORDER BY `ID` DESC '.$PageList['SQLLimit']);
    171     while($Line = $DbResult->fetch_assoc())
     171    while ($Line = $DbResult->fetch_assoc())
    172172      $Output .= '<div><span style="float:right;"><strong>'.$Line['UserName'].
    173173    '</strong> - ('.HumanDate($Line['Date']).')</span> <a href="?Thread='.$Line['ID'].'">'.
    174174    str_replace("\n", '', htmlspecialchars($Line['Text'])).'</a></div>';
    175175    $Output .= '</div>'.$PageList['Output'];
    176     return($Output);
     176    return $Output;
    177177  }
    178178
     
    183183    $parser = new HTML_BBCodeParser2(array('filters' => array('Basic','Extended','Images','Links','Lists','Email')));
    184184
    185     if(array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search'];
    186     else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = '';
    187     if(array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = '';
    188     if($_SESSION['search'] != '')
     185    if (array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search'];
     186    else if (!array_key_exists('search', $_SESSION)) $_SESSION['search'] = '';
     187    if (array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = '';
     188    if ($_SESSION['search'] != '')
    189189    {
    190190      $SearchQuery = ' AND (`Text` LIKE "%'.$_SESSION['search'].'%")';
     
    193193
    194194    $DbResult = $this->System->Database->query('SELECT * FROM `ForumThread` WHERE ID='.($_GET['Thread']*1).' LIMIT 1');
    195     if($DbResult->num_rows > 0)
     195    if ($DbResult->num_rows > 0)
    196196    {
    197197    $Thread = $DbResult->fetch_assoc();
     
    206206    $DbResult = $this->System->Database->query('SELECT * FROM `ForumText` WHERE `Thread` = '.
    207207      ($_GET['Thread']*1).' '.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']);
    208     while($Line = $DbResult->fetch_assoc()) {
     208    while ($Line = $DbResult->fetch_assoc()) {
    209209      if ($this->System->User->Id == $Line['User'])
    210210        $edit = '<a href="?Edit='.$Line['ID'].'">'.T('edit').'</a>';
     
    216216    $Output .= '</div>'.$PageList['Output'];
    217217    } else $Output .= ShowMessage(T('Item not found'), MESSAGE_CRITICAL);
    218     return($Output);
     218    return $Output;
    219219  }
    220220
     
    222222  {
    223223    $Output = '';
    224     if($this->System->User->Licence(LICENCE_USER))
     224    if ($this->System->User->Licence(LICENCE_USER))
    225225    {
    226226      $Output .= '<form action="?Thread='.$_GET['Thread'].'" method="post">'.
    227227        '<fieldset><legend>'.T('New Forum Message').'</legend>'.
    228228        T('User').': ';
    229       if($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />';
     229      if ($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />';
    230230        else $Output .= '<input type="text" name="user" /><br />';
    231231      $Output .= T('Message text').': ('.T('You can use').' <a href="http://www.bbcode.org/reference.php">'.T('BB code').'</a>)<br/>'.
     
    235235        '</form>';
    236236    } else $Output .= ShowMessage(T('You have to be registered for adding message.'), MESSAGE_CRITICAL);
    237     return($Output);
     237    return $Output;
    238238  }
    239239
     
    241241  {
    242242    $Output = '';
    243     if($this->System->User->Licence(LICENCE_USER))
     243    if ($this->System->User->Licence(LICENCE_USER))
    244244    {
    245245        $Output .= '<form action="?" method="post">'.
    246246            '<fieldset><legend>'.T('New thread').'</legend>'.
    247247            T('User').': ';
    248         if($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />';
     248        if ($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />';
    249249        else $Output .= '<input type="text" name="user" /><br />';
    250250      $Output .= T('Name of thread').': <br />'.
     
    254254      '</form>';
    255255    } else $Output .= ShowMessage(T('You have to be registered for adding message.'), MESSAGE_CRITICAL);
    256     return($Output);
     256    return $Output;
    257257  }
    258258
     
    260260  {
    261261    $Output = '';
    262     if($this->System->User->Licence(LICENCE_USER))
    263     {
    264       if(array_key_exists('text', $_POST))
     262    if ($this->System->User->Licence(LICENCE_USER))
     263    {
     264      if (array_key_exists('text', $_POST))
    265265      {
    266266        $Text = $_POST['text'];
    267         if(trim($Text) == '') $Output .= ShowMessage('Nelze vložit prázdnou zprávu.', MESSAGE_WARNING);
     267        if (trim($Text) == '') $Output .= ShowMessage('Nelze vložit prázdnou zprávu.', MESSAGE_WARNING);
    268268        else
    269269        {
     
    273273          $DbResult = $this->System->Database->query('SELECT `Text` FROM `'.$Table.'` WHERE 1 '.$Thread.' AND (`User` = "'.
    274274              $this->System->User->Id.'") ORDER BY `Date` DESC LIMIT 1');
    275           if($DbResult->num_rows > 0)
     275          if ($DbResult->num_rows > 0)
    276276          {
    277277            $DbRow = $DbResult->fetch_assoc();
    278278          } else $DbRow['Text'] = '';
    279279
    280           if($DbRow['Text'] == $Text) $Output .= ShowMessage(T('You can\' add same message twice.'), MESSAGE_WARNING);
     280          if ($DbRow['Text'] == $Text) $Output .= ShowMessage(T('You can\' add same message twice.'), MESSAGE_WARNING);
    281281          else
    282282          {
     
    284284
    285285              $DbResult = $this->System->Database->query('SELECT * FROM `ForumThread` WHERE ID='.($_GET['Thread']*1).' LIMIT 1');
    286               if($DbResult->num_rows > 0)
     286              if ($DbResult->num_rows > 0)
    287287              {
    288288                $this->System->Database->query('INSERT INTO `'.$Table.'` ( `User`, `UserName` , `Text` , `Date` , `IP` , `Thread` ) '.
     
    300300      $Output .= '<br/>';
    301301    } else $Output .= ShowMessage(T('You have to be registered for adding message.'), MESSAGE_CRITICAL);
    302     return($Output);
     302    return $Output;
    303303  }
    304304
     
    313313      '`User`, `UserName`, `Text`, ( SELECT `Text` FROM `ForumThread` '.
    314314      'WHERE `ID` = `ForumText`.`Thread`) AS `ThreadText` FROM `ForumText` ORDER BY `ID` DESC LIMIT 20');
    315     while($DbRow = $DbResult->fetch_assoc())
     315    while ($DbRow = $DbResult->fetch_assoc())
    316316    {
    317317      $Title = mb_substr($DbRow['Text'], 0, $TitleLength);
    318       if(mb_strlen($Title) == $TitleLength) $Title .= '...';
     318      if (mb_strlen($Title) == $TitleLength) $Title .= '...';
    319319      $Items[] = array
    320320      (
     
    333333      'Items' => $Items,
    334334    ));
    335     return($Output);
     335    return $Output;
    336336  }
    337337}
  • trunk/Modules/FrontPage/FrontPage.php

    r854 r880  
    3131    global $Message, $MessageType;
    3232
    33     if(array_key_exists('action', $_GET))
     33    if (array_key_exists('action', $_GET))
    3434    {
    35       if($_GET['action'] == 'login')
     35      if ($_GET['action'] == 'login')
    3636      {
    37         if(array_key_exists('LoginUser', $_POST) and array_key_exists('LoginPass', $_POST))
     37        if (array_key_exists('LoginUser', $_POST) and array_key_exists('LoginPass', $_POST))
    3838        {
    39           if(array_key_exists('StayLogged', $_POST)) $StayLogged = true;
     39          if (array_key_exists('StayLogged', $_POST)) $StayLogged = true;
    4040            else $StayLogged = false;
    4141          $this->System->User->Login($_POST['LoginUser'], $_POST['LoginPass'], $StayLogged);
    42           if($this->System->User->Role == LICENCE_ANONYMOUS)
     42          if ($this->System->User->Role == LICENCE_ANONYMOUS)
    4343          {
    4444            $Message = T('Incorrect name or password');
     
    5555        }
    5656      } else
    57         if($_GET['action'] == 'logout')
     57        if ($_GET['action'] == 'logout')
    5858        {
    59           if($this->System->User->Role != LICENCE_ANONYMOUS)
     59          if ($this->System->User->Role != LICENCE_ANONYMOUS)
    6060          {
    6161            $this->System->ModuleManager->Modules['Log']->WriteLog('Odhlášení', LOG_TYPE_USER);
     
    7878    $this->System->ModuleManager->Modules['FrontPage']->HandleLoginForm();
    7979    $Output = '';
    80     if(isset($Message)) $Output .= ShowMessage($Message, $MessageType);
     80    if (isset($Message)) $Output .= ShowMessage($Message, $MessageType);
    8181
    8282    $Output .= ''.
     
    9090      '<div class="box-left">'.$this->System->ModuleManager->Modules['Forum']->ShowBox().'</div>'.
    9191      '<div class="box-right">'.$this->System->ModuleManager->Modules['Translation']->ShowBox().'</div>';
    92      return($Output);
     92     return $Output;
    9393  }
    9494
     
    9696  {
    9797    // Cookies have to be used before any text is sent to output
    98     if(!array_key_exists('HideWelcome', $_COOKIE)) $_COOKIE['HideWelcome'] = 0;
    99     if(isset($_GET['Action']))
     98    if (!array_key_exists('HideWelcome', $_COOKIE)) $_COOKIE['HideWelcome'] = 0;
     99    if (isset($_GET['Action']))
    100100    {
    101       if($_GET['Action'] == 'HideWelcome')
     101      if ($_GET['Action'] == 'HideWelcome')
    102102      {
    103103        $_COOKIE['HideWelcome'] = 1;
    104104        setcookie('HideWelcome', $_COOKIE['HideWelcome'], time() + 3600 * 24 * 365);
    105105      }
    106       if($_GET['Action'] == 'UnHideWelcome')
     106      if ($_GET['Action'] == 'UnHideWelcome')
    107107      {
    108108        $_COOKIE['HideWelcome'] = 0;
     
    111111    }
    112112
    113     if(isset($_COOKIE['HideWelcome']) and ($_COOKIE['HideWelcome'] == 1))
     113    if (isset($_COOKIE['HideWelcome']) and ($_COOKIE['HideWelcome'] == 1))
    114114    {
    115115      $Action = '<a href="?Action=UnHideWelcome">'.T('Show welcome').'</a>';
     
    122122
    123123    // Echo text even if it is hidden because of caching by external searching engines
    124     return('<div style="'.$HideWelcome.'">'.
     124    return '<div style="'.$HideWelcome.'">'.
    125125      '<div id="bannertitle">'.$this->System->Config['Web']['Title'].'</div>'.
    126126      T('Open web system for translation texts from game World of Warcraft (WoW).<br/>'.
     
    133133      '<li>Thanks for sophisticated system of selectable exports you can download any part of translation, even just quests. And so exclude translation of items, creatures and others.</li>'.
    134134      '<li>Texts can be translated to multiple languages, e.g. Czech and Slovak.</li>'.
    135       '</ul>').'</div>'.$Action);
     135      '</ul>').'</div>'.$Action;
    136136  }
    137137}
  • trunk/Modules/Import/Import.php

    r859 r880  
    4949    $Columns = '';
    5050    //$Values = '';
    51     foreach($this->Group['Items'] as $GroupItem)
     51    foreach ($this->Group['Items'] as $GroupItem)
    5252    {
    5353      $Columns .= ', `'.$GroupItem['Column'].'` ';
     
    6161    $DbResultAfter  = $this->System->Database->query('SELECT `VersionEnd`,`VersionStart`, `ID`, `Entry`, '.$Columns.' FROM `'.$this->Group['TablePrefix'].'` WHERE '.$Where.' AND `VersionStart` >= '.$this->Version['BuildNumber'].' ORDER BY `VersionStart` LIMIT 1');
    6262
    63     if(($DbResultMiddle->num_rows > 0) or ($DbResultBefore->num_rows > 0) or ($DbResultAfter->num_rows > 0))
     63    if (($DbResultMiddle->num_rows > 0) or ($DbResultBefore->num_rows > 0) or ($DbResultAfter->num_rows > 0))
    6464    {
    6565      // Update existed text
     
    6868      $DbRowBefore = $DbResultBefore->fetch_assoc();
    6969
    70       if($this->HaveSameText($this->Group, $DbRowBefore, $Value) and ($DbResultBefore->num_rows > 0) )
     70      if ($this->HaveSameText($this->Group, $DbRowBefore, $Value) and ($DbResultBefore->num_rows > 0) )
    7171      {
    7272          $insert = false;
     
    7878
    7979      } else
    80       if($this->HaveSameText($this->Group, $DbRowAfter, $Value) and ($DbResultAfter->num_rows > 0))
     80      if ($this->HaveSameText($this->Group, $DbRowAfter, $Value) and ($DbResultAfter->num_rows > 0))
    8181      {
    8282          $insert = false;
     
    104104
    105105            //if [DEPRECATED] do not import
    106         foreach($this->Group['Items'] as $GroupItem) {
     106        foreach ($this->Group['Items'] as $GroupItem) {
    107107          if (false !== strpos($Value[$GroupItem['Column']],'[DEPRECATED')) {
    108108            echo('d '.$DbRowBefore['Entry'].' ');
     
    113113        if ($insert) {
    114114          $insert = false;
    115           foreach($this->Group['Items'] as $GroupItem)
     115          foreach ($this->Group['Items'] as $GroupItem)
    116116          {
    117117            if ($Value[$GroupItem['Column']] <> '') $insert = true;
     
    128128          $Columns = '`Entry`, `Language`, `VersionStart`, `VersionEnd`';
    129129          $Values = $Value['Entry'].', 0, '.$this->Version['BuildNumber'].', '.$this->Version['BuildNumber'];
    130           foreach($this->Group['Items'] as $GroupItem)
     130          foreach ($this->Group['Items'] as $GroupItem)
    131131          {
    132132            $Columns .= ', `'.$GroupItem['Column'].'`';
     
    150150    {
    151151      // Insert new text
    152       if(is_numeric($Value[$this->Group['PrimaryKeyItem']])) $Value['Entry'] = $Value[$this->Group['PrimaryKeyItem']];
     152      if (is_numeric($Value[$this->Group['PrimaryKeyItem']])) $Value['Entry'] = $Value[$this->Group['PrimaryKeyItem']];
    153153      else
    154154      {
     
    156156        $Value['Entry'] = 1;
    157157        $DbResult = $this->System->Database->query('SELECT MAX(`Entry`) FROM `'.$this->Group['TablePrefix'].'`');
    158         if($DbResult->num_rows > 0)
     158        if ($DbResult->num_rows > 0)
    159159        {
    160160          $DbRow = $DbResult->fetch_row();
     
    165165      $Values = $Value['Entry'].', 0, '.$this->Version['BuildNumber'].', '.$this->Version['BuildNumber'];
    166166      $insert = false;
    167       foreach($this->Group['Items'] as $GroupItem)
     167      foreach ($this->Group['Items'] as $GroupItem)
    168168      {
    169169        $Columns .= ', `'.$GroupItem['Column'].'`';
     
    188188    $Output = 'Načítání textů z LUA souboru...';
    189189
    190     if(($this->Group['LuaFileName'] != '') and ($this->Group['TablePrefix'] != ''))
     190    if (($this->Group['LuaFileName'] != '') and ($this->Group['TablePrefix'] != ''))
    191191    {
    192192
    193193        $Output .= '<br />'.$this->Group['Name'].'<br />';
    194       //  if($this->Group['LastVersion'] < $this->Version['BuildNumber'] + 1)
     194      //  if ($this->Group['LastVersion'] < $this->Version['BuildNumber'] + 1)
    195195        {
    196196          $File = new FileStream();
     
    199199          $this->NewItemCount = 0;
    200200          $Count = 0;
    201           while(!$File->EOF())
     201          while (!$File->EOF())
    202202          {
    203203            $Line = $File->ReadLine();
    204             if(strpos($Line, '=') !== false)
     204            if (strpos($Line, '=') !== false)
    205205            {
    206206              $LineParts = explode('=', $Line, 2);
    207207              $Value['ShortCut'] = trim($LineParts[0]);
    208208              $Line = trim($LineParts[1]);
    209               if($Line[0] == '"')
     209              if ($Line[0] == '"')
    210210              {
    211211                // Quoted string value
     
    234234      } else $Output .= ShowMessage('Není definováno jméno zdrojového souboru', MESSAGE_CRITICAL);
    235235    $Output .= ShowMessage('Dokončeno.');
    236     return ($Output);
     236    return $Output;
    237237  }
    238238
     
    243243    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    244244    $Output = '<br /><br />Začínám se synchronizací VersionEnd u přeložených textů<br />';
    245     foreach($TranslationTree as $Group)
     245    foreach ($TranslationTree as $Group)
    246246    {
    247247      $Output .= '<br />'.$Group['Name'].' ';
    248248      $do = true;
    249       while($do)
     249      while ($do)
    250250      {
    251251      $DbResult = $this->System->Database->query('SELECT `gs_tran`.`ID`, '.
     
    258258        '`gs_tran`.`VersionEnd` <> `gs_orig`.`VersionEnd` OR `gs_tran`.`VersionStart` <> `gs_orig`.`VersionStart`');
    259259        $do = ($DbResult->num_rows > 0);
    260         while($DbRow = $DbResult->fetch_assoc())
     260        while ($DbRow = $DbResult->fetch_assoc())
    261261        {
    262262          echo('`');
     
    267267      $Output .= '<strong>Dokončeno.</strong>';
    268268    }
    269     return($Output);
     269    return $Output;
    270270  }
    271271
     
    273273  {
    274274    $result = true;
    275     foreach($Group['Items'] as $GroupItem)
     275    foreach ($Group['Items'] as $GroupItem)
    276276    {
    277277      $old = $DbRow2[$GroupItem['Column']];
     
    324324        }
    325325
    326       if(($old == 'null') or ($old == 'NULL')) $old = '';
    327       if(($new == 'null') or ($new == 'NULL')) $new = '';
    328 
    329       if(($new <> '') and ($old <> $new) and ($GroupItem['Column'] <> 'Comment'))
     326      if (($old == 'null') or ($old == 'NULL')) $old = '';
     327      if (($new == 'null') or ($new == 'NULL')) $new = '';
     328
     329      if (($new <> '') and ($old <> $new) and ($GroupItem['Column'] <> 'Comment'))
    330330      {
    331331        //  echo $old.'X'.$new;
     
    339339    }
    340340
    341     return($result);
     341    return $result;
    342342  }
    343343
     
    348348    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    349349    $Output = 'Načítání textů z DBC souboru...';
    350     if(($this->Group['DBCFileName'] != '') and ($this->Group['TablePrefix'] != ''))
     350    if (($this->Group['DBCFileName'] != '') and ($this->Group['TablePrefix'] != ''))
    351351    {
    352352      $Output .= '<br />'.$this->Group['Name'].'<br />';
     
    357357      $ColumnIndexes = array();
    358358      $ColumnFormat = array();
    359       while($DbRow = $DbResult->fetch_assoc())
     359      while ($DbRow = $DbResult->fetch_assoc())
    360360      {
    361361        $ColumnFormat[$DbRow['ColumnIndex']] = FORMAT_STRING;
     
    369369      $Count = 0;
    370370
    371       for($I = 0; $I < $ItemCount; $I++)
    372       {
    373         foreach($this->Group['Items'] as $GroupItem)
    374         if(array_key_exists($GroupItem['Id'], $ColumnIndexes))
     371      for ($I = 0; $I < $ItemCount; $I++)
     372      {
     373        foreach ($this->Group['Items'] as $GroupItem)
     374        if (array_key_exists($GroupItem['Id'], $ColumnIndexes))
    375375        {
    376376          $Value[$GroupItem['Column']] = addslashes($DBCFile->GetString($I, $ColumnIndexes[$GroupItem['Id']]));
     
    380380        $Columns = explode(',', $this->Group['DBCIndex']);
    381381        $ColumnValue = '';
    382         foreach($Columns as $Column)
     382        foreach ($Columns as $Column)
    383383          $ColumnValue .= '_'.$DBCFile->GetUint($I, $Column);
    384384        $ColumnValue = substr($ColumnValue, 1);
     
    391391    }
    392392    $Output .= '<strong>Dokončeno.</strong>';
    393     return($Output);
     393    return $Output;
    394394  }
    395395
     
    400400    $this->Group = $TranslationTree[$GroupId];
    401401
    402     if($this->Group['SourceType'] == 'dbc') $Output = $this->ImportDBC();
    403     else if($this->Group['SourceType'] == 'sql') $Output = $this->ImportSQL();
    404     else if($this->Group['SourceType'] == 'lua') $Output = $this->ImportLUA();
     402    if ($this->Group['SourceType'] == 'dbc') $Output = $this->ImportDBC();
     403    else if ($this->Group['SourceType'] == 'sql') $Output = $this->ImportSQL();
     404    else if ($this->Group['SourceType'] == 'lua') $Output = $this->ImportLUA();
    405405    else $Output = ShowMessage('Neznámý typ zdroje pro import', MESSAGE_CRITICAL);
    406406    $Output .= $this->UpdateTranslated();
    407     return($Output);
     407    return $Output;
    408408  }
    409409
     
    420420    $folow_structure = false;
    421421    $i = 0;
    422     while((!$File->EOF()))
     422    while ((!$File->EOF()))
    423423    {
    424424      $Line = $File->ReadLine();
    425425      // Struktura
    426       if(strpos($Line, 'CREATE TABLE `'.$this->Group['MangosTable'].'`') !== false)
     426      if (strpos($Line, 'CREATE TABLE `'.$this->Group['MangosTable'].'`') !== false)
    427427      {
    428428        $Line = '';
     
    430430        $i = 0;
    431431      }
    432       if((strpos($Line, ';') !== false) and ($folow_structure == true))
     432      if ((strpos($Line, ';') !== false) and ($folow_structure == true))
    433433      {
    434434        $folow_structure = false;
     
    437437        //  echo ('<br /><br />');
    438438      }
    439       if(($folow_structure == true) and ($Line != ''))
     439      if (($folow_structure == true) and ($Line != ''))
    440440      {
    441441        $str = substr($Line, 0, strpos($Line, '`'));
    442442        $Line = substr($Line, strpos($Line, '`') + 1);
    443443        $Line = substr($Line, 0, strpos($Line, '`'));
    444         if(strlen($str) < 3) $structure[$i] = $Line;
     444        if (strlen($str) < 3) $structure[$i] = $Line;
    445445        $i++;
    446446      }
    447447
    448448      //data
    449       if((strpos($Line, 'INSERT INTO `'.$this->Group['MangosTable'].'`') !== false) and (isset($structure)))
     449      if ((strpos($Line, 'INSERT INTO `'.$this->Group['MangosTable'].'`') !== false) and (isset($structure)))
    450450      {
    451451        while ((strpos($Line, ');') === false) or ($File->EOF()))
     
    461461        $value_buff = '';
    462462        $Value = '';
    463         foreach($LineParts as $LinePart)
     463        foreach ($LineParts as $LinePart)
    464464        {
    465465
    466466          unset($Value, $value_buff);
    467           foreach($structure as $i => $column)
     467          foreach ($structure as $i => $column)
    468468          {
    469469            if (substr($LinePart, 0, 1) != "'")
     
    475475              $LinePart = substr($LinePart, 1);
    476476              $value_buff = substr($LinePart, 0, strpos($LinePart, "'"));
    477               while(substr($value_buff, strlen($value_buff) - 1, 1) == "\\")
     477              while (substr($value_buff, strlen($value_buff) - 1, 1) == "\\")
    478478              {
    479479                $str = substr($LinePart, strlen($value_buff));
     
    484484              $LinePart = substr($LinePart, strlen($value_buff) + 2);
    485485            }
    486             if(($value_buff != 'null') and ($value_buff != 'NULL'))
     486            if (($value_buff != 'null') and ($value_buff != 'NULL'))
    487487            {
    488488              $str = '';
    489               while(substr($value_buff, strlen($value_buff) - 1,1) == " ")
     489              while (substr($value_buff, strlen($value_buff) - 1,1) == " ")
    490490              {
    491491                $value_buff = substr($value_buff, 0, strlen($value_buff) - 1);
     
    493493              }
    494494              $str2 = '';
    495               while(substr($value_buff, 0, 1) == ' ')
     495              while (substr($value_buff, 0, 1) == ' ')
    496496              {
    497497                $value_buff = substr($value_buff, 1, strlen($value_buff) - 1);
     
    505505            //  echo ($column.'-"'.$Value[$column].'"<br>');
    506506          }
    507           foreach($this->Group['Items'] as $GroupItem)
     507          foreach ($this->Group['Items'] as $GroupItem)
    508508          {
    509             if($GroupItem['MangosColumn'] != '')
     509            if ($GroupItem['MangosColumn'] != '')
    510510              if (isset($Value[$GroupItem['MangosColumn']]))
    511511                $Value[$GroupItem['Column']] = $Value[$GroupItem['MangosColumn']];
     
    519519          $Columns = explode(',', $this->Group['MangosTableIndex']);
    520520          $ColumnValue = '';
    521           foreach($Columns as $Column)
     521          foreach ($Columns as $Column)
    522522            $ColumnValue .= '_'.$Value[$Column];
    523523          $ColumnValue = substr($ColumnValue, 1);
     
    530530    $Output = '<br />Celkem: '.$Count.'  Nových: '.$this->NewItemCount.'<br />';
    531531    $this->UpdateLastVersion();
    532     return($Output);
     532    return $Output;
    533533  }
    534534
  • trunk/Modules/Import/Manage.php

    r859 r880  
    1919    '<li>Po provedení importu je potřeba několikrát spustit skript na aktualizaci verze u překladu. Je potřeba ho provádět opakovaně dokud nezmizí tečky označující, že byly provedeny změny.</li>'.
    2020    '</ol>';
    21     return($Output);
     21    return $Output;
    2222  }
    2323
     
    2626    global $System;
    2727
    28     if(array_key_exists('id', $_GET))
     28    if (array_key_exists('id', $_GET))
    2929    {
    3030      $Output = '<div style="font-size: xx-small;">';
     
    3838      $Output .= '</div>';
    3939    } else $Output = ShowMessage('Nebylo zadáno id skupiny.', MESSAGE_CRITICAL);
    40     return($Output);
     40    return $Output;
    4141  }
    4242
     
    6868
    6969    $DbResult = $this->System->Database->query('SELECT * FROM `Group`'.$Order['SQL'].$PageList['SQLLimit']);
    70     while($Group = $DbResult->fetch_assoc())
     70    while ($Group = $DbResult->fetch_assoc())
    7171    {
    7272      $Output .= '<tr><td>'.T($Group['Name']).'</td>'.
    7373        '<td>'.$Group['SourceType'].'</td><td>';
    74       if($Group['MangosTable'] != '') $Output .= $Group['MangosTable'].'.sql ';
    75       if($Group['DBCFileName'] != '') $Output .= $Group['DBCFileName'].'.dbc ';
    76       if($Group['LuaFileName'] != '') $Output .= $Group['LuaFileName'].'.lua ';
     74      if ($Group['MangosTable'] != '') $Output .= $Group['MangosTable'].'.sql ';
     75      if ($Group['DBCFileName'] != '') $Output .= $Group['DBCFileName'].'.dbc ';
     76      if ($Group['LuaFileName'] != '') $Output .= $Group['LuaFileName'].'.lua ';
    7777      $Output .= '</td>'.
    7878        '<td><a title="Změny po posledním importu u vybrané překladové skupiny" href="../log/?group='.$Group['Id'].'&amp;type=11">'.HumanDate($Group['LastImport']).'</a></td>'.
     
    8282    }
    8383    $Output .= '</table>';
    84     return($Output);
     84    return $Output;
    8585  }
    8686
     
    9393    $Output .= $Import->UpdateTranslated();
    9494    $Output .= '</div>';
    95     return($Output);
     95    return $Output;
    9696  }
    9797
     
    100100    $this->Title = T('Import');
    101101    $Output = '';
    102     if($this->System->User->Licence(LICENCE_ADMIN))
     102    if ($this->System->User->Licence(LICENCE_ADMIN))
    103103    {
    104     if(array_key_exists('action', $_GET))
     104    if (array_key_exists('action', $_GET))
    105105    {
    106       if($_GET['action'] == 'instructions') $Output .= $this->ShowInstructions();
    107       else if($_GET['action'] == 'importgroup') $Output .= $this->ShowImportGroup();
    108       else if($_GET['action'] == 'update_translated') $Output .= $this->UpdateTranslated();
     106      if ($_GET['action'] == 'instructions') $Output .= $this->ShowInstructions();
     107      else if ($_GET['action'] == 'importgroup') $Output .= $this->ShowImportGroup();
     108      else if ($_GET['action'] == 'update_translated') $Output .= $this->UpdateTranslated();
    109109      else $Output .= $this->ShowMenu();
    110110    } else $Output .= $this->ShowMenu();
    111111    } else $Output .= ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    112     return($Output);
     112    return $Output;
    113113  }
    114114}
  • trunk/Modules/Import/cmd.php

    r859 r880  
    1313$Output = '';
    1414
    15 if(defined('STDIN') == false)
     15if (defined('STDIN') == false)
    1616{
    1717  $Output = T('Access denied');
     
    1919}
    2020
    21 foreach($_SERVER['argv'] as $parameter)
     21foreach ($_SERVER['argv'] as $parameter)
    2222{
    23   if(strpos($parameter, '=') !== false)
     23  if (strpos($parameter, '=') !== false)
    2424  {
    2525    $index = substr($parameter, 0, strpos($parameter, '='));
     
    3030}
    3131
    32 if(!array_key_exists('id', $_GET))
     32if (!array_key_exists('id', $_GET))
    3333{
    3434  $Output .= '
     
    4949  $Output .= '   version=<version> - nastaví verzi importu default: '.$System->Config['Web']['GameVersion'].'<br /><br />';
    5050      $Output .= '    <id_import_group>:';
    51     foreach($TranslationTree as $Group)
     51    foreach ($TranslationTree as $Group)
    5252    {
    5353      $Output .= '<br />    '.$Group['Id'].' ';
  • trunk/Modules/Import/generatecodeXML.php

    r815 r880  
    3030
    3131$files = scandir($verze);
    32 foreach($files as $file)
     32foreach ($files as $file)
    3333{
    3434  $end = substr($file, strlen($file) - 3);
    35   if($end == 'xml')
     35  if ($end == 'xml')
    3636  {
    3737    echo('<br />--'.$file.'<br /><br />');
  • trunk/Modules/Info/Info.php

    r864 r880  
    6969  '</ul><br />'.
    7070  '<br />';
    71   return($Output);
     71  return $Output;
    7272  }
    7373}
     
    9494'<iframe width="420" height="315" src="https://www.youtube.com/embed/6EhBFv59syk" frameborder="0" allowfullscreen></iframe><br/>'.
    9595'<img src="'.$this->System->Link('/images/promotion.bmp').'" width="800" alt="addon-obr">';
    96     return($Output);
     96    return $Output;
    9797  }
    9898}
  • trunk/Modules/Log/Log.php

    r861 r880  
    3333  function WriteLog($Text, $Type)
    3434  {
    35     if(isset($this->System->User) and !is_null($this->System->User->Id))
     35    if (isset($this->System->User) and !is_null($this->System->User->Id))
    3636      $UserId = $this->System->User->Id;
    3737      else $UserId = 'NULL';
     
    6060  global $System, $User;
    6161
    62   if(isset($User) and !is_null($User->Id)) $UserId = $User->Id;
     62  if (isset($User) and !is_null($User->Id)) $UserId = $User->Id;
    6363    else $UserId = 'NULL';
    6464  $Query = 'INSERT INTO `Log` ( `User` , `Type` , `Text` , `Date` , `IP`, `URL` ) '.
     
    7575    $Output = '';
    7676    $Items = array();
    77     if(array_key_exists('type', $_GET)) $Where = ' WHERE `Type` = "'.($_GET['type'] * 1).'"';
     77    if (array_key_exists('type', $_GET)) $Where = ' WHERE `Type` = "'.($_GET['type'] * 1).'"';
    7878      else $Where = '';
    7979    $sql = 'SELECT *, UNIX_TIMESTAMP(`Date`) AS `TimeCreate`, (SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `Log`.`User`) AS `UserName`, `Date` FROM `Log`'.
    8080      $Where.' ORDER BY `Date` DESC LIMIT 100';
    8181    $DbResult = $this->System->Database->query($sql);
    82     while($Line = $DbResult->fetch_assoc())
     82    while ($Line = $DbResult->fetch_assoc())
    8383    {
    8484      $DbResult2 = $this->System->Database->query('SELECT * FROM `LogType` WHERE `Id`='.$Line['Type']);
    8585      $LogType = $DbResult2->fetch_assoc();
    8686
    87       if($Line['Type'] == LOG_TYPE_ERROR) $Line['Text'] = htmlspecialchars($Line['Text']);
     87      if ($Line['Type'] == LOG_TYPE_ERROR) $Line['Text'] = htmlspecialchars($Line['Text']);
    8888      $Line['Text'] = str_replace("\n", '<br>', $Line['Text']);
    8989
     
    106106      'Items' => $Items,
    107107    ));
    108     return($Output);
     108    return $Output;
    109109  }
    110110
    111111  function Show()
    112112  {
    113     if(array_key_exists('a', $_POST)) $Action = $_POST['a'];
    114       else if(array_key_exists('a', $_GET)) $Action = $_GET['a'];
     113    if (array_key_exists('a', $_POST)) $Action = $_POST['a'];
     114      else if (array_key_exists('a', $_GET)) $Action = $_GET['a'];
    115115      else $Action = '';
    116     if($Action == 'delerrlog') $Output = $this->DeleteErrorLog();
     116    if ($Action == 'delerrlog') $Output = $this->DeleteErrorLog();
    117117    else $Output = $this->ShowList();
    118     return($Output);
     118    return $Output;
    119119  }
    120120
     
    125125    $this->Title = T('System log');
    126126    $Output = '';
    127     if(array_key_exists('type', $_GET)) $_SESSION['type'] = $_GET['type'] * 1;
    128     else if(!array_key_exists('type', $_SESSION)) $_SESSION['type'] = '';
    129 
    130     if(array_key_exists('group', $_GET)) $_SESSION['group'] = $_GET['group'];
    131 
    132     if($_SESSION['type'] != '') $WhereType = ' (`Type`='.$_SESSION['type'].')';
     127    if (array_key_exists('type', $_GET)) $_SESSION['type'] = $_GET['type'] * 1;
     128    else if (!array_key_exists('type', $_SESSION)) $_SESSION['type'] = '';
     129
     130    if (array_key_exists('group', $_GET)) $_SESSION['group'] = $_GET['group'];
     131
     132    if ($_SESSION['type'] != '') $WhereType = ' (`Type`='.$_SESSION['type'].')';
    133133      else $WhereType = '1=1';
    134134
     
    138138
    139139    // Show category filter
    140     if($this->System->User->Licence(LICENCE_MODERATOR))
     140    if ($this->System->User->Licence(LICENCE_MODERATOR))
    141141    {
    142142      $Output = '<strong>'.T('Filter').':</strong>';
    143143        $Item = '<a href="'.$this->System->Link('/log/?type=').'" title="Bez filtrování">'.T('All').'</a>';
    144       if($_SESSION['type'] == '') $Item = '<strong>'.$Item.'</strong>';
     144      if ($_SESSION['type'] == '') $Item = '<strong>'.$Item.'</strong>';
    145145      $Output .= ' '.$Item;
    146146      $DbResult = $this->System->Database->query('SELECT * FROM `LogType`');
    147       while($LogType = $DbResult->fetch_assoc())
     147      while ($LogType = $DbResult->fetch_assoc())
    148148      {
    149149        $Item = '<a href="'.$this->System->Link('/log/?type='.$LogType['Id']).'" style="color:'.
    150150          $LogType['Color'].'" title="'.$LogType['Name'].'">'.T($LogType['Name']).'</a>';
    151         if($_SESSION['type'] == $LogType['Id']) $Item = '<strong>'.$Item.'</strong>';
     151        if ($_SESSION['type'] == $LogType['Id']) $Item = '<strong>'.$Item.'</strong>';
    152152        $Output .= ' '.$Item;
    153153      }
     
    155155     $Output .= '<br /><br />';
    156156
    157     if(array_key_exists('type', $_SESSION)) $Where = ' WHERE '.$WhereType;
     157    if (array_key_exists('type', $_SESSION)) $Where = ' WHERE '.$WhereType;
    158158    else
    159159    {
    160       if(array_key_exists('group', $_SESSION)) $Where = ' WHERE `Text` LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"';
     160      if (array_key_exists('group', $_SESSION)) $Where = ' WHERE `Text` LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"';
    161161        else $Where = '';
    162162    }
    163     //if(($Where != '') and (array_key_exists('group', $_SESSION))) $Where .= ' AND text LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"';
     163    //if (($Where != '') and (array_key_exists('group', $_SESSION))) $Where .= ' AND text LIKE "%'.$TranslationTree[$_SESSION['group']]['Name'].'%"';
    164164
    165165    $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `Log` '.$Where);
     
    172172      array('Name' => 'Date', 'Title' => T('Time')),
    173173    );
    174     if($_SESSION['type'] == '') $TableColumns[] =
     174    if ($_SESSION['type'] == '') $TableColumns[] =
    175175      array('Name' => 'LogName', 'Title' => T('Type'));
    176176    $TableColumns = array_merge($TableColumns, array(
     
    187187      '(SELECT `User`.`Name` FROM `User` WHERE `User`.`ID` = `Log`.`User`) AS `UserName` FROM `Log` LEFT JOIN `LogType` ON `LogType`.`Id`=`Log`.`Type` '.$Where.$Order['SQL'].$PageList['SQLLimit'];
    188188    $DbResult = $this->System->Database->query($sql);
    189     while($Line = $DbResult->fetch_assoc())
    190     {
    191       if($Line['Type'] == LOG_TYPE_ERROR) $Line['Text'] = htmlspecialchars($Line['Text']);
     189    while ($Line = $DbResult->fetch_assoc())
     190    {
     191      if ($Line['Type'] == LOG_TYPE_ERROR) $Line['Text'] = htmlspecialchars($Line['Text']);
    192192      $Line['Text'] = str_replace("\n", '<br/>', $Line['Text']);
    193193      $Output .= '<tr><td>'.$Line['Date'].'</td>';
    194       if($_SESSION['type'] == '') $Output .= '<td>'.T($Line['LogName']).'</td>';
     194      if ($_SESSION['type'] == '') $Output .= '<td>'.T($Line['LogName']).'</td>';
    195195      $Output .= '<td><span style="color: '.$Line['LogColor'].'">'.$Line['Text'].'</span></td>'.
    196196      '<td><a href="'.$this->System->Link('/user/?user='.$Line['User']).'">'.$Line['UserName'].'</a></td>'.
     
    200200    $Output .= '</table>'.
    201201      $PageList['Output'];
    202       if($this->System->User->Licence(LICENCE_ADMIN))
     202      if ($this->System->User->Licence(LICENCE_ADMIN))
    203203      {
    204204        $Output .= '<div>'.T('Remove').': <a href="'.$this->System->Link('/log/?a=delerrlog&amp;type='.LOG_TYPE_ERROR).'">'.T('Error logs').'</a> '.
     
    207207    } else $Output .= ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    208208
    209     return($Output);
     209    return $Output;
    210210  }
    211211
    212212  function DeleteErrorLog()
    213213  {
    214     if($this->System->User->Licence(LICENCE_ADMIN) and
     214    if ($this->System->User->Licence(LICENCE_ADMIN) and
    215215    (($_GET['type'] == LOG_TYPE_ERROR) or ($_GET['type'] == LOG_TYPE_PAGE_NOT_FOUND)))
    216216    {
     
    223223      $Output = ShowMessage('Smazáno všech '.$DbRow[0].' záznamů z '.$LogType['Description'].'.');
    224224      $Output .= $this->ShowList();
    225       return($Output);
     225      return $Output;
    226226    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    227227  }
  • trunk/Modules/News/News.php

    r862 r880  
    3535    $DbResult = $this->Database->query('SELECT `News`.`Time`, `User`.`Name`, `News`.`Text`,`News`.`Title`, `News`.`Id` '.
    3636      ' FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT '.$Count);
    37     while($DbRow = $DbResult->fetch_assoc())
     37    while ($DbRow = $DbResult->fetch_assoc())
    3838    {
    3939      $Output .= '<h4><a href="'.$this->System->Link('/news/?a=item&amp;i='.$DbRow['Id']).'">'.$DbRow['Title'].'</a> ('.HumanDate($DbRow['Time']).')</h4>'.
     
    4141    }
    4242    $Output .= '</div></div>';
    43     return($Output);
     43    return $Output;
    4444  }
    4545
     
    4848    $this->RSSChannels[$Channel['Channel']] = $Channel;
    4949
    50     if(is_null($Pos)) $this->RSSChannelsPos[] = $Channel['Channel'];
     50    if (is_null($Pos)) $this->RSSChannelsPos[] = $Channel['Channel'];
    5151    else {
    5252      array_splice($this->RSSChannelsPos, $Pos, 0, $Channel['Channel']);
     
    5757  {
    5858    $Output = '';
    59     foreach($this->RSSChannels as $Channel)
     59    foreach ($this->RSSChannels as $Channel)
    6060    {
    61       if($this->System->User->Licence($Channel['Permission']))
     61      if ($this->System->User->Licence($Channel['Permission']))
    6262        $Output .= ' <link rel="alternate" title="'.$Channel['Title'].'" href="'.
    6363          $this->System->Link('/rss/?channel='.$Channel['Channel']).'" type="application/rss+xml" />';
    6464    }
    65     return($Output);
     65    return $Output;
    6666  }
    6767}
     
    7272  {
    7373    $this->Title = T('News');
    74     if(array_key_exists('a', $_POST)) $Action = $_POST['a'];
    75       else if(array_key_exists('a', $_GET)) $Action = $_GET['a'];
     74    if (array_key_exists('a', $_POST)) $Action = $_POST['a'];
     75      else if (array_key_exists('a', $_GET)) $Action = $_GET['a'];
    7676      else $Action = '';
    77     if($Action == 'add2') $Output = $this->SaveNew();
    78     else if($Action == 'add') $Output = $this->ShowAddForm();
    79     else if($Action == 'item') $Output = $this->ShowItem();
     77    if ($Action == 'add2') $Output = $this->SaveNew();
     78    else if ($Action == 'add') $Output = $this->ShowAddForm();
     79    else if ($Action == 'item') $Output = $this->ShowItem();
    8080    else $Output = $this->ShowList();
    81     return($Output);
     81    return $Output;
    8282  }
    8383
     
    8989
    9090    $Output = '<h3>'.T('News').'</h3>';
    91     if($this->System->User->Licence(LICENCE_ADMIN))
     91    if ($this->System->User->Licence(LICENCE_ADMIN))
    9292      $Output .= ' <a href="?a=add">'.T('Add').'</a>';
    9393    $Output .= $PageList['Output'];
     
    9595    $DbResult = $this->System->Database->query('SELECT `News`.`Time`, `News`.`Text`, `News`.`Title`, `News`.`Id`, '.
    9696        '`User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`Id`=`News`.`User` ORDER BY `News`.`Time` DESC '.$PageList['SQLLimit']);
    97     while($Line = $DbResult->fetch_assoc())
     97    while ($Line = $DbResult->fetch_assoc())
    9898    {
    9999      $Output .= '<h4><a href="?a=item&amp;i='.$Line['Id'].'">'.$Line['Title'].'</a> ('.HumanDate($Line['Time']).')</h4><div>'.$Line['Text'].' ('.$Line['User'].')</div>';
    100100    }
    101101    $Output .= '</div>'.$PageList['Output'];
    102     return($Output);
     102    return $Output;
    103103  }
    104104
    105105  function ShowItem()
    106106  {
    107     if(array_key_exists('i', $_GET))
     107    if (array_key_exists('i', $_GET))
    108108    {
    109109      $Output = '<h3>'.T('News').'</h3>';
    110110      $DbResult = $this->System->Database->query('SELECT `News`.`Time`, `News`.`Text`, `News`.`Title`, `News`.`Id`, '.
    111111        '`User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`Id`=`News`.`User` WHERE `News`.`Id` = '.($_GET['i'] * 1));
    112       if($DbResult->num_rows == 1)
     112      if ($DbResult->num_rows == 1)
    113113      {
    114114        $Line = $DbResult->fetch_assoc();
     
    117117    } else $Output = ShowMessage(T('Item not found'), MESSAGE_CRITICAL);
    118118    $Output .= '<br/><a href="'.$this->System->Link('/news/').'">'.T('All news').'</a>';
    119     return($Output);
     119    return $Output;
    120120  }
    121121
    122122  function ShowAddForm()
    123123  {
    124     if($this->System->User->Licence(LICENCE_ADMIN))
     124    if ($this->System->User->Licence(LICENCE_ADMIN))
    125125    {
    126126      $Output = '<form action="?" method="POST">'.
     
    134134    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    135135    $Output .= $this->ShowList();
    136     return($Output);
     136    return $Output;
    137137  }
    138138
    139139  function SaveNew()
    140140  {
    141     if($this->System->User->Licence(LICENCE_ADMIN))
     141    if ($this->System->User->Licence(LICENCE_ADMIN))
    142142    {
    143       if(array_key_exists('text', $_POST) and array_key_exists('title', $_POST))
     143      if (array_key_exists('text', $_POST) and array_key_exists('title', $_POST))
    144144      {
    145145        $querty = 'INSERT INTO `News` (`Title`, `Time` ,`User` ,`Text`) VALUES ( "'.$_POST['title'].'", NOW( ) , '.
     
    151151      } else $Output = ShowMessage(T('Data not specified'), MESSAGE_CRITICAL);
    152152    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    153     return($Output);
     153    return $Output;
    154154  }
    155155
     
    160160      '`News`.`Title`, `News`.`Time`, `User`.`Name`, `News`.`Text`, `News`.`Id` '.
    161161      'FROM `News` JOIN `User` ON `User`.`ID` = `News`.`User` ORDER BY `Time` DESC LIMIT 10');
    162     while($DbRow = $DbResult->fetch_assoc())
     162    while ($DbRow = $DbResult->fetch_assoc())
    163163    {
    164164     $Items[] = array
     
    178178      'Items' => $Items,
    179179    ));
    180     return($Output);
     180    return $Output;
    181181  }
    182182}
  • trunk/Modules/News/RSS.php

    r876 r880  
    1515      "    <pubDate>".date('r')."</pubDate>\n".
    1616      "    <ttl>20</ttl>\n";
    17   foreach($Data['Items'] as $Item)
     17  foreach ($Data['Items'] as $Item)
    1818  {
    1919    $Result .= "    <item>\n".
     
    2626  $Result .= "  </channel>\n".
    2727      "</rss>";
    28   return($Result);
     28  return $Result;
    2929}
    3030
     
    3535    $this->RawPage = true;
    3636
    37     if(array_key_exists('channel', $_GET)) $ChannelName = $_GET['channel'];
     37    if (array_key_exists('channel', $_GET)) $ChannelName = $_GET['channel'];
    3838      else $ChannelName = '';
    39     if(array_key_exists('token', $_GET)) $Token = $_GET['token'];
     39    if (array_key_exists('token', $_GET)) $Token = $_GET['token'];
    4040      else $Token = '';
    41     if(array_key_exists($ChannelName, $this->System->ModuleManager->Modules['News']->RSSChannels))
     41    if (array_key_exists($ChannelName, $this->System->ModuleManager->Modules['News']->RSSChannels))
    4242    {
    4343      $Channel = $this->System->ModuleManager->Modules['News']->RSSChannels[$ChannelName];
    44       if($this->System->User->Licence($Channel['Permission']) or
     44      if ($this->System->User->Licence($Channel['Permission']) or
    4545      $this->System->User->CheckToken($Channel['Permission'], $Token))
    4646      {
    47         if(is_string($Channel['Callback'][0]))
     47        if (is_string($Channel['Callback'][0]))
    4848        {
    4949          $Class = new $Channel['Callback'][0]($this->System);
     
    5353      } else $Output = T('Access denied');
    5454    } else $Output = 'Nezadán žádný kanál';
    55     return($Output);
     55    return $Output;
    5656  }
    5757}
  • trunk/Modules/Redirection/Redirection.php

    r861 r880  
    2424    Header($_SERVER['SERVER_PROTOCOL'].' 301 Moved Permanently');
    2525    Header('Location: '.$Location);
    26     return('<h3 align="center">'.T('').'</h3>');
     26    return '<h3 align="center">'.T('').'</h3>';
    2727  }
    2828
     
    3030  {
    3131    $Output = '';
    32     if(count($this->System->PathItems) > 0)
     32    if (count($this->System->PathItems) > 0)
    3333    {
    34       if($this->System->PathItems[0] == 'user.php') $Output = $this->Redirect($this->System->Link('/user/'));
    35       if($this->System->PathItems[0] == 'team.php') $Output = $this->Redirect($this->System->Link('/team/'));
    36       if($this->System->PathItems[0] == 'version.php') $Output = $this->Redirect($this->System->Link('/client-version/'));
    37       if($this->System->PathItems[0] == 'phpBB3') $Output = $this->Redirect($this->System->Link('/forum/'));
    38       if($this->System->PathItems[0] == 'phpbb3') $Output = $this->Redirect($this->System->Link('/forum/'));
    39       if($this->System->PathItems[0] == 'statistic.php') $Output = $this->Redirect($this->System->Link('/progress/'));
    40       if($this->System->PathItems[0] == 'register.php') $Output = $this->Redirect($this->System->Link('/registration/'));
    41       if($this->System->PathItems[0] == 'registrace.php') $Output = $this->Redirect($this->System->Link('/registration/'));
    42       if($this->System->PathItems[0] == 'dictionary.php') $Output = $this->Redirect($this->System->Link('/dictionary/'));
    43       if($this->System->PathItems[0] == 'download-addon.php') $Output = $this->Redirect($this->System->Link('/download/'));
    44       if($this->System->PathItems[0] == 'banners.php') $Output = $this->Redirect($this->System->Link('/referrer/'));
    45       if($this->System->PathItems[0] == 'download.php') $Output = $this->Redirect($this->System->Link('/download/'));
    46       if($this->System->PathItems[0] == 'serverlist.php') $Output = $this->Redirect($this->System->Link('/server/'));
    47       if($this->System->PathItems[0] == 'info.php') $Output = $this->Redirect($this->System->Link('/info/'));
    48       if($this->System->PathItems[0] == 'userlist.php') $Output = $this->Redirect($this->System->Link('/users/'));
    49       if($this->System->PathItems[0] == 'promotion.php') $Output = $this->Redirect($this->System->Link('/promotion/'));
    50       if($this->System->PathItems[0] == 'log.php') $Output = $this->Redirect($this->System->Link('/log/'));
    51       if(count($this->System->PathItems) > 1)
     34      if ($this->System->PathItems[0] == 'user.php') $Output = $this->Redirect($this->System->Link('/user/'));
     35      if ($this->System->PathItems[0] == 'team.php') $Output = $this->Redirect($this->System->Link('/team/'));
     36      if ($this->System->PathItems[0] == 'version.php') $Output = $this->Redirect($this->System->Link('/client-version/'));
     37      if ($this->System->PathItems[0] == 'phpBB3') $Output = $this->Redirect($this->System->Link('/forum/'));
     38      if ($this->System->PathItems[0] == 'phpbb3') $Output = $this->Redirect($this->System->Link('/forum/'));
     39      if ($this->System->PathItems[0] == 'statistic.php') $Output = $this->Redirect($this->System->Link('/progress/'));
     40      if ($this->System->PathItems[0] == 'register.php') $Output = $this->Redirect($this->System->Link('/registration/'));
     41      if ($this->System->PathItems[0] == 'registrace.php') $Output = $this->Redirect($this->System->Link('/registration/'));
     42      if ($this->System->PathItems[0] == 'dictionary.php') $Output = $this->Redirect($this->System->Link('/dictionary/'));
     43      if ($this->System->PathItems[0] == 'download-addon.php') $Output = $this->Redirect($this->System->Link('/download/'));
     44      if ($this->System->PathItems[0] == 'banners.php') $Output = $this->Redirect($this->System->Link('/referrer/'));
     45      if ($this->System->PathItems[0] == 'download.php') $Output = $this->Redirect($this->System->Link('/download/'));
     46      if ($this->System->PathItems[0] == 'serverlist.php') $Output = $this->Redirect($this->System->Link('/server/'));
     47      if ($this->System->PathItems[0] == 'info.php') $Output = $this->Redirect($this->System->Link('/info/'));
     48      if ($this->System->PathItems[0] == 'userlist.php') $Output = $this->Redirect($this->System->Link('/users/'));
     49      if ($this->System->PathItems[0] == 'promotion.php') $Output = $this->Redirect($this->System->Link('/promotion/'));
     50      if ($this->System->PathItems[0] == 'log.php') $Output = $this->Redirect($this->System->Link('/log/'));
     51      if (count($this->System->PathItems) > 1)
    5252      {
    53         if(($this->System->PathItems[0] == 'team') and ($this->System->PathItems[1] == 'userlist.php'))
     53        if (($this->System->PathItems[0] == 'team') and ($this->System->PathItems[1] == 'userlist.php'))
    5454          $Output = $this->Redirect($this->System->Link('/userlist/'));
    55         if(($this->System->PathItems[0] == 'dictionary') and ($this->System->PathItems[1] == 'user.php'))
     55        if (($this->System->PathItems[0] == 'dictionary') and ($this->System->PathItems[1] == 'user.php'))
    5656          $Output = $this->Redirect($this->System->Link('/user/'));
    57         if(($this->System->PathItems[0] == 'forum') and ($this->System->PathItems[1] == 'index.php'))
     57        if (($this->System->PathItems[0] == 'forum') and ($this->System->PathItems[1] == 'index.php'))
    5858          $Output = $this->Redirect($this->System->Link('/forum/'));
    59         if(($this->System->PathItems[0] == 'phpbb3') and ($this->System->PathItems[1] == 'index.php'))
     59        if (($this->System->PathItems[0] == 'phpbb3') and ($this->System->PathItems[1] == 'index.php'))
    6060          $Output = $this->Redirect($this->System->Link('/forum/'));
    61         if(($this->System->PathItems[0] == 'phpBB3') and ($this->System->PathItems[1] == 'index.php'))
     61        if (($this->System->PathItems[0] == 'phpBB3') and ($this->System->PathItems[1] == 'index.php'))
    6262          $Output = $this->Redirect($this->System->Link('/forum/'));
    63         if(($this->System->PathItems[0] == 'download') and ($this->System->PathItems[1] == 'ceske_fonty_do_wow.zip'))
     63        if (($this->System->PathItems[0] == 'download') and ($this->System->PathItems[1] == 'ceske_fonty_do_wow.zip'))
    6464          $Output = $this->Redirect($this->System->Link('/files/ceske_fonty_do_wow.zip'));
    6565      }
    6666    }
    67     return($Output);
     67    return $Output;
    6868  }
    6969}
  • trunk/Modules/Referrer/Referrer.php

    r860 r880  
    3434  function Log()
    3535  {
    36     if(array_key_exists('HTTP_REFERER', $_SERVER))
     36    if (array_key_exists('HTTP_REFERER', $_SERVER))
    3737    {
    3838      $Referrer = addslashes($_SERVER['HTTP_REFERER']);
    3939      $HostName = substr($Referrer, strpos($Referrer, '/') + 2);
    4040      $HostName = substr($HostName, 0, strpos($HostName, '/'));
    41       if(!in_array($HostName, $this->Excludes))
     41      if (!in_array($HostName, $this->Excludes))
    4242      {
    4343        $IP = GetRemoteAddress();
     
    4646        $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM `BlackList` WHERE `IP` = "'.$IP.'"');
    4747        $DbRow = $DbResult->fetch_row();
    48         if($DbRow[0] == 0)
     48        if ($DbRow[0] == 0)
    4949        {
    5050          $Visible = '1';
     
    5858        // Check if host name is already stored and need just to update hit counter
    5959        $DbResult = $this->System->Database->query('SELECT `Id` FROM `Referrer` WHERE `Web` = "'.$HostName.'"');
    60         if($DbResult->num_rows > 0)
     60        if ($DbResult->num_rows > 0)
    6161        {
    6262          $DbRow = $DbResult->fetch_assoc();
     
    9292    $Output .= $BannerSmall.' &nbsp;&nbsp;<textarea rows="2" cols="30">'.htmlspecialchars($BannerSmall).'</textarea><br />';
    9393
    94     if($this->System->User->Licence(LICENCE_ADMIN)) {
     94    if ($this->System->User->Licence(LICENCE_ADMIN)) {
    9595
    9696    $MonthAge = 3;
     
    9999    <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 />';
    100100
    101     if(!$this->System->User->Licence(LICENCE_ADMIN)) $Where = ' WHERE (`Visible`=1) AND (`Parent` IS NULL)';
     101    if (!$this->System->User->Licence(LICENCE_ADMIN)) $Where = ' WHERE (`Visible`=1) AND (`Parent` IS NULL)';
    102102    else $Where = '';
    103103    $Query = 'SELECT *, (SELECT Web FROM `Referrer` AS T4 WHERE T4.Id = T3.Parent) AS ParentName '.
     
    123123        array('Name' => 'TotalHits', 'Title' => T('Hits')),
    124124    );
    125     if($this->System->User->Licence(LICENCE_ADMIN))
     125    if ($this->System->User->Licence(LICENCE_ADMIN))
    126126    {
    127127      $TableColumns[] = array('Name' => 'Visible', 'Title' => T('Visible'));
     
    137137
    138138    $DbResult = $this->Database->query($Query);
    139     while($Line = $DbResult->fetch_assoc())
     139    while ($Line = $DbResult->fetch_assoc())
    140140    {
    141141      $Output .= '<tr><td><a href="'.$Line['LastURL'].'">'.$Line['Web'].'</a></td>'.
    142142          '<td>'.HumanDate($Line['MaxDateLast']).'</td>'.
    143143          '<td>'.$Line['TotalHits'].'</td>';
    144       if($this->System->User->Licence(LICENCE_ADMIN))
     144      if ($this->System->User->Licence(LICENCE_ADMIN))
    145145      {
    146146        $Output .=
     
    158158
    159159    }
    160     return($Output);
     160    return $Output;
    161161  }
    162162
     
    165165    $Output = '<select name="Parent">';
    166166    $Output .= '<option value=""';
    167     if($Selected == '')
     167    if ($Selected == '')
    168168      $Output .= ' selected="selected"';
    169169    $Output .= '></option>';
    170170    $DbResult = $this->Database->select('Referrer', '`Id`, `Web`', '`Parent` IS NULL ORDER BY `Web`');
    171     while($Language = $DbResult->fetch_assoc())
    172     if($Language['Id'] != $Self)
     171    while ($Language = $DbResult->fetch_assoc())
     172    if ($Language['Id'] != $Self)
    173173    {
    174174      $Output .= '<option value="'.$Language['Id'].'"';
    175       if($Selected == $Language['Id'])
     175      if ($Selected == $Language['Id'])
    176176        $Output .= ' selected="selected"';
    177177      $Output .= '>'.$Language['Web'].'</option>';
    178178    }
    179179    $Output .= '</select>';
    180     return($Output);
     180    return $Output;
    181181  }
    182182
    183183  function Spam()
    184184  {
    185     if($this->System->User->Licence(LICENCE_ADMIN))
    186     {
    187       if(array_key_exists('id', $_GET))
     185    if ($this->System->User->Licence(LICENCE_ADMIN))
     186    {
     187      if (array_key_exists('id', $_GET))
    188188      {
    189189        $DbResult = $this->Database->select('Referrer', '*', 'Id='.$_GET['id']);
    190         if($DbResult->num_rows > 0)
     190        if ($DbResult->num_rows > 0)
    191191        {
    192192          $Item = $DbResult->fetch_assoc();
    193193          $this->Database->update('Referrer', 'Id='.$_GET['id'], array('Visible' => 0, 'Description' => 'Spam'));
    194194          $DbResult2 = $this->Database->select('BlackList', '*', 'IP="'.$Item['LastIP'].'"');
    195           if($DbResult2->num_rows == 0)
     195          if ($DbResult2->num_rows == 0)
    196196          {
    197197            $this->Database->insert('BlackList', array('Time' => 'NOW()', 'IP' => $Item['LastIP']));
     
    202202      } else $Output = ShowMessage(T('Item not specified'), MESSAGE_CRITICAL);
    203203    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    204     return($Output);
     204    return $Output;
    205205  }
    206206
    207207  function Edit()
    208208  {
    209     if($this->System->User->Licence(LICENCE_ADMIN))
    210     {
    211       if(array_key_exists('id', $_GET))
     209    if ($this->System->User->Licence(LICENCE_ADMIN))
     210    {
     211      if (array_key_exists('id', $_GET))
    212212      {
    213213        $DbResult = $this->Database->select('Referrer', '*', 'Id='.$_GET['id']);
    214         if($DbResult->num_rows > 0)
     214        if ($DbResult->num_rows > 0)
    215215        {
    216216          $Item = $DbResult->fetch_assoc();
    217           if($Item['Visible'] == 1) $Visible = ' checked ';
     217          if ($Item['Visible'] == 1) $Visible = ' checked ';
    218218            else $Visible = '';
    219219          $Output = '<form action="?action=editsave&amp;id='.$_GET['id'].'" method="post"><table>'.
     
    227227      } else $Output = ShowMessage(T('Item not specified'), MESSAGE_CRITICAL);
    228228    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    229     return($Output);
     229    return $Output;
    230230  }
    231231
    232232  function EditSave()
    233233  {
    234     if($this->System->User->Licence(LICENCE_ADMIN))
    235     {
    236       if($_POST['Parent'] == '') $_POST['Parent'] = null;
     234    if ($this->System->User->Licence(LICENCE_ADMIN))
     235    {
     236      if ($_POST['Parent'] == '') $_POST['Parent'] = null;
    237237      $_POST['Visible'] = array_key_exists('Visible', $_POST);
    238238      $DbResult = $this->Database->update('Referrer', 'Id='.$_GET['id'], array(
     
    243243      $Output .= $this->ShowList();
    244244    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    245     return($Output);
     245    return $Output;
    246246  }
    247247
     
    249249  {
    250250    $this->Title = T('Promotion');
    251     if(array_key_exists('action', $_GET))
    252     {
    253       if($_GET['action'] == 'edit') $Output = $this->Edit();
    254       else if($_GET['action'] == 'spam') $Output = $this->Spam();
    255       else if($_GET['action'] == 'editsave') $Output = $this->EditSave();
     251    if (array_key_exists('action', $_GET))
     252    {
     253      if ($_GET['action'] == 'edit') $Output = $this->Edit();
     254      else if ($_GET['action'] == 'spam') $Output = $this->Spam();
     255      else if ($_GET['action'] == 'editsave') $Output = $this->EditSave();
    256256      else $Output = $this->ShowList();
    257257    } else $Output = $this->ShowList();
    258     return($Output);
     258    return $Output;
    259259  }
    260260}
  • trunk/Modules/Search/Search.php

    r861 r880  
    4848      '</table></div>'.
    4949      '</form>';
    50     return($Output);
     50    return $Output;
    5151  }
    5252}
     
    5757  {
    5858    $this->Title = T('Search');
    59     if(array_key_exists('text', $_GET)) $Search = $_GET['text'];
    60     else if(array_key_exists('text', $_POST)) $Search = $_POST['text'];
     59    if (array_key_exists('text', $_GET)) $Search = $_GET['text'];
     60    else if (array_key_exists('text', $_POST)) $Search = $_POST['text'];
    6161    else $Search = '';
    6262    $SearchHTML = urlencode($Search);
    6363
    6464    $Output = '<table class="BaseTable"><tr><th>'.T('Section').'</th><th>'.T('Found count').'</th></tr>';
    65     foreach($this->System->ModuleManager->Modules['Search']->SearchItems as $SearchItem)
     65    foreach ($this->System->ModuleManager->Modules['Search']->SearchItems as $SearchItem)
    6666    {
    6767      $ColumnQuery = array();
    68       foreach($SearchItem['Columns'] as $Column)
     68      foreach ($SearchItem['Columns'] as $Column)
    6969      {
    7070        $ColumnQuery[] = '(`'.$Column.'` LIKE "%'.$Search.'%")';
    7171      }
    7272      $ColumnQuery = implode(' OR ', $ColumnQuery);
    73       if($SearchItem['Query'] != '')
     73      if ($SearchItem['Query'] != '')
    7474      {
    7575        $DbResult = $this->Database->query('SELECT COUNT(*) FROM '.$SearchItem['Query'].' WHERE '.$ColumnQuery);
     
    8282
    8383    $Output .= '</table>';
    84     return($Output);
     84    return $Output;
    8585  }
    8686}
  • trunk/Modules/Server/Server.php

    r838 r880  
    5757    $Output .= '<h3>'.T('Translated server list').'</h3>';
    5858    $Output .= parent::ViewList();
    59     return($Output);
     59    return $Output;
    6060  }
    6161}
  • trunk/Modules/ShoutBox/ShoutBox.php

    r857 r880  
    2020      'Title' => T('Shoutbox'), 'Channel' => 'shoutbox', 'Callback' => array('PageShoutBox', 'ShowRSS'),
    2121      'Permission' => LICENCE_ANONYMOUS));
    22     if(array_key_exists('Search', $this->System->ModuleManager->Modules))
     22    if (array_key_exists('Search', $this->System->ModuleManager->Modules))
    2323      $this->System->ModuleManager->Modules['Search']->RegisterSearch('shoutbox',
    2424      T('Shoutbox'), array('UserName', 'Text'), '`ShoutBox`', $this->System->Link('/shoutbox/?search='));
     
    2929    $Output = '<strong><a href="'.$this->System->Link('/shoutbox/').'">'.T('Shoutbox').':</a></strong>';
    3030
    31     if($this->System->User->Licence(LICENCE_USER))
     31    if ($this->System->User->Licence(LICENCE_USER))
    3232      $Output .= ' <a href="'.$this->System->Link('/shoutbox/?a=add').'">'.T('Add').'</a>';
    3333    $Output .= '<div class="box"><div class="shoutbox"><table>';
    3434    $DbResult = $this->Database->query('SELECT * FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 30');
    35     while($Line = $DbResult->fetch_assoc())
     35    while ($Line = $DbResult->fetch_assoc())
    3636      $Output .= '<tr><td><strong>'.$Line['UserName'].'</strong>: '.MakeActiveLinks($Line['Text']).'</td></tr>';
    3737    $Output .= '</table></div></div>';
    38     return($Output);
     38    return $Output;
    3939  }
    4040}
     
    4545  {
    4646    $this->Title = T('Shoutbox');
    47     if(array_key_exists('a', $_POST)) $Action = $_POST['a'];
    48       else if(array_key_exists('a', $_GET)) $Action = $_GET['a'];
     47    if (array_key_exists('a', $_POST)) $Action = $_POST['a'];
     48      else if (array_key_exists('a', $_GET)) $Action = $_GET['a'];
    4949      else $Action = '';
    50     if($Action == 'add2') $Output = $this->AddFinish();
    51     if($Action == 'add') $Output = $this->ShowAddForm();
     50    if ($Action == 'add2') $Output = $this->AddFinish();
     51    if ($Action == 'add') $Output = $this->ShowAddForm();
    5252    else $Output = $this->ShowList();
    53     return($Output);
     53    return $Output;
    5454  }
    5555
     
    5757  {
    5858    $Output = '';
    59     if(array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search'];
    60     else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = '';
    61     if(array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = '';
    62     if($_SESSION['search'] != '')
     59    if (array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search'];
     60    else if (!array_key_exists('search', $_SESSION)) $_SESSION['search'] = '';
     61    if (array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = '';
     62    if ($_SESSION['search'] != '')
    6363    {
    6464      $SearchQuery = ' AND (`Text` LIKE "%'.$_SESSION['search'].'%")';
     
    7171
    7272    $Output .= '<h3>'.T('Shoutbox').'</h3>';
    73     if($this->System->User->Licence(LICENCE_USER))
     73    if ($this->System->User->Licence(LICENCE_USER))
    7474      $Output .= ' <a href="'.$this->System->Link('/shoutbox/?a=add').'">'.T('Add').'</a>';
    7575    $Output .= $PageList['Output'];
    7676    $Output .= '<div class="shoutbox">';
    7777    $DbResult = $this->System->Database->query('SELECT * FROM `ShoutBox`  WHERE 1'.$SearchQuery.' ORDER BY `ID` DESC '.$PageList['SQLLimit']);
    78     while($Line = $DbResult->fetch_assoc())
     78    while ($Line = $DbResult->fetch_assoc())
    7979      $Output .= '<div><strong>'.$Line['UserName'].'</strong>: '.MakeActiveLinks($Line['Text']).'</div>';
    8080    $Output .= '</div>'.$PageList['Output'];
    81     return($Output);
     81    return $Output;
    8282  }
    8383
     
    8585  {
    8686    $Output = '';
    87     if($this->System->User->Licence(LICENCE_USER))
     87    if ($this->System->User->Licence(LICENCE_USER))
    8888    {
    8989        $Output .= '<form action="?" method="post">'.
    9090            '<fieldset><legend>'.T('New message').'</legend>'.
    9191            'Uživatel: ';
    92         if($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />';
     92        if ($this->System->User->Licence(LICENCE_USER)) $Output .= '<b>'.$this->System->User->Name.'</b><br />';
    9393        else $Output .= '<input type="text" name="user" /><br />';
    9494      $Output .= 'Text zprávy: <br/>'.
     
    9999    } else $Output .= ShowMessage('Pro vkládaní zpráv musíte byt registrováni.', MESSAGE_CRITICAL);
    100100    $Output .= $this->ShowList();
    101     return($Output);
     101    return $Output;
    102102  }
    103103
     
    105105  {
    106106    $Output = '';
    107     if($this->System->User->Licence(LICENCE_USER))
     107    if ($this->System->User->Licence(LICENCE_USER))
    108108    {
    109       if(array_key_exists('text', $_POST))
     109      if (array_key_exists('text', $_POST))
    110110      {
    111111        $Text = $_POST['text'];
    112         if(trim($Text) == '') $Output .= ShowMessage('Nelze vložit prázdnou zprávu.', MESSAGE_WARNING);
     112        if (trim($Text) == '') $Output .= ShowMessage('Nelze vložit prázdnou zprávu.', MESSAGE_WARNING);
    113113        else
    114114        {
     
    116116          $DbResult = $this->System->Database->query('SELECT `Text` FROM `ShoutBox` WHERE (`User` = "'.
    117117              $this->System->User->Id.'") ORDER BY `Date` DESC LIMIT 1');
    118           if($DbResult->num_rows > 0)
     118          if ($DbResult->num_rows > 0)
    119119          {
    120120            $DbRow = $DbResult->fetch_assoc();
    121121          } else $DbRow['Text'] = '';
    122122
    123           if($DbRow['Text'] == $Text) $Output .= ShowMessage('Nelze vložit stejnou zprávu vícekrát za sebou.', MESSAGE_WARNING);
     123          if ($DbRow['Text'] == $Text) $Output .= ShowMessage('Nelze vložit stejnou zprávu vícekrát za sebou.', MESSAGE_WARNING);
    124124          else
    125125          {
     
    134134    } else $Output .= ShowMessage('Pro vkládaní zpráv musíte byt registrováni.', MESSAGE_CRITICAL);
    135135    $Output .= $this->ShowList();
    136     return($Output);
     136    return $Output;
    137137  }
    138138
     
    143143    mb_internal_encoding('utf-8');
    144144    $DbResult = $this->Database->query('SELECT UNIX_TIMESTAMP(`Date`) AS `UnixDate`, `User`, `UserName`, `Text` FROM `ShoutBox` ORDER BY `ID` DESC LIMIT 20');
    145     while($DbRow = $DbResult->fetch_assoc())
     145    while ($DbRow = $DbResult->fetch_assoc())
    146146    {
    147147      $Title = mb_substr($DbRow['Text'], 0, $TitleLength);
    148       if(mb_strlen($Title) == $TitleLength) $Title .= '...';
     148      if (mb_strlen($Title) == $TitleLength) $Title .= '...';
    149149      $Items[] = array
    150150      (
     
    163163      'Items' => $Items,
    164164    ));
    165     return($Output);
     165    return $Output;
    166166  }
    167167}
  • trunk/Modules/Team/Team.php

    r851 r880  
    2424      'Icon' => '',
    2525    ), 1);
    26     if(array_key_exists('Search', $this->System->ModuleManager->Modules))
     26    if (array_key_exists('Search', $this->System->ModuleManager->Modules))
    2727      $this->System->ModuleManager->Modules['Search']->RegisterSearch('team',
    2828      T('Teams'), array('Name'), '`Team`', $this->System->Link('/team/?search='));
     
    3838    $Output .= 'Týmy jsou seskupení překladatelů, kteří se hlásí k něčemu společnému jako např. WoW serveru, způsobu překladu, ke stejnému hernímu spolku, aj. Být členem týmu samo o sobě nemá žádný zásadní důsledek a spíše to může pomoci se lépe orientovat mezi překladateli někomu, kdo sestavuje export.<br/>';
    3939
    40     if(array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search'];
    41     else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = '';
     40    if (array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search'];
     41    else if (!array_key_exists('search', $_SESSION)) $_SESSION['search'] = '';
    4242    if (array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = '';
    4343
    44     if($this->System->User->Licence(LICENCE_USER))
     44    if ($this->System->User->Licence(LICENCE_USER))
    4545      $Output .= '<br /><div style="text-align: center;"><a href="?action=create">'.T('Create translating team').'</a></div><br/>';
    46     if($_SESSION['search'] != '')
     46    if ($_SESSION['search'] != '')
    4747    {
    4848      $SearchQuery = ' AND ((`Name` LIKE "%'.$_SESSION['search'].'%") OR (`Description` LIKE "%'.$_SESSION['search'].'%"))';
     
    6464      array('Name' => 'TimeCreate', 'Title' => T('Founding date')),
    6565    );
    66     if($this->System->User->Licence(LICENCE_USER)) $TableColumns[] = array('Name' => '', 'Title' => T('User actions'));
     66    if ($this->System->User->Licence(LICENCE_USER)) $TableColumns[] = array('Name' => '', 'Title' => T('User actions'));
    6767
    6868    $Order = GetOrderTableHeader($TableColumns, 'NumberUser', 1);
     
    7272      '(SELECT `Name` FROM `User` WHERE `User`.`ID`=`Team`.`Leader`) AS `LeaderName` '.
    7373      'FROM `Team` WHERE 1'.$SearchQuery.$Order['SQL'].$PageList['SQLLimit']);
    74     while($Team = $DbResult->fetch_assoc())
     74    while ($Team = $DbResult->fetch_assoc())
    7575    {
    7676      $Output .= '<tr>'.
     
    8080        '<td><a href="'.$this->System->Link('/users/?team='.$Team['Id']).'" title="Zobrazit členy týmu">'.$Team['NumberUser'].'</a></td>'.
    8181        '<td>'.HumanDate($Team['TimeCreate']).'</td>';
    82       if($this->System->User->Licence(LICENCE_USER))
    83       {
    84         if($Team['Leader'] == $this->System->User->Id) $Action = ' <a href="?action=modify&amp;id='.$Team['Id'].'">'.T('Edit').'</a>';
     82      if ($this->System->User->Licence(LICENCE_USER))
     83      {
     84        if ($Team['Leader'] == $this->System->User->Id) $Action = ' <a href="?action=modify&amp;id='.$Team['Id'].'">'.T('Edit').'</a>';
    8585        else $Action = '';
    86         if($Team['Id'] == $this->System->User->Team) $Action = ' <a href="?action=leave">'.T('Leave').'</a>';
     86        if ($Team['Id'] == $this->System->User->Team) $Action = ' <a href="?action=leave">'.T('Leave').'</a>';
    8787        $Output .= '<td><a href="?action=gointeam&amp;id='.$Team['Id'].'">'.T('Enter').'</a>'.$Action.'</td>';
    8888      }
     
    9292      $PageList['Output'];
    9393
    94     return($Output);
     94    return $Output;
    9595  }
    9696
    9797  function TeamJoin()
    9898  {
    99     if($this->System->User->Licence(LICENCE_USER))
    100     {
    101       if(array_key_exists('id', $_GET))
     99    if ($this->System->User->Licence(LICENCE_USER))
     100    {
     101      if (array_key_exists('id', $_GET))
    102102      {
    103103        $this->Database->query('UPDATE `User` SET `Team` = '.$_GET['id'].' WHERE `ID` = '.$this->System->User->Id);
     
    114114      } else $Output = ShowMessage('Nutno zadat id týmu.', MESSAGE_CRITICAL);
    115115    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    116     return($Output);
     116    return $Output;
    117117  }
    118118
     
    120120  {
    121121    $Output = '';
    122     if($this->System->User->Licence(LICENCE_USER))
    123     {
    124       if(array_key_exists('Name', $_POST) and array_key_exists('Description', $_POST))
     122    if ($this->System->User->Licence(LICENCE_USER))
     123    {
     124      if (array_key_exists('Name', $_POST) and array_key_exists('Description', $_POST))
    125125      {
    126126        $DbResult = $this->Database->query('SELECT COUNT(*) FROM `Team` WHERE `Name` = "'.trim($_POST['Name']).'"');
    127127        $DbRow = $DbResult->fetch_row();
    128128        $Count = $DbRow[0];
    129         if(($Count == 0) and ($_POST['Name'] != ''))
     129        if (($Count == 0) and ($_POST['Name'] != ''))
    130130        {
    131131          $this->Database->query('INSERT INTO `Team` (`Name` ,`Description`, `URL`, `TimeCreate`, `Leader`)'.
     
    142142    } else $Output .= ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    143143    $Output .= $this->ShowTeamList();
    144     return($Output);
     144    return $Output;
    145145  }
    146146
    147147  function TeamModify()
    148148  {
    149     if($this->System->User->Licence(LICENCE_USER))
    150     {
    151       if(array_key_exists('id', $_GET))
     149    if ($this->System->User->Licence(LICENCE_USER))
     150    {
     151      if (array_key_exists('id', $_GET))
    152152      {
    153153        $DbResult = $this->Database->query('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$this->System->User->Id);
    154         if($DbResult->num_rows > 0)
     154        if ($DbResult->num_rows > 0)
    155155        {
    156156          $Team = $DbResult->fetch_assoc();
     
    165165      } else $Output = ShowMessage('Nezadáno id týmu', MESSAGE_CRITICAL);
    166166    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    167     return($Output);
     167    return $Output;
    168168  }
    169169
     
    171171  {
    172172    $Output = '';
    173     if($this->System->User->Licence(LICENCE_USER))
    174     {
    175       if(array_key_exists('id', $_GET) and array_key_exists('Name', $_POST) and array_key_exists('Description', $_POST) and array_key_exists('URL', $_POST))
     173    if ($this->System->User->Licence(LICENCE_USER))
     174    {
     175      if (array_key_exists('id', $_GET) and array_key_exists('Name', $_POST) and array_key_exists('Description', $_POST) and array_key_exists('URL', $_POST))
    176176      {
    177177        $DbResult = $this->Database->query('SELECT * FROM `Team` WHERE `Id`='.$_GET['id'].' AND `Leader`='.$this->System->User->Id);
    178         if($DbResult->num_rows > 0)
     178        if ($DbResult->num_rows > 0)
    179179        {
    180180          $Team = $DbResult->fetch_assoc();
     
    182182          $DbRow = $DbResult->fetch_row();
    183183          $Count = $DbRow[0];
    184           if(($Count == 0) and ($_POST['Name'] != ''))
     184          if (($Count == 0) and ($_POST['Name'] != ''))
    185185          {
    186186            $this->Database->query('UPDATE `Team` SET `Name`="'.$_POST['Name'].'", `Description`="'.$_POST['Description'].'", `URL`="'.$_POST['URL'].'" WHERE Id='.$Team['Id']);
     
    192192    } else $Output .= ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    193193    $Output .= $this->ShowTeamList();
    194     return($Output);
     194    return $Output;
    195195  }
    196196
    197197  function TeamCreate()
    198198  {
    199     if($this->System->User->Licence(LICENCE_USER))
     199    if ($this->System->User->Licence(LICENCE_USER))
    200200    {
    201201      $Output ='<form action="?action=finish_create" method="post">'.
     
    207207        '</table></fieldset></form>';
    208208    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    209     return($Output);
     209    return $Output;
    210210  }
    211211
     
    213213  {
    214214    $Output = '';
    215     if(array_key_exists('id', $_GET) and is_numeric($_GET['id']))
     215    if (array_key_exists('id', $_GET) and is_numeric($_GET['id']))
    216216    {
    217217      $DbResult = $this->Database->query('SELECT `Id`, `Name`, `Description`, `URL`, `Leader`, '.
     
    221221        '(SELECT ROUND(AVG(`XP`)) FROM `User` WHERE `Team` = `Team`.`Id`) AS `AverageXP` FROM '.
    222222        '`Team` WHERE `Id`='.($_GET['id'] * 1));
    223       if($DbResult->num_rows > 0)
     223      if ($DbResult->num_rows > 0)
    224224      {
    225225        $Team = $DbResult->fetch_assoc();
    226226        $DbResult2 = $this->Database->query('SELECT `Name`, `Id` FROM `User` WHERE `ID`='.$Team['Leader']);
    227         if($DbResult2->num_rows > 0)
     227        if ($DbResult2->num_rows > 0)
    228228        {
    229229          $Leader = $DbResult2->fetch_assoc();
     
    233233          T('Web pages').': <a href="http://'.htmlspecialchars($Team['URL']).'">'.htmlspecialchars($Team['URL']).'</a><br/>'.
    234234          T('Leader').': <a href="'.$this->System->Link('/user/?user='.$Leader['Id']).'">'.$Leader['Name'].'</a><br/>';
    235         if($Team['Description'] != '')
     235        if ($Team['Description'] != '')
    236236          $Output .= T('Description').': '.htmlspecialchars($Team['Description']).'<br />';
    237237        $Output .= '<br />';
    238238        //$Output .= '<a href="export/?team='.$Team['Id'].'">Exportovat překlad týmu</a> ';
    239         if($this->System->User->Licence(LICENCE_USER))
     239        if ($this->System->User->Licence(LICENCE_USER))
    240240          $Output .='<a href="?action=gointeam&amp;id='.$Team['Id'].'">'.T('Enter to team').'</a><br /><br />';
    241241        $XP = GetLevelMinMax($Team['AverageXP']);
     
    252252        $Query = '';
    253253        $DbResult = $this->Database->query($GroupListQuery);
    254         if($DbResult->num_rows > 0)
    255         {
    256           while($DbRow = $DbResult->fetch_assoc())
     254        if ($DbResult->num_rows > 0)
     255        {
     256          while ($DbRow = $DbResult->fetch_assoc())
    257257          {
    258258            $Query .= 'SELECT (SELECT COUNT(DISTINCT(`Entry`)) FROM ('.
     
    289289          $Total = 0;
    290290          $DbResult = $this->Database->query('SELECT *, ROUND(`Translated` / `Total` * 100, 2) AS `Percent` FROM ('.$Query.') AS `C3` '.$Order['SQL'].$PageList['SQLLimit']);
    291           while($Group = $DbResult->fetch_assoc())
     291          while ($Group = $DbResult->fetch_assoc())
    292292          {
    293293            $Output .='<tr><td>'.T($Group['Name']).'</td><td>'.$Group['Translated'].
     
    296296            $Total += $Group['Total'];
    297297          }
    298           if($Total > 0) $Progress = round($Translated / $Total * 100, 2);
     298          if ($Total > 0) $Progress = round($Translated / $Total * 100, 2);
    299299          else $Progress = 0;
    300300          $Output .='<tr><td><strong>'.T('Total').'</strong></td><td><strong>'.
     
    306306      } else $Output .= ShowMessage('Tým nenalezen', MESSAGE_CRITICAL);
    307307    } else $Output .= ShowMessage('Musíte zadat id týmu', MESSAGE_CRITICAL);
    308     return($Output);
     308    return $Output;
    309309  }
    310310
    311311  function TeamLeave()
    312312  {
    313     if($this->System->User->Licence(LICENCE_USER))
     313    if ($this->System->User->Licence(LICENCE_USER))
    314314    {
    315315      $this->Database->query('UPDATE `User` SET `Team` = NULL WHERE `ID` = '.$this->System->User->Id);
     
    325325      $Output .= $this->ShowTeamList();
    326326    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    327     return($Output);
     327    return $Output;
    328328  }
    329329
    330330  function Show()
    331331  {
    332     if(array_key_exists('action', $_GET))
    333     {
    334       if($_GET['action'] == 'gointeam') $Output = $this->TeamJoin();
    335       else if($_GET['action'] == 'finish_create') $Output = $this->TeamCreateFinish();
    336       else if($_GET['action'] == 'modify') $Output = $this->TeamModify();
    337       else if($_GET['action'] == 'finish_modify') $Output = $this->TeamModifyFinish();
    338       else if($_GET['action'] == 'create') $Output = $this->TeamCreate();
    339       else if($_GET['action'] == 'team') $Output = $this->TeamShow();
    340       else if($_GET['action'] == 'leave') $Output = $this->TeamLeave();
     332    if (array_key_exists('action', $_GET))
     333    {
     334      if ($_GET['action'] == 'gointeam') $Output = $this->TeamJoin();
     335      else if ($_GET['action'] == 'finish_create') $Output = $this->TeamCreateFinish();
     336      else if ($_GET['action'] == 'modify') $Output = $this->TeamModify();
     337      else if ($_GET['action'] == 'finish_modify') $Output = $this->TeamModifyFinish();
     338      else if ($_GET['action'] == 'create') $Output = $this->TeamCreate();
     339      else if ($_GET['action'] == 'team') $Output = $this->TeamShow();
     340      else if ($_GET['action'] == 'leave') $Output = $this->TeamLeave();
    341341      else $Output = $this->ShowTeamList();
    342342    } else $Output = $this->ShowTeamList();
    343     return($Output);
     343    return $Output;
    344344  }
    345345}
  • trunk/Modules/Translation/Comparison.php

    r859 r880  
    1212    $ArrStr2 = explode(' ', $String2);
    1313
    14     for($i = 0; $i < count($ArrStr1); $i++)
     14    for ($i = 0; $i < count($ArrStr1); $i++)
    1515    {
    16       if(isset($ArrStr2[$i]))
     16      if (isset($ArrStr2[$i]))
    1717      {
    18         if($ArrStr1[$i] == $ArrStr2[$i])
     18        if ($ArrStr1[$i] == $ArrStr2[$i])
    1919        {
    2020          $Result .= $ArrStr1[$i].' ';
     
    2222        {
    2323          $find = false;
    24           for($j = 0; $j < count($ArrStr2); $j++)
     24          for ($j = 0; $j < count($ArrStr2); $j++)
    2525          {
    26             if(($ArrStr1[$i] == $ArrStr2[$j]) and ($find == false))
     26            if (($ArrStr1[$i] == $ArrStr2[$j]) and ($find == false))
    2727            {
    2828              $Result .= $ArrStr1[$i].' ';
     
    3030            }
    3131          }
    32           if($find == false)
     32          if ($find == false)
    3333          $Result .= '<span class="edit">'.$ArrStr1[$i].' </span>';
    3434        }
    3535      } else $Result .= '<span class="edit">'.$ArrStr1[$i].' </span>';
    3636    }
    37     return($Result);
     37    return $Result;
    3838  }
    3939
     
    4444    $Output = '';
    4545
    46     if($this->System->User->Licence(LICENCE_USER))
     46    if ($this->System->User->Licence(LICENCE_USER))
    4747    {
    4848    $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 />';
     
    5151    $Table = $TranslationTree[$GroupId]['TablePrefix'];
    5252
    53     if(array_key_exists('entry', $_GET))
     53    if (array_key_exists('entry', $_GET))
    5454    {
    5555      $Textentry = $_GET['entry'];
    56       if((array_key_exists('ID1', $_GET)) and ($_GET['ID1'] <> -1))  //porovnání pouze 2 textů
     56      if ((array_key_exists('ID1', $_GET)) and ($_GET['ID1'] <> -1))  //porovnání pouze 2 textů
    5757      {
    5858        $TextID1 = $_GET['ID1'];
     
    6666          ' LEFT JOIN `Language` ON `Language`.`Id` = `'.$Table.'`.`Language` '.
    6767          'WHERE `Entry` = '.$Textentry.' '.$WhereID.' ORDER BY `Language`');
    68       while($Line[] = $DataID->fetch_assoc());
     68      while ($Line[] = $DataID->fetch_assoc());
    6969      array_pop($Line);
    7070
     
    7474          '<table class="BaseTable">'.
    7575          '<tr><th>Přeložil</th>';
    76       foreach($Line as $Index => $LineItem)
     76      foreach ($Line as $Index => $LineItem)
    7777        $Output .= '<th>'.$LineItem['UserName'].'</th>';
    7878      $Output .= '</tr>'.
    7979          '<tr>'.
    8080          '<th>ID textu</th>';
    81       foreach($Line as $Index => $LineItem)
     81      foreach ($Line as $Index => $LineItem)
    8282        $Output .= '<td><a href="form.php?group='.$GroupId.'&amp;ID='.$LineItem['ID'].'">'.$LineItem['ID'].'</a></td>';
    8383      $Output .= '</tr>'.
    8484          '<tr><th>Převzato</th>';
    85       foreach($Line as $Index => $LineItem)
     85      foreach ($Line as $Index => $LineItem)
    8686        $Output .= '<td><a href="form.php?group='.$GroupId.'&amp;ID='.$LineItem['Take'].'">'.$LineItem['Take'].'</a></td>';
    8787      $Output .= '</tr>'.
    8888          '<tr><th>'.T('Language').'</th>';
    89       foreach($Line as $Index => $LineItem)
     89      foreach ($Line as $Index => $LineItem)
    9090        $Output .= '<td>'.T($LineItem['LanguageName']).'</td>';
    9191      $Output .= '</tr>'.
    9292          '<tr><th>'.T('Version').'</th>';
    93       foreach($Line as $Index => $LineItem)
     93      foreach ($Line as $Index => $LineItem)
    9494        $Output .= '<td>'.GetVersionWOW($LineItem['VersionStart']).' - '.GetVersionWOW($LineItem['VersionEnd']).'</td>';
    9595      $Output .= '</tr>';
    96       foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
     96      foreach ($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    9797      {
    9898        $writethis = false;
    99         for($i = 0; $i < count($Line); $i++)
     99        for ($i = 0; $i < count($Line); $i++)
    100100        {
    101           if($Line[$i][$TextItem['Column']] <> '') $writethis = true;
     101          if ($Line[$i][$TextItem['Column']] <> '') $writethis = true;
    102102        }
    103         if($writethis)
     103        if ($writethis)
    104104        {
    105105          $Output .= '<tr><th>'.$TextItem['Name'].'</th>';
    106           for($i = 0; $i < count($Line); $i++)
     106          for ($i = 0; $i < count($Line); $i++)
    107107          {
    108             if($i > 0)
     108            if ($i > 0)
    109109            {
    110110              $Output .= '<td>';
     
    120120  } else $Output .= ShowMessage('Porovnávat můžou pouze překladatelé!', MESSAGE_CRITICAL);
    121121
    122     return($Output);
     122    return $Output;
    123123  }
    124124}
  • trunk/Modules/Translation/Form.php

    r859 r880  
    1010    $this->Title = T('Translation');
    1111    $Action = '';
    12     if(array_key_exists('action', $_GET)) $Action = $_GET['action'];
    13 
    14     if($Action == 'delete') $Output = $this->Delete();
     12    if (array_key_exists('action', $_GET)) $Action = $_GET['action'];
     13
     14    if ($Action == 'delete') $Output = $this->Delete();
    1515      else $Output = $this->ShowForm();
    16     return($Output);
     16    return $Output;
    1717  }
    1818
     
    2626    $this->GroupId = $GroupId;
    2727    $Table = $TranslationTree[$GroupId]['TablePrefix'];
    28     if(array_key_exists('action', $_GET)) $Action = $_GET['action'];
     28    if (array_key_exists('action', $_GET)) $Action = $_GET['action'];
    2929    else $Action = '';
    3030
    31     if(array_key_exists('ID', $_GET))
     31    if (array_key_exists('ID', $_GET))
    3232    {
    3333      $TextID = $_GET['ID'] * 1;
     
    3636      $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$TextID);
    3737      $Line = $DbResult->fetch_assoc();
    38       if(!$Line)
     38      if (!$Line)
    3939      {
    4040        $Output .= ShowMessage('Překlad nenalezen.', MESSAGE_CRITICAL);
     
    4747          else $Language = '`Language` != '.$this->System->Config['OriginalLanguage'];
    4848          $Columns = '';
    49           foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
     49          foreach ($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    5050            $Columns .= ' `Orig`.`'.$TextItem['Column'].'` as `Orig_'.$TextItem['Column'].'`, `Tran`.`'.$TextItem['Column'].'` as `'.$TextItem['Column'].'`,';
    5151
     
    5656          $DbResult = $this->Database->query($sql.$join.$where);
    5757          while ($LineSearch = $DbResult->fetch_assoc()) {
    58             foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    59               if($TextItem['Visible'] == 1)
     58            foreach ($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
     59              if ($TextItem['Visible'] == 1)
    6060                if (($LineAJ[$TextItem['Column']] <> '') and
    6161                    ($LineSearch[$TextItem['Column']] <> '') and
     
    7474          $LineAJ = $DbResult->fetch_assoc();
    7575        }
    76         if(!$LineAJ)
     76        if (!$LineAJ)
    7777        {
    7878          $Output .= ShowMessage('Anglický originál k překladu nenalezen.', MESSAGE_CRITICAL);
     
    8080        {
    8181
    82           if($Line['User'] != '')
     82          if ($Line['User'] != '')
    8383          {
    8484            $IDUser = $this->Database->query('SELECT * FROM `User` WHERE `ID` = '.$Line['User']);
     
    8989          $Output .= T('Group').': <strong>'.$TranslationTree[$GroupId]['Name'].'</strong><br />';
    9090
    91           if(($Line['Language'] <> 0) and ($LineUser['Name'] <> ''))
     91          if (($Line['Language'] <> 0) and ($LineUser['Name'] <> ''))
    9292            $Output .= T('Translated by').': <a href="'.$this->System->Link('/user/?user='.$Line['User']).'"><strong>'.$LineUser['Name'].'</strong></a> dne '.HumanDate($Line['ModifyTime']).'<br />';
    93           if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID']))
     93          if (($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID']))
    9494          {
    9595            $DbResult = $this->Database->query('SELECT `Language`,`VersionStart`,`VersionEnd` FROM `'.$Table.'` WHERE `ID` = '.$Line['Take']);
     
    105105          }
    106106          $Output .= 'Text: ';
    107           if($Line['Language'] <> 0)
    108           {
    109             if($Line['Complete'] == 1) $Output .= ' <b>'.T('Completed').'</b>';
     107          if ($Line['Language'] <> 0)
     108          {
     109            if ($Line['Complete'] == 1) $Output .= ' <b>'.T('Completed').'</b>';
    110110            else $Output .= ' <b>'.T('Stored in unfinished').'</b> ';
    111111          } else $Output .= ' <b>'.T('Original version').'</b> ';
     
    120120          $Version = $DbResult->fetch_row();
    121121          $Version = $Version[0];
    122           if($Version > 0)
     122          if ($Version > 0)
    123123          {
    124124            $Output .= '<form action="comparison.php" method="get"><a href="'.$this->System->Link('/TranslationList.php?group='.
     
    128128            <input type="hidden" name="ID2" value="'.$TextID.'" />';
    129129
    130             if($this->System->User->Licence(LICENCE_USER)) { // allow to compare only to user
     130            if ($this->System->User->Licence(LICENCE_USER)) { // allow to compare only to user
    131131              $Output .= '<select onchange="this.form.submit();" name="ID1">
    132132              <option value="-1">'.T('Select text for comparison').'</option>
    133133              <option value="-1">'.T('Show/compare all').'</option>';
    134134              $DataID = $this->Database->query('SELECT *, (SELECT `User`.`Name` AS `UserName` FROM `User` WHERE `User`.`ID` = `'.$Table.'`.`User`) AS `UserName` FROM `'.$Table.'` WHERE (`Entry` = '.$Line['Entry'].') AND (`ID` <> '.$Line['ID'].')');
    135               while($Version = $DataID->fetch_array())
     135              while ($Version = $DataID->fetch_array())
    136136              {
    137                 if($Version['ID'] == $Line['Take']) $Output .= '<option value="'.
     137                if ($Version['ID'] == $Line['Take']) $Output .= '<option value="'.
    138138                 $Version['ID'].'">'.$Version['ID'].' - '.$Version['User'].' ('.T('taken over').')</option>';
    139139                else
    140140                {
    141                   if($Version['Language'] == 0) $Version['UserName'] = T('Original');
     141                  if ($Version['Language'] == 0) $Version['UserName'] = T('Original');
    142142                  $Output .= '<option value="'.$Version['ID'].'">'.$Version['ID'].' - '.
    143143                      $Version['UserName'].' ('.GetVersionWOW($Version['VersionStart']).' - '.
     
    155155
    156156          // Special characters: $B - New line, $N - Name, $C - profession
    157           if($this->System->User->Licence(LICENCE_USER))
     157          if ($this->System->User->Licence(LICENCE_USER))
    158158          {
    159159            $Output .= '<form action="'.$this->System->Link('/save.php?group='.$GroupId).'" method="post"><div>';
    160160            // TODO: Remove fixed group id condition
    161           //  if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11))
     161          //  if (($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11))
    162162            $Output .= '<a href="'.$this->System->Link('/dictionary/?action=group&amp;group='.
    163163              $GroupId.'&amp;ID='.$LineAJ['ID']).'" target="_blank"  title="Zobrazit přeložené názvy věci, postav, a herních objektů k tomuto překladu">'.T('Search in names').'</a>';
     
    169169          }
    170170
    171           if($TranslationTree[$GroupId]['WowheadName'] != '')
     171          if ($TranslationTree[$GroupId]['WowheadName'] != '')
    172172            $WowheadLink = '<a href="http://www.wowhead.com/?'.$TranslationTree[$GroupId]['WowheadName'].
    173173              '='.$LineAJ['Entry'].'">'.$LineAJ['Entry'].'</a>';
     
    187187          <td>'.T('Original').'</td>
    188188          <td>';
    189           if($Line['Language'] <> 0) $Language = $Line['Language'];
    190           else if($this->System->User->Id != 0)
     189          if ($Line['Language'] <> 0) $Language = $Line['Language'];
     190          else if ($this->System->User->Id != 0)
    191191          {
    192192            $Language = $this->System->User->Language;
    193193          } else $Language = 0;
    194           if($this->System->User->Licence(LICENCE_USER)) $Output .= WriteLanguages($Language);
     194          if ($this->System->User->Licence(LICENCE_USER)) $Output .= WriteLanguages($Language);
    195195            else {
    196196            $DbResult3 = $this->Database->select('Language', '`Id`, `Name`', '(`Enabled` = 1) AND (`Id`='.$Language.')');
    197             if($DbResult3->num_rows > 0)
     197            if ($DbResult3->num_rows > 0)
    198198            {
    199199              $Language = $DbResult3->fetch_assoc();
     
    209209             '<script>';
    210210          $Output .=    '$(document).ready(function() {';
    211           foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
     211          foreach ($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    212212            $Output .=   '$("#'.$TextItem['Column'].'").load("'.$this->System->Link('/LoadNames.php?ID='.$LineAJ['ID'].'&Column='.$TextItem['Column'].'&GroupId='.$GroupId).'");';
    213213
     
    215215            '</script>';
    216216
    217           foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    218             if($TextItem['Visible'] == 1)
     217          foreach ($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
     218            if ($TextItem['Visible'] == 1)
    219219            {
    220               if(($LineAJ[$TextItem['Column']] <> '') or ($Line[$TextItem['Column']] <> ''))
     220              if (($LineAJ[$TextItem['Column']] <> '') or ($Line[$TextItem['Column']] <> ''))
    221221              {
    222                 if(($TextItem['Name'] == 'Text') and (($Table == 'global_strings') or ($Table == 'glue_strings')))
     222                if (($TextItem['Name'] == 'Text') and (($Table == 'global_strings') or ($Table == 'glue_strings')))
    223223                  $Output .= '<tr><th>'.$LineAJ['ShortCut'].'</th>';
    224224                else $Output .= '<tr><th>'.T($TextItem['Name']).'</th>';
    225225                $Output .= '<td id="'.$TextItem['Column'].'">'.str_replace("\n", '<br/>', htmlspecialchars($LineAJ[$TextItem['Column']])).'</td>
    226226                <td>';
    227                 if($this->System->User->Licence(LICENCE_USER))
     227                if ($this->System->User->Licence(LICENCE_USER))
    228228                  $Output .= '<textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'">';
    229229                $Output .=  htmlspecialchars($Line[$TextItem['Column']]);
    230                 if($this->System->User->Licence(LICENCE_USER)) $Output .= '</textarea></td></tr>';
     230                if ($this->System->User->Licence(LICENCE_USER)) $Output .= '</textarea></td></tr>';
    231231              }
    232232            } else
     
    235235            }
    236236            $Output .= '</table></div>';
    237             if($this->System->User->Licence(LICENCE_USER)) {
     237            if ($this->System->User->Licence(LICENCE_USER)) {
    238238              $Output .= '</form>';
    239239
    240               if(isset($this->System->Config['Web']['EnableGoogleTranslate']) and
     240              if (isset($this->System->Config['Web']['EnableGoogleTranslate']) and
    241241                $this->System->Config['Web']['EnableGoogleTranslate'])
    242242              {
    243243              $Output .= '<br/><table class="BaseTable">'.
    244244              '<tr><th>'.T('Google translator').':</th><th>'.T('Not translated').'</th><th>'.T('Translated').'</th>';
    245               foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    246                 if($TextItem['Visible'] == 1)
     245              foreach ($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
     246                if ($TextItem['Visible'] == 1)
    247247                  if ($LineAJ[$TextItem['Column']] <> '')
    248248                    $Output .= '<tr><td>'.$TextItem['Column'].'</td>'.
     
    256256      }
    257257    } else $Output = ShowMessage('Nebylo zadáno ID.', MESSAGE_CRITICAL);
    258     return($Output);
     258    return $Output;
    259259  }
    260260
     
    263263    $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree();
    264264
    265     if($this->System->User->Licence(LICENCE_MODERATOR))
     265    if ($this->System->User->Licence(LICENCE_MODERATOR))
    266266    {
    267267      $GroupId = LoadGroupIdParameter();
     
    273273      $this->System->ModuleManager->Modules['Log']->WriteLog('Překlad byl smazán! <a href="'.$this->System->Link('/form.php?group='.$this->GroupId.'&amp;ID='.$TextID).'">'.$TextID.'</a>', LOG_TYPE_MODERATOR);
    274274    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    275     return($Output);
     275    return $Output;
    276276  }
    277277}
  • trunk/Modules/Translation/LoadNames.php

    r859 r880  
    1818    }
    1919  //   }
    20     return ($Text);
     20    return $Text;
    2121  }
    2222  function ReplaceNotTranslated($orig,$tran,$Text,$ID,$Group)
     
    2626    $Text = str_replace(' '.$orig,' <span title="Kliknutím přeložíš" class="needtran"><a class="needtran" target="_NEW2" href="'.
    2727      $this->System->Link('/form.php?group='.$Group.'&amp;ID='.$ID).'">'.$orig_replace.'</a></span>',$Text);
    28     return ($Text);
     28    return $Text;
    2929  }
    3030
     
    4444    $Text = str_replace('$r','<span Title="Znamená rasu hráče, překladu zachovej na stejné pozici." class="edit">$R</span>',$Text);
    4545    $Text = str_replace('$g','<span Title="Vybere oslovení podle pohlaví hráče, překladu zachovej na stejné pozici." class="edit">$G</span>',$Text);
    46     foreach($names as $Line) {
     46    foreach ($names as $Line) {
    4747     if (($_GET['ID'] <> $Line[0]) or ($Line[1] <> $_GET['GroupId']))
    4848      if ($Line[3] <> '')  {
     
    6161
    6262    $Output = '';
    63     if(array_key_exists('GroupId', $_GET)) $GroupId = $_GET['GroupId'];
    64       else return(ShowMessage(T('GroupId not specified'), MESSAGE_CRITICAL));
    65     if(!array_key_exists('ID', $_GET)) return(ShowMessage(T('ID not specified'), MESSAGE_CRITICAL));
    66     if(!array_key_exists('Column', $_GET)) return(ShowMessage(T('Column not specified'), MESSAGE_CRITICAL));
     63    if (array_key_exists('GroupId', $_GET)) $GroupId = $_GET['GroupId'];
     64      else return ShowMessage(T('GroupId not specified'), MESSAGE_CRITICAL);
     65    if (!array_key_exists('ID', $_GET)) return ShowMessage(T('ID not specified'), MESSAGE_CRITICAL);
     66    if (!array_key_exists('Column', $_GET)) return ShowMessage(T('Column not specified'), MESSAGE_CRITICAL);
    6767    $Table = $TranslationTree[$GroupId]['TablePrefix'];
    6868    $DbResult = $this->System->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$_GET['ID'].' LIMIT 1');
     
    7373          $names = array();
    7474          if ($this->System->User->Licence(LICENCE_USER))
    75           if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11))
     75          if (($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11))
    7676          {
    7777            //<span class="edit">barvou.</span>
    7878            $names = GetTranslatNames($Text, 0, GetTranslatNamesArray());
    7979          } else {
    80             if(($GroupId == 13)) {
     80            if (($GroupId == 13)) {
    8181              $names = GetTranslatNames($Text, 0, array('Dictionary' => 'Text',
    8282                'TextGlobalString' => 'Text', 'TextArea' => 'Name',
     
    8787          }
    8888                                   //$LineAJ[$Column]
    89           return ($this->ColorNames(htmlspecialchars($Text),$names));
     89          return $this->ColorNames(htmlspecialchars($Text),$names);
    9090    }
    9191
     
    9393  {
    9494    $this->RawPage = true;
    95     return(str_replace("\n", '<br/>', $this->LoadNames()));
     95    return str_replace("\n", '<br/>', $this->LoadNames());
    9696  }
    9797}
  • 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}
  • trunk/Modules/Translation/Save.php

    r859 r880  
    1111    // Get source text record from database by ID
    1212    $DbResult = $this->Database->query('SELECT * FROM `'.$Table.'` WHERE `ID`='.$TextID);
    13     if($DbResult->num_rows > 0)
     13    if ($DbResult->num_rows > 0)
    1414    {
    1515      $SourceText = $DbResult->fetch_assoc();
     
    1919          'AND (`Language` = '.$this->System->Config['OriginalLanguage'].') AND (`VersionStart` = '.$SourceText['VersionStart'].') '.
    2020          'AND (`VersionEnd` = '.$SourceText['VersionEnd'].')');
    21       if($DbResult->num_rows > 0)
     21      if ($DbResult->num_rows > 0)
    2222      {
    2323        $EnglishText = $DbResult->fetch_assoc();
     
    2525        // Get all similar english texts
    2626        $Filter = array();
    27         foreach($Group['Items'] as $GroupItem)
     27        foreach ($Group['Items'] as $GroupItem)
    2828        {
    29           if(($GroupItem['Visible'] == 1) and ($EnglishText[$GroupItem['Column']] != ''))
     29          if (($GroupItem['Visible'] == 1) and ($EnglishText[$GroupItem['Column']] != ''))
    3030            $Filter[] = '(`'.$GroupItem['Column'].'` = "'.addslashes($EnglishText[$GroupItem['Column']]).'")';
    3131        }
    32         if(count($Filter) > 0) $Filter = ' AND ('.implode(' OR ', $Filter).')';
     32        if (count($Filter) > 0) $Filter = ' AND ('.implode(' OR ', $Filter).')';
    3333          else $Filter = ' AND 0';
    3434
    3535          $Query = 'SELECT * FROM `'.$Table.'` WHERE (`Language` = '.$this->System->Config['OriginalLanguage'].')'.$Filter;
    3636          $DbResult = $this->Database->query($Query);
    37           while($EnglishFound = $DbResult->fetch_assoc())
     37          while ($EnglishFound = $DbResult->fetch_assoc())
    3838          {
    3939            // Get user translation paired to found english item entry
     
    4141              ') AND (`Entry` = '.$EnglishFound['Entry'].') AND (`VersionStart` = '.$EnglishFound['VersionStart'].
    4242              ') AND (`VersionEnd` = '.$EnglishFound['VersionEnd'].')');
    43             if($DbResult2->num_rows > 0)
     43            if ($DbResult2->num_rows > 0)
    4444            {
    4545              // Update existed user translation
     
    4747              $Modified = false;
    4848              $Values = '`Language` = '.$Language;
    49               if($Language != $ExistedText['Language']) $Modified = true;
     49              if ($Language != $ExistedText['Language']) $Modified = true;
    5050
    5151              $Completable = true;
    5252              $CompleteParts = $ExistedText['CompleteParts'];
    53               foreach($Group['Items'] as $GroupItem)
    54               {
    55                 if($GroupItem['Visible'] == 1)
    56                 {
    57                   if($EnglishFound[$GroupItem['Column']] == $EnglishText[$GroupItem['Column']])
     53              foreach ($Group['Items'] as $GroupItem)
     54              {
     55                if ($GroupItem['Visible'] == 1)
     56                {
     57                  if ($EnglishFound[$GroupItem['Column']] == $EnglishText[$GroupItem['Column']])
    5858                  {
    59                     if(array_key_exists($GroupItem['Column'], $_POST))
     59                    if (array_key_exists($GroupItem['Column'], $_POST))
    6060                    {
    61                       if($_POST[$GroupItem['Column']] != $ExistedText[$GroupItem['Column']])
     61                      if ($_POST[$GroupItem['Column']] != $ExistedText[$GroupItem['Column']])
    6262                        $Modified = true;
    6363
     
    6666                    }
    6767                  }
    68                   if((($CompleteParts & (1 << ($GroupItem['Sequence'] - 1))) == 0) and
     68                  if ((($CompleteParts & (1 << ($GroupItem['Sequence'] - 1))) == 0) and
    6969                      ($EnglishFound[$GroupItem['Column']] != '')) $Completable = false;
    7070                }
    7171              }
    72               if($Completable) $NewComplete = 1; // All parts of text are completed. Make entire text as completed
     72              if ($Completable) $NewComplete = 1; // All parts of text are completed. Make entire text as completed
    7373                else $NewComplete = 0;
    7474
    7575              // Update completion status for edited translation item
    76               if($SourceText['ID'] == $ExistedText['ID'])
     76              if ($SourceText['ID'] == $ExistedText['ID'])
    7777              {
    7878                $NewComplete = $Complete; // Our original user text, set complete according user choice
    79                 if($Complete == 1)
    80                 {
    81                   foreach($Group['Items'] as $GroupItem)
    82                     if($GroupItem['Visible'] == 1) $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1));
     79                if ($Complete == 1)
     80                {
     81                  foreach ($Group['Items'] as $GroupItem)
     82                    if ($GroupItem['Visible'] == 1) $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1));
    8383                }
    8484              }
    8585              $Values .= ', `Complete`='.$NewComplete.', `CompleteParts` = '.$CompleteParts;
    86               if(($NewComplete != $ExistedText['Complete']) or ($CompleteParts != $ExistedText['CompleteParts']))
     86              if (($NewComplete != $ExistedText['Complete']) or ($CompleteParts != $ExistedText['CompleteParts']))
    8787                $Modified = true;
    8888
    8989              $Values .= ', `ModifyTime` = NOW()';
    90               if($Modified)
     90              if ($Modified)
    9191              {
    9292                // Update user translation
     
    114114              $CompleteParts = 0;
    115115              $Completable = true;
    116               foreach($Group['Items'] as $GroupItem)
     116              foreach ($Group['Items'] as $GroupItem)
    117117              {
    118118                $Columns .= ', `'.$GroupItem['Column'].'`';
    119                 if($GroupItem['Visible'] == 1)
    120                 {
    121                   if($EnglishFound[$GroupItem['Column']] == $EnglishText[$GroupItem['Column']])
     119                if ($GroupItem['Visible'] == 1)
     120                {
     121                  if ($EnglishFound[$GroupItem['Column']] == $EnglishText[$GroupItem['Column']])
    122122                  {
    123123                    // Read form user data
    124                     if(array_key_exists($GroupItem['Column'], $_POST))
     124                    if (array_key_exists($GroupItem['Column'], $_POST))
    125125                    {
    126126                      $Values .= ', "'.$_POST[$GroupItem['Column']].'"';
     
    128128                    } else $Values .= ', "'.addslashes($EnglishFound[$GroupItem['Column']]).'"';
    129129                  } else $Values .= ', "'.addslashes($EnglishFound[$GroupItem['Column']]).'"';
    130                   if((($CompleteParts & (1 << ($GroupItem['Sequence'] - 1))) == 0) and ($EnglishFound[$GroupItem['Column']] != '')) $Completable = false;
     130                  if ((($CompleteParts & (1 << ($GroupItem['Sequence'] - 1))) == 0) and ($EnglishFound[$GroupItem['Column']] != '')) $Completable = false;
    131131                } else
    132132                {
     
    135135                }
    136136              }
    137               if($Completable) $NewComplete = 1; // All parts of text are completed. Make entire text as completed
     137              if ($Completable) $NewComplete = 1; // All parts of text are completed. Make entire text as completed
    138138                else $NewComplete = 0;
    139139              // Update completion status for edited translation item
    140               if($SourceText['ID'] == $EnglishFound['ID'])
     140              if ($SourceText['ID'] == $EnglishFound['ID'])
    141141              {
    142142                $TakeID = $TextID;
    143143                $NewComplete = $Complete; // Our original user text, set complete according user choice
    144                 if($Complete == 1)
    145                 {
    146                   foreach($Group['Items'] as $GroupItem)
    147                     if($GroupItem['Visible'] == 1) $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1));
     144                if ($Complete == 1)
     145                {
     146                  foreach ($Group['Items'] as $GroupItem)
     147                    if ($GroupItem['Visible'] == 1) $CompleteParts |= (1 << ($GroupItem['Sequence'] - 1));
    148148                }
    149149              }
     
    171171      } else $Output .= ShowMessage('Anglický originál k překladu nenalezen.', MESSAGE_CRITICAL);
    172172    } else $Output .= ShowMessage('Zadaná položka nenalezena.', MESSAGE_CRITICAL);
    173     return($Output);
     173    return $Output;
    174174  }
    175175
     
    183183    unset($Message);
    184184    $this->System->ModuleManager->Modules['FrontPage']->HandleLoginForm();
    185     if(isset($Message)) $Output .= ShowMessage($Message, $MessageType);
     185    if (isset($Message)) $Output .= ShowMessage($Message, $MessageType);
    186186
    187187    $GroupId = LoadGroupIdParameter();
    188188    $Group = $TranslationTree[$GroupId];
    189189    $Table = $Group['TablePrefix'];
    190     if($this->System->User->Licence(LICENCE_USER))
    191     {
    192       if(array_key_exists('ID', $_POST) and is_numeric($_POST['ID']))
     190    if ($this->System->User->Licence(LICENCE_USER))
     191    {
     192      if (array_key_exists('ID', $_POST) and is_numeric($_POST['ID']))
    193193      {
    194194        $Entry = $_POST['entry'] * 1;
    195195        $TextID = $_POST['ID'] * 1;
    196196        $Language = $_POST['Language'] * 1;
    197         if(array_key_exists('End', $_POST)) $Complete = 1;
     197        if (array_key_exists('End', $_POST)) $Complete = 1;
    198198          else $Complete = 0;
    199199
     
    207207    {
    208208      // User automatically logged out. Show login dialog and allow to save retry.
    209       if(array_key_exists('ID', $_POST) and array_key_exists('entry', $_POST) and array_key_exists('Language', $_POST) and array_key_exists('user', $_POST))
     209      if (array_key_exists('ID', $_POST) and array_key_exists('entry', $_POST) and array_key_exists('Language', $_POST) and array_key_exists('user', $_POST))
    210210      {
    211211        $Output .= 'Byli jste automaticky odhlášeni. Pro <strong>Uložení překladu</strong> se musíte přihlásit zde:<br /><br />'.
     
    216216          '<input type="hidden" name="Language" value="'.$_POST['Language'].'" />';
    217217
    218         foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
     218        foreach ($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    219219        {
    220           if(array_key_exists($TextItem['Column'], $_POST)) $Value = $_POST[$TextItem['Column']]; else $Value = '';
     220          if (array_key_exists($TextItem['Column'], $_POST)) $Value = $_POST[$TextItem['Column']]; else $Value = '';
    221221          $Output .= '<input id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'" type="hidden" value="'.htmlspecialchars($Value).'" />';
    222222        }
     
    232232      } else $Output = ShowMessage('Nezadány požadované údaje.', MESSAGE_CRITICAL);
    233233    }
    234     return($Output);
     234    return $Output;
    235235  }
    236236
     
    246246    $redirecting = $DbResult->fetch_assoc();
    247247
    248     switch($redirecting['Redirecting'])
     248    switch ($redirecting['Redirecting'])
    249249    {
    250250      case 1:
     
    254254        break;
    255255      case 2:
    256         if($next <> '')
     256        if ($next <> '')
    257257          $Output .= '<script type="text/javascript" language="JavaScript" charset="utf-8">'.
    258258            'setTimeout("parent.location.href=\''.htmlspecialchars_decode($next).'\'", 1500)'.
     
    260260          break;
    261261      case 3:
    262         if($prev <> '')
     262        if ($prev <> '')
    263263          $Output .= '<script type="text/javascript" language="JavaScript" charset="utf-8">'.
    264264            'setTimeout("parent.location.href=\''.htmlspecialchars_decode($prev).'\'", 1500)'.
     
    269269    $Output .= sprintf(T('You can be redirected automatically from this page. You can set where you want to be transfered here: %s'), '<a href="'.
    270270      $this->System->Link('/options/').'" title="'.T('User settings').'">'.T('Options').'</a>');
    271     return($Output);
     271    return $Output;
    272272  }
    273273}
  • 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}
  • trunk/Modules/Translation/TranslationList.php

    r859 r880  
    4747    );
    4848    foreach ($StateTypes as $index => $StateType) {
    49       if($Filter['State'] == $index) $Selected = ' selected="selected"';
     49      if ($Filter['State'] == $index) $Selected = ' selected="selected"';
    5050      else $Selected = '';
    5151      $Output .= '<option value="'.$index.'"'.$Selected.'>'.$StateType.'</option>';
     
    5454
    5555    // Translation group
    56     if($GroupId == 0)
     56    if ($GroupId == 0)
    5757    {
    5858      $Filter['Group'] = GetParameter('group', 0, true, true);
    59       if($Filter['Group'] != 0)
     59      if ($Filter['Group'] != 0)
    6060      {
    61         if(isset($TranslationTree[$Filter['Group']]) == false)
     61        if (isset($TranslationTree[$Filter['Group']]) == false)
    6262          ErrorMessage('Překladová skupina dle zadaného Id neexistuje.');
    6363        $Table = $TranslationTree[$Filter['Group']]['TablePrefix'];
     
    7070
    7171    $Output .= '<td><select name="group" style="width: 80px">';
    72     if($Filter['Group'] == 0) $Selected = ' selected="selected"';
     72    if ($Filter['Group'] == 0) $Selected = ' selected="selected"';
    7373    else $Selected = '';
    7474    $Output .= '<option value="0"'.$Selected.'>'.T('All').'</option>';
    7575    $DbResult = $this->Database->query('SELECT `Id`,`Name` FROM `Group`');
    76     while($Group = $DbResult->fetch_assoc())
     76    while ($Group = $DbResult->fetch_assoc())
    7777      $Groups[T($Group['Name'])] = $Group;
    7878    ksort($Groups);
    79     foreach($Groups as $Group)
    80     {
    81       if($Group['Id'] == $Filter['Group']) $Selected = ' selected="selected"';
     79    foreach ($Groups as $Group)
     80    {
     81      if ($Group['Id'] == $Filter['Group']) $Selected = ' selected="selected"';
    8282      else $Selected = '';
    8383      $Output .= '<option value="'.$Group['Id'].'"'.$Selected.'>'.T($Group['Name']).'</option>';
     
    8989    else
    9090      $Filter['Version'] = GetParameter('version', 0, true, true);
    91     if($Filter['Version'] != 0)
     91    if ($Filter['Version'] != 0)
    9292    {
    9393      $DbResult = $this->Database->query('SELECT `Id`, `BuildNumber`,`Version` FROM `ClientVersion` WHERE (`Imported` = 1) AND (`Id` ='.$Filter['Version'].')');
    94       if($DbResult->num_rows > 0)
     94      if ($DbResult->num_rows > 0)
    9595      {
    9696        $DbRow = $DbResult->fetch_assoc();
     
    9999    }
    100100    $Output .= '<td><select name="version">';
    101     if($Filter['Version'] == 0) $Selected = ' selected="selected"';
     101    if ($Filter['Version'] == 0) $Selected = ' selected="selected"';
    102102    else $Selected = '';
    103103    $Output .= '<option value="0"'.$Selected.'>'.T('All').'</option>';
    104104    $DbResult = $this->Database->query('SELECT `Id`, `BuildNumber`,`Version` FROM `ClientVersion` WHERE `Imported` = 1 ORDER BY `BuildNumber` DESC');
    105     while($Version = $DbResult->fetch_assoc())
    106     {
    107       if($Version['Id'] == $Filter['Version']) $Selected = ' selected="selected"';
     105    while ($Version = $DbResult->fetch_assoc())
     106    {
     107      if ($Version['Id'] == $Filter['Version']) $Selected = ' selected="selected"';
    108108      else $Selected = '';
    109109      $Output .= '<option value="'.$Version['Id'].'"'.$Selected.'>'.$Version['Version'].'</option>';
    110110    }
    111111    $Output .= '</select></td>';
    112     if($Filter['Version'] != 0) $VersionFilter = ' AND (`VersionStart` <= '.$Filter['BuildNumber'].') AND (`VersionEnd` >= '.$Filter['BuildNumber'].')';
     112    if ($Filter['Version'] != 0) $VersionFilter = ' AND (`VersionStart` <= '.$Filter['BuildNumber'].') AND (`VersionEnd` >= '.$Filter['BuildNumber'].')';
    113113    else $VersionFilter = '';
    114114    //else $Filter['SQL'] .= ' AND '; DISTINCT(Entry)
     
    117117    $Filter['Language'] = GetParameter('lang', 0, true, true);
    118118    $Output .= '<td><select name="lang">';
    119     if($Filter['Language'] == 0) $Selected = ' selected="selected"';
     119    if ($Filter['Language'] == 0) $Selected = ' selected="selected"';
    120120    else $Selected = '';
    121121    $Output .= '<option value="0"'.$Selected.'>'.T('All').'</option>';
    122122    $DbResult = $this->Database->query('SELECT `Id`, `Name` FROM `Language` WHERE `Enabled` = 1 ORDER BY `Name`');
    123     while($Language = $DbResult->fetch_assoc())
    124     {
    125       if($Language['Id'] == $Filter['Language']) $Selected = ' selected="selected"';
     123    while ($Language = $DbResult->fetch_assoc())
     124    {
     125      if ($Language['Id'] == $Filter['Language']) $Selected = ' selected="selected"';
    126126      else $Selected = '';
    127127      $Output .= '<option value="'.$Language['Id'].'"'.$Selected.'>'.T($Language['Name']).'</option>';
     
    130130    $LanguageFilter = '';
    131131    $LanguageFilterSub = '';
    132     if($Filter['Language'] != 0) {
     132    if ($Filter['Language'] != 0) {
    133133      $LanguageFilter = ' AND (`T`.`Language` = '.$Filter['Language'].')';
    134134      $LanguageFilterSub = ' AND (`Sub`.`Language` = '.$Filter['Language'].')';
     
    138138    $Filter['User'] = GetParameter('user', 0, true, true);
    139139    $Output .= '<td><select name="user" style="width: 80px">';
    140     if($Filter['User'] == 0) $Selected = ' selected="selected"';
     140    if ($Filter['User'] == 0) $Selected = ' selected="selected"';
    141141    else $Selected = '';
    142142    $Output .= '<option value="0"'.$Selected.'>'.T('All').'</option>';
    143143    $DbResult = $this->Database->query('SELECT `Id`, `Name` FROM `User` ORDER BY `Name`');
    144     while($User = $DbResult->fetch_assoc())
    145     {
    146       if($User['Id'] == $Filter['User']) $Selected = ' selected="selected"';
     144    while ($User = $DbResult->fetch_assoc())
     145    {
     146      if ($User['Id'] == $Filter['User']) $Selected = ' selected="selected"';
    147147      else $Selected = '';
    148148      $Output .= '<option value="'.$User['Id'].'"'.$Selected.'>'.$User['Name'].'</option>';
    149149    }
    150150    $Output .= '</select></td>';
    151     if($Filter['User'] != 0) $UserFilter = ' AND (`User` = '.$Filter['User'].')';
     151    if ($Filter['User'] != 0) $UserFilter = ' AND (`User` = '.$Filter['User'].')';
    152152    else $UserFilter = '';
    153153
     
    155155    $Filter['Text'] = GetParameter('text', '', false, true);
    156156    $Output .= '<td><input name="text" type="text" style="width: 60px;" value="'.htmlentities($Filter['Text']).'"></td>';
    157     if($Filter['Text'] != '')
     157    if ($Filter['Text'] != '')
    158158    {
    159159      $Items = array('(`T`.`ID` LIKE "%'.$Filter['Text'].'%")', '(`T`.`Entry` LIKE "%'.$Filter['Text'].'%")');
    160       if($Filter['Group'] != 0)
    161         foreach($TranslationTree[$Filter['Group']]['Items'] as $GroupItem)
    162         if($GroupItem['Visible'] == 1)
     160      if ($Filter['Group'] != 0)
     161        foreach ($TranslationTree[$Filter['Group']]['Items'] as $GroupItem)
     162        if ($GroupItem['Visible'] == 1)
    163163        $Items[] = '(`T`.`'.$GroupItem['Column'].'` LIKE "%'.$Filter['Text'].'%")';
    164164      $Filter['SQL'] .= ' AND ('.implode(' OR ', $Items).')';
     
    168168    $Filter['Entry'] = GetParameter('entry', '', false, true);
    169169    $Output .= '<td><input name="entry" type="text" style="width: 60px;" value="'.htmlentities($Filter['Entry']).'"></td>';
    170     if($Filter['Entry'] != '')
     170    if ($Filter['Entry'] != '')
    171171    {
    172172      $Filter['SQL'] .= ' AND (`Entry` = "'.$Filter['Entry'].'")';
    173173    }
    174174
    175     if($Filter['Group'] != 0)
     175    if ($Filter['Group'] != 0)
    176176    {
    177177        $WithoutAlter =       ' AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE '.
     
    179179          ' AND (`Sub`.`Entry` = `T`.`Entry`) AND (`Sub`.`ID` != `T`.`ID`) AND (`Sub`.`Complete` = 1) AND '.
    180180          '(`Sub`.`VersionStart` = `T`.`VersionStart`) AND (`Sub`.`VersionEnd` = `T`.`VersionEnd`) LIMIT 1 ) ';
    181         foreach($TranslationTree[$Filter['Group']]['Items'] as $GroupItem)
    182           if($GroupItem['Visible'] == 1) {
     181        foreach ($TranslationTree[$Filter['Group']]['Items'] as $GroupItem)
     182          if ($GroupItem['Visible'] == 1) {
    183183            $ItemsVar[] =    'LENGTH(`T`.`'.$GroupItem['Column'].'`) - LENGTH( REPLACE( `T`.`'.$GroupItem['Column'].'`,  \'$\',  \'\' ) ) '.
    184184                           ' < ('.
     
    188188                              ')';
    189189          }
    190       if($Filter['State'] == CompletionState::All) {
     190      if ($Filter['State'] == CompletionState::All) {
    191191        $Filter['SQL'] .= $UserFilter.$VersionFilter;
    192192      } else
    193       if($Filter['State'] == CompletionState::NotTranslated) {
     193      if ($Filter['State'] == CompletionState::NotTranslated) {
    194194        $Filter['SQL'] .= $VersionFilter.' AND (`T`.`Language` = '.$this->System->Config['OriginalLanguage'].') '.
    195195          'AND NOT EXISTS(SELECT 1 FROM `'.$Table.'` AS `Sub` WHERE '.
     
    198198          '(`Sub`.`VersionStart` = `T`.`VersionStart`) AND (`Sub`.`VersionEnd` = `T`.`VersionEnd`))';
    199199      } else
    200       if($Filter['State'] == CompletionState::Translated) {
     200      if ($Filter['State'] == CompletionState::Translated) {
    201201        $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`T`.`Complete` = 1)';
    202202      } else
    203       if($Filter['State'] == CompletionState::NotFinished) {
     203      if ($Filter['State'] == CompletionState::NotFinished) {
    204204        $Filter['SQL'] .= $UserFilter.$LanguageFilter.$VersionFilter.' AND (`T`.`Language` != '.$this->System->Config['OriginalLanguage'].
    205205      ') AND (`T`.`Complete` = 0)';
    206206      } else
    207       if($Filter['State'] == CompletionState::Original) {
     207      if ($Filter['State'] == CompletionState::Original) {
    208208        $Filter['SQL'] .= $VersionFilter.' AND (`T`.`Language` = '.$this->System->Config['OriginalLanguage'].')';
    209209      } else
    210       if($Filter['State'] == CompletionState::NotFinishedNotTranslated) {
     210      if ($Filter['State'] == CompletionState::NotFinishedNotTranslated) {
    211211        $Filter['SQL'] .= $UserFilter.$VersionFilter.$WithoutAlter.
    212212      ' AND (`T`.`Language` != '.$this->System->Config['OriginalLanguage'].
    213213      ') AND (`T`.`Complete` = 0)';
    214214      } else
    215       if($Filter['State'] == CompletionState::Missing1) {
     215      if ($Filter['State'] == CompletionState::Missing1) {
    216216        $Filter['SQL'] .= $UserFilter.$VersionFilter.' AND (`T`.`Complete` = 1) AND `T`.`Language` != '.$this->System->Config['OriginalLanguage'];
    217217        $Filter['SQL'] .= ' AND ('.implode(' OR ', $ItemsVar).') ';
    218218      } else
    219       if($Filter['State'] == CompletionState::Missing2) {
     219      if ($Filter['State'] == CompletionState::Missing2) {
    220220        $Filter['SQL'] .= $UserFilter.$VersionFilter.' AND (`T`.`Complete` = 1) AND `T`.`Language` != '.$this->System->Config['OriginalLanguage'];
    221221        $Filter['SQL'] .= ' '. $WithoutAlter;
     
    226226    /*
    227227     // Ownership
    228     if(array_key_exists('owner', $_GET) and is_numeric($_GET['owner'])) $Filter['Owner'] = $_GET['owner'];
     228    if (array_key_exists('owner', $_GET) and is_numeric($_GET['owner'])) $Filter['Owner'] = $_GET['owner'];
    229229    else $Filter['Owner'] = 0;
    230230    $Output .= ' <td><select name="owner">';
    231     if($Filter['Owner'] == 0) $Selected = ' selected="selected"';
     231    if ($Filter['Owner'] == 0) $Selected = ' selected="selected"';
    232232    else $Selected = '';
    233233    $Output .= '<option value="0"'.$Selected.'>Všech</option>';
    234     if($Filter['Owner'] == 1) $Selected = ' selected="selected"';
     234    if ($Filter['Owner'] == 1) $Selected = ' selected="selected"';
    235235    else $Selected = '';
    236236    $Output .= '<option value="1"'.$Selected.'>Překladatelův tým</option>';
    237     if($Filter['Owner'] == 2) $Selected = ' selected="selected"';
     237    if ($Filter['Owner'] == 2) $Selected = ' selected="selected"';
    238238    else $Selected = '';
    239239    $Output .= '<option value="2"'.$Selected.'>Překladatele</option>';
    240240    $Output .= '</select></td>';
    241     if(($Filter['Owner'] == 2) AND ($Filter['User'] != 0)) $Filter['SQL'] .= ' AND (`User` = '.$Filter['User'].')';
     241    if (($Filter['Owner'] == 2) AND ($Filter['User'] != 0)) $Filter['SQL'] .= ' AND (`User` = '.$Filter['User'].')';
    242242    */
    243243
     
    246246    $Output .= '</form><br/>';
    247247    $Filter['Output'] = $Output;
    248     return($Filter);
     248    return $Filter;
    249249  }
    250250
     
    289289
    290290    $DbResult = $this->Database->query($Query.' '.$Order['SQL'].' '.$PageList['SQLLimit']);
    291     while($Line = $DbResult->fetch_assoc())
     291    while ($Line = $DbResult->fetch_assoc())
    292292    {
    293293      $Output .= '<tr><td><a href="'.$this->System->Link('/form.php?group='.$Filter['Group'].'&amp;ID='.$Line['ID']).'">'.$Line['ID'].'</a></td>'.
     
    305305    $Output .= '</table>'.
    306306        $PageList['Output'];
    307     return($Output);
     307    return $Output;
    308308  }
    309309
     
    316316    $Output .= '<table class="BaseTable"><tr><th>'.T('Group').'</th><th>'.T('Count').'</th></tr>';
    317317    $Total = 0;
    318     foreach($TranslationTree as $Group)
    319       if($Group['TablePrefix'] != '')
     318    foreach ($TranslationTree as $Group)
     319      if ($Group['TablePrefix'] != '')
    320320      {
    321321        $Filter = $this->ShowFilter($Group['Id']);
     
    328328      $Output .= '<tr><td><strong>'.T('Total').'</strong></td><td><strong>'.$Total.'</strong></td></tr>'.
    329329          '</table>';
    330       return($Output);
     330      return $Output;
    331331  }
    332332
     
    336336
    337337    $GroupId = GetParameter('group', 0, true);
    338     if($GroupId == 0) $Output = ShowMessage('Skupina nenalezena', MESSAGE_CRITICAL);
     338    if ($GroupId == 0) $Output = ShowMessage('Skupina nenalezena', MESSAGE_CRITICAL);
    339339    else {
    340340      $Table = $TranslationTree[$GroupId]['TablePrefix'];
     
    351351          '<td>'.T('Texts marked as unfinished').'</td></tr>';
    352352
    353       if($this->System->User->Licence(LICENCE_USER))
     353      if ($this->System->User->Licence(LICENCE_USER))
    354354      {
    355355        $Output .= '<tr><td><a title="'.T('Unfinished texts').'" href="?group='.$GroupId.'&amp;state=3&amp;user='.$this->System->User->Id.'">'.T('My unfinished').'</a></td>
     
    373373      $Output .= '</table>';
    374374    }
    375     return($Output);
     375    return $Output;
    376376  }
    377377
     
    380380    $this->Title = T('Translation groups');
    381381    $Action = GetParameter('action', '');
    382     if($Action == 'filter') $Output = $this->ShowMenu();
     382    if ($Action == 'filter') $Output = $this->ShowMenu();
    383383    else
    384384    {
    385385      $Filter = $this->ShowFilter();
    386       if($Filter['Group'] > 0) $Output = $this->ShowTranslationList($Filter);
     386      if ($Filter['Group'] > 0) $Output = $this->ShowTranslationList($Filter);
    387387        else $Output = $this->ShowGroupList($Filter);
    388388    }
    389     return($Output);
     389    return $Output;
    390390  }
    391391}
     
    409409      array('Name' => 'LastVersion', 'Title' => T('Version of last import')),
    410410   );
    411    if($this->System->User->Licence(LICENCE_ADMIN))
     411   if ($this->System->User->Licence(LICENCE_ADMIN))
    412412   $TableColumns[] = array('Name' => '', 'Title' => T('Actions'));
    413413
     
    416416
    417417   $DbResult = $this->Database->query('SELECT * FROM `Group`'.$Order['SQL'].$PageList['SQLLimit']);
    418    while($Group = $DbResult->fetch_assoc())
     418   while ($Group = $DbResult->fetch_assoc())
    419419   {
    420420     $Output .= '<tr><td><a href="'.$this->System->Link('/TranslationList.php?group='.$Group['Id'].'&amp;action=filter').'">'.T($Group['Name']).'</a></td>'.
    421421       '<td>'.$Group['SourceType'].'</td><td>';
    422      if($Group['MangosTable'] != '') $Output .= $Group['MangosTable'].'.sql ';
    423      if($Group['DBCFileName'] != '') $Output .= $Group['DBCFileName'].'.dbc ';
    424      if($Group['LuaFileName'] != '') $Output .= $Group['LuaFileName'].'.lua ';
     422     if ($Group['MangosTable'] != '') $Output .= $Group['MangosTable'].'.sql ';
     423     if ($Group['DBCFileName'] != '') $Output .= $Group['DBCFileName'].'.dbc ';
     424     if ($Group['LuaFileName'] != '') $Output .= $Group['LuaFileName'].'.lua ';
    425425     $Output .= '</td>';
    426      if($this->System->User->Licence(LICENCE_ADMIN))
     426     if ($this->System->User->Licence(LICENCE_ADMIN))
    427427       $Output .= '<td><a title="Změny po posledním importu u vybrané překladové skupiny" href="'.$this->System->Link('/log/?group='.
    428428     $Group['Id'].'&amp;type=11').'">'.HumanDate($Group['LastImport']).'</a></td>';
     
    430430     $Output .= '<td><a href="'.$this->System->Link('/client-version/?action=item&amp;id='.
    431431       GetVersionWOWId($Group['LastVersion'])).'">'.GetVersionWOW($Group['LastVersion']).'</a></td>';
    432      if($this->System->User->Licence(LICENCE_ADMIN))
     432     if ($this->System->User->Licence(LICENCE_ADMIN))
    433433       $Output .= '<td><a href="?action=groupdelete&amp;id='.$Group['Id'].'">'.T('Remove').'</a></td>';
    434434     $Output .= '</tr>';
     
    436436    $Output .= '</table>'.
    437437      '<br /><a title="'.T('Changelog of changes after import').'" href="'.$this->System->Link('/log/?type=11').'">'.T('Changelog of text modification during import').'</a><br/>';
    438     if($this->System->User->Licence(LICENCE_ADMIN)) $Output .= '<a href="?action=groupadd">'.T('Add translation group').'</a>';
    439     return($Output);
     438    if ($this->System->User->Licence(LICENCE_ADMIN)) $Output .= '<a href="?action=groupadd">'.T('Add translation group').'</a>';
     439    return $Output;
    440440  }
    441441
    442442  function ShowGroupAdd()
    443443  {
    444     if($this->System->User->Licence(LICENCE_ADMIN))
     444    if ($this->System->User->Licence(LICENCE_ADMIN))
    445445    {
    446446      $Output = '<h3>Vložení nové překladové skupiny</h3>'.
     
    452452          '</table></form>';
    453453    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    454     return($Output);
     454    return $Output;
    455455  }
    456456
    457457  function ShowGroupAddFinish()
    458458  {
    459     if($this->System->User->Licence(LICENCE_ADMIN))
     459    if ($this->System->User->Licence(LICENCE_ADMIN))
    460460    {
    461461      $TableName = 'Text'.$_POST['TablePrefix'];
    462462      $DbResult = $this->System->Database->select('Group', 'Id', 'TablePrefix="'.$TableName.'"');
    463       if($DbResult->num_rows == 0)
     463      if ($DbResult->num_rows == 0)
    464464      {
    465465
     
    500500      $Output .= $this->ShowList();
    501501    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    502     return($Output);
     502    return $Output;
    503503  }
    504504
    505505  function ShowGroupDelete()
    506506  {
    507     if($this->System->User->Licence(LICENCE_ADMIN))
     507    if ($this->System->User->Licence(LICENCE_ADMIN))
    508508    {
    509509      $DbResult = $this->System->Database->select('Group', '*', '`Id`='.$_GET['id']);
    510       if($DbResult->num_rows == 1)
     510      if ($DbResult->num_rows == 1)
    511511      {
    512512        $Group = $DbResult->fetch_assoc();
     
    518518    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    519519    $Output .= $this->ShowList();
    520     return($Output);
     520    return $Output;
    521521  }
    522522
     
    525525    $this->Title = T('Translation groups');
    526526    $Action = GetParameter('action', '');
    527     if($Action == 'groupadd') $Output = $this->ShowGroupAdd();
    528     else if($Action == 'groupdelete') $Output = $this->ShowGroupDelete();
    529     else if($Action == 'groupaddfinish') $Output = $this->ShowGroupAddFinish();
     527    if ($Action == 'groupadd') $Output = $this->ShowGroupAdd();
     528    else if ($Action == 'groupdelete') $Output = $this->ShowGroupDelete();
     529    else if ($Action == 'groupaddfinish') $Output = $this->ShowGroupAddFinish();
    530530    else $Output = $this->ShowList();
    531     return($Output);
     531    return $Output;
    532532  }
    533533}
  • trunk/Modules/Translation/UserLevel.php

    r859 r880  
    1111  $Diakrit = array("á","č","ď","é","ě","í","ľ","ň","ó","ř","š","ť","ú",
    1212  "ů","ý","ž","Á","Č","Ď","É","Ě","Í","Ľ","Ň","Ó","Ř","Š","Ť","Ú","Ů","Ý","Ž");
    13   for($i = 0; $i < count($Diakrit); $i = $i + 1)
     13  for ($i = 0; $i < count($Diakrit); $i = $i + 1)
    1414  {
    15     if(strpos($Word, $Diakrit[$i]) <> false)
     15    if (strpos($Word, $Diakrit[$i]) <> false)
    1616      $Result = true;
    1717  }
    18   return($Result);
     18  return $Result;
    1919}
    2020
     
    2626
    2727  $xp = 0;
    28   foreach($TranslationTree as $Group)
     28  foreach ($TranslationTree as $Group)
    2929  {
    30     if($Group['TablePrefix'] != '')
     30    if ($Group['TablePrefix'] != '')
    3131    {
    3232      $GroupBy = 'GROUP BY ';
    3333      $TakeColumns = '';
    34       foreach($TranslationTree[$Group['Id']]['Items'] as $Index => $TextItem)
     34      foreach ($TranslationTree[$Group['Id']]['Items'] as $Index => $TextItem)
    3535      {
    3636        $GroupBy .= '`T`.`'.$TextItem['Column'].'`, ';
     
    4242        'LEFT JOIN `'.$Group['TablePrefix'].'` AS `T2` ON `T2`.`ID` = `T`.`Take` '.
    4343        'WHERE (`T`.`User` = '.$UserId.') AND (`T`.`Complete` = 1) AND (`T`.`Take` IS NOT NULL) '.$GroupBy);
    44       while($Line = $IDtran->fetch_array())
     44      while ($Line = $IDtran->fetch_array())
    4545      {
    4646        $xp_translation = 0;
    4747        $translated = true;
    48         foreach($TranslationTree[$Group['Id']]['Items'] as $Index => $TextItem)
     48        foreach ($TranslationTree[$Group['Id']]['Items'] as $Index => $TextItem)
    4949        {
    50           if(($Line[$TextItem['Column']] <> $Line[$TextItem['Column'].'_Take']) and
     50          if (($Line[$TextItem['Column']] <> $Line[$TextItem['Column'].'_Take']) and
    5151            (strlen($Line[$TextItem['Column']]) > (strlen($Line[$TextItem['Column'].'_Take']) * 0.5)))
    5252          {
    5353            $TextArr = explode(' ', $Line[$TextItem['Column']]);
    54             foreach($TextArr as $Word)
     54            foreach ($TextArr as $Word)
    5555            {
    56               if(CheckDiakrit($Word)) $indikator = $from_diakrit;
     56              if (CheckDiakrit($Word)) $indikator = $from_diakrit;
    5757                else $indikator = 1;
    5858              $xp_translation = $xp_translation + ($indikator * $xp_from_word);
     
    6565          }
    6666        }
    67         if($translated) $xp = $xp + $xp_translation;   // XP addition for entire translation if complete translated
     67        if ($translated) $xp = $xp + $xp_translation;   // XP addition for entire translation if complete translated
    6868      }
    6969    }
    7070  }
    71   return($xp);
     71  return $xp;
    7272}
    7373
     
    7979  // Main code for users
    8080  $DbResult = $System->Database->query('SELECT `ID`, `Name` FROM `User` WHERE `Id` = '.$UserId);
    81   if($DbResult->num_rows > 0)
     81  if ($DbResult->num_rows > 0)
    8282  {
    83     while($LineUser = $DbResult->fetch_array())
     83    while ($LineUser = $DbResult->fetch_array())
    8484    {
    8585      // Build TranslatedCount query
    8686      $TranslatedCount = '(';
    87       if(count($TranslationTree) > 0)
     87      if (count($TranslationTree) > 0)
    8888      {
    89       foreach($TranslationTree as $Group)
    90         if($Group['TablePrefix'] != '')
     89      foreach ($TranslationTree as $Group)
     90        if ($Group['TablePrefix'] != '')
    9191        {
    9292          $Count = '(SELECT COUNT(*) FROM `'.$Group['TablePrefix'].'` WHERE (`Complete` = 1) AND (`Language` <> '.
  • trunk/Modules/User/Options.php

    r861 r880  
    1717        '<option value="0">'.T('Nowhere').'</option>'.
    1818        '<option value="1"';
    19     if($this->System->User->Redirecting == '1') $Output .= ' selected="selected"';
     19    if ($this->System->User->Redirecting == '1') $Output .= ' selected="selected"';
    2020    $Output .= '>'.T('To untranslated').'</option>';
    2121    $Output .= '<option value="2"';
    22     if($this->System->User->Redirecting == '2') $Output .= ' selected="selected"';
     22    if ($this->System->User->Redirecting == '2') $Output .= ' selected="selected"';
    2323    $Output .= '>'.T('To next translation').'</option>';
    2424    $Output .= '<option value="3"';
    25     if($this->System->User->Redirecting == '3') $Output .= ' selected="selected"';
     25    if ($this->System->User->Redirecting == '3') $Output .= ' selected="selected"';
    2626    $Output .= '>'.T('To previous translation').'</option>';
    2727    $Output .= '</select>';
     
    6060        '<input type="hidden" name="action" value="gointeam"/>'.
    6161        '<select name="id">';
    62     while($LineTeam = $DbResult->fetch_assoc())
     62    while ($LineTeam = $DbResult->fetch_assoc())
    6363    {
    6464      $Output .= '<option value="'.$LineTeam['Id'].'"';
     
    6969    </form>';
    7070    $Output .= '</fieldset>';
    71     return($Output);
     71    return $Output;
    7272  }
    7373
     
    7575  {
    7676    $Output = '';
    77     if(array_key_exists('Email', $_POST))
     77    if (array_key_exists('Email', $_POST))
    7878    {
    7979      $Email = $_POST['Email'];
     
    8484      $Redirecting = $_POST['redirecting'];
    8585      $PreferredVersion = $_POST['ClientVersion'];
    86       if($PreferredVersion == '') $PreferredVersion = null;
     86      if ($PreferredVersion == '') $PreferredVersion = null;
    8787      $Info = $_POST['info'];
    8888
    8989      // Do user want to change password?
    90       if(($OldPass != '') or ($NewPass != '') or ($NewPass2 != ''))
     90      if (($OldPass != '') or ($NewPass != '') or ($NewPass2 != ''))
    9191      {
    92         if($NewPass == $NewPass2)
     92        if ($NewPass == $NewPass2)
    9393        {
    9494          $DbResult = $this->System->Database->query('SELECT `Pass`, '.$this->System->User->CryptPasswordSQL('"'.$OldPass.'"', '`Salt`').' AS `Hash` FROM `User` WHERE `ID`= '.$this->System->User->Id);
    9595          $DbRow = $DbResult->fetch_assoc();
    96           if($DbRow['Hash'] == $DbRow['Pass'])
     96          if ($DbRow['Hash'] == $DbRow['Pass'])
    9797          {
    9898            // Update password
     
    130130      $this->System->User->Load();
    131131    } else $Output .= ShowMessage('Nezadány údaje.', MESSAGE_CRITICAL);
    132     return($Output);
     132    return $Output;
    133133  }
    134134
     
    137137    $this->Title = T('User settings');
    138138    $Output = '';
    139     if($this->System->User->Licence(LICENCE_USER))
     139    if ($this->System->User->Licence(LICENCE_USER))
    140140    {
    141       if(array_key_exists('action', $_GET) and ($_GET['action'] == 'save'))
     141      if (array_key_exists('action', $_GET) and ($_GET['action'] == 'save'))
    142142      {
    143143        $Output .= $this->UserOptionsSave();
     
    145145      $Output .= $this->UserOptionsFrom();
    146146    } else $Output .= ShowMessage('Nejste přihlášený.', MESSAGE_CRITICAL);
    147     return($Output);
     147    return $Output;
    148148  }
    149149}
  • trunk/Modules/User/Profile.php

    r861 r880  
    66  {
    77    $Output = '';
    8     if(array_key_exists('text', $_POST))
    9     if($this->System->User->Licence(LICENCE_ADMIN))
     8    if (array_key_exists('text', $_POST))
     9    if ($this->System->User->Licence(LICENCE_ADMIN))
    1010    {
    1111      $Text = $_POST['text'];
     
    1616        'Text: <strong>'.$Text.'</strong><br />';
    1717
    18       if(@mail($Email, $Subject, $Text, 'From: '.$this->System->Config['Web']['AdminEmail'].
     18      if (@mail($Email, $Subject, $Text, 'From: '.$this->System->Config['Web']['AdminEmail'].
    1919        '\nReply-To: '.$this->System->Config['Web']['AdminEmail'].'\nX-Mailer: PHP/'))
    2020      {
     
    2323      else $Output .= ShowMessage('Nepodařilo se odesat E-mail.', MESSAGE_CRITICAL);
    2424    } else $Output .= ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    25     return($Output);
     25    return $Output;
    2626  }
    2727
     
    5757      '(SELECT COUNT(*) FROM `ExportUser` WHERE `ExportUser`.`Export`=`Export`.`Id`) AS `UserCount` FROM `Export` '.
    5858      'LEFT JOIN `User` ON `User`.`ID`=`Export`.`User` '.$Filter.$Order['SQL'].$PageList['SQLLimit']);
    59     while($Export = $DbResult->fetch_assoc())
     59    while ($Export = $DbResult->fetch_assoc())
    6060    {
    6161      $Action = '<a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$Export['Id'].'&amp;Tab=0').'">'.T('Show').'</a> '.
    6262        '<a href="'.$this->System->Link('/export/?Action=View&amp;ExportId='.$Export['Id'].'&amp;Tab=7').'">'.T('Export').'</a>';
    63       if($Export['User'] == $this->System->User->Id) $Action .= ' <a href="?Action=Delete&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Really remove item?').'\');">'.T('Remove').'</a>';
    64       if($this->System->User->Id != null) $Action .= ' <a href="'.$this->System->Link('/export/?Action=Clone&amp;ExportId='.$Export['Id']).'" onclick="return confirmAction(\''.T('Really clone item?').'\');">'.T('Clone').'</a>';
     63      if ($Export['User'] == $this->System->User->Id) $Action .= ' <a href="?Action=Delete&amp;ExportId='.$Export['Id'].'" onclick="return confirmAction(\''.T('Really remove item?').'\');">'.T('Remove').'</a>';
     64      if ($this->System->User->Id != null) $Action .= ' <a href="'.$this->System->Link('/export/?Action=Clone&amp;ExportId='.$Export['Id']).'" onclick="return confirmAction(\''.T('Really clone item?').'\');">'.T('Clone').'</a>';
    6565      $Output .= '<tr><td>'.HumanDate($Export['TimeCreate']).'</td>'.
    6666        '<td>'.htmlspecialchars($Export['Title']).'</td>'.
     
    7474
    7575    $Output .= '<div style="text-align: center;"><a href="'.$this->System->Link('/export/').'">'.T('Export page').'</a></div>';
    76     return($Output);
     76    return $Output;
    7777  }
    7878
     
    8686    $UnionItems = array();
    8787    $DbResult = $this->Database->query($GroupListQuery);
    88     if($DbResult->num_rows > 0)
    89     {
    90       while($DbRow = $DbResult->fetch_assoc())
     88    if ($DbResult->num_rows > 0)
     89    {
     90      while ($DbRow = $DbResult->fetch_assoc())
    9191      {
    9292        $UnionItems[] = 'SELECT `T`.`ID`, `T`.`Take`, `T`.`User`, `T`.`ModifyTime`, `T`.`Group`, `T`.`GroupName` '.
     
    106106      $Output .= '<table class="BaseTable"><tr>'.
    107107        '<th>'.T('Date').'</th><th>'.T('New').'</th><th>'.T('Source').'</th><th>'.T('Group').'</th></tr>';
    108       while($DbRow = $DbResult->fetch_assoc())
     108      while ($DbRow = $DbResult->fetch_assoc())
    109109      {
    110110        $Output .= '<tr><td>'.HumanDate($DbRow['ModifyTime']).'</td>'.
     
    115115      $Output .= '</table>';
    116116    }
    117     return($Output);
     117    return $Output;
    118118  }
    119119
     
    130130      'JOIN `ForumThread` ON `ForumThread`.`ID` = `ForumText`.`Thread` '.
    131131      'WHERE `ForumText`.`User` = '.($_GET['user'] * 1).' ORDER BY `ForumText`.`Date` DESC LIMIT '.$Count);
    132     while($Line = $DbResult->fetch_assoc())
     132    while ($Line = $DbResult->fetch_assoc())
    133133      $Output .= '<div><a href="'.$this->System->Link('/forum/?Thread='.$Line['Thread']).'">'.htmlspecialchars($Line['ThreadName']).'</a><br />'.
    134134        '<strong>'.$Line['UserName'].'</strong> ('.HumanDate($Line['Date']).'): '.$parser->qparse(htmlspecialchars($Line['Text'])).'</div> ';
    135135    $Output .= '</div>';
    136     return($Output);
     136    return $Output;
    137137  }
    138138
     
    151151      'WHERE `User`.`Id` = '.($_GET['user'] * 1);
    152152    $DbResult = $this->Database->query($Query);
    153     if($DbResult->num_rows > 0)
     153    if ($DbResult->num_rows > 0)
    154154    {
    155155      $UserLine = $DbResult->fetch_array();
     
    163163        T('Number of translated:').' <a href="'.$this->System->Link('/TranslationList.php?user='.$UserLine['ID'].'&amp;state=2&amp;group=0').'" title="Zobrazit Všechny jeho přeložené texty"><strong>'.$UserLine['TranslatedCount'].'</strong></a><br />'.
    164164        T('Level:').' <strong>'.$XP['Level'].'</strong> '.T('experience:').' '.ProgressBar(150, round($XP['XP'] / $XP['MaxXP'] * 100, 2), $XP['XP'].' / '.$XP['MaxXP']).'<br/>';
    165       if($this->System->ModuleManager->ModuleRunning('Team') and ($UserLine['TeamName'] != ''))
     165      if ($this->System->ModuleManager->ModuleRunning('Team') and ($UserLine['TeamName'] != ''))
    166166        $Output .= T('Member of team:').' <a href="'.$this->System->Link('/team/?action=team&amp;id='.$UserLine['Team']).'"><strong>'.htmlspecialchars($UserLine['TeamName']).'</strong></a><br />';
    167167
     
    187187      '</tr></table>';
    188188    $Output .= '<br />'.$this->ShowLastForum().'<br />';
    189     if($this->System->User->Licence(LICENCE_MODERATOR))
     189    if ($this->System->User->Licence(LICENCE_MODERATOR))
    190190    {
    191191      $Output .= '<fieldset><legend>Moderování</legend>';
     
    243243      }
    244244    } else $Output .= ShowMessage('Uživatel nenalezen', MESSAGE_CRITICAL);
    245     return($Output);
     245    return $Output;
    246246  }
    247247
     
    250250    $this->Title = T('User profile');
    251251    $Output = $this->SendMail();
    252     if(array_key_exists('user', $_GET))
     252    if (array_key_exists('user', $_GET))
    253253    {
    254254      $Output .= $this->ShowProfile();
    255255    } else $Output .= ShowMessage('Nevybrán uživatel', MESSAGE_CRITICAL);
    256     return($Output);
     256    return $Output;
    257257  }
    258258}
  • trunk/Modules/User/Registration.php

    r861 r880  
    55  function ShowForm()
    66  {
    7     if(array_key_exists('sc', $_POST)) $Human = true;
     7    if (array_key_exists('sc', $_POST)) $Human = true;
    88      else $Human = false;
    9     if(array_key_exists('user', $_POST)) $UserName = $_POST['user'];
     9    if (array_key_exists('user', $_POST)) $UserName = $_POST['user'];
    1010      else $UserName = '';
    11     if(array_key_exists('Email', $_POST)) $Email = $_POST['Email'];
     11    if (array_key_exists('Email', $_POST)) $Email = $_POST['Email'];
    1212      else $Email = '';
    13     if(array_key_exists('Team', $_POST)) $Team = $_POST['Team'];
     13    if (array_key_exists('Team', $_POST)) $Team = $_POST['Team'];
    1414      else $Team = '';
    15     if(array_key_exists('Language', $_POST)) $Language = $_POST['Language'];
     15    if (array_key_exists('Language', $_POST)) $Language = $_POST['Language'];
    1616      else $Language = 1;
    1717
     
    2424    <tr>
    2525    <th class="Left">'.T('Are you human?').'</th>';
    26     if($Human) $Checked = ' checked="checked"';
     26    if ($Human) $Checked = ' checked="checked"';
    2727      else $Checked = '';
    2828    $Output .= '<td><input type="checkbox" name="sc" '.$Checked.'/></td>
     
    5050    <tr>
    5151    <th class="Left">'.T('I belong to team').':</th>';
    52     if($Team == '') $Selected = ' selected="selected"';
     52    if ($Team == '') $Selected = ' selected="selected"';
    5353      else $Selected = '';
    5454    $Output .= '<td><select name="Team"><option value="0"'.$Selected.'>'.T('none').'</option>';
    5555    $DbResult = $this->Database->query('SELECT `Name`, `Id` FROM `Team`');
    56     while($Line = $DbResult->fetch_assoc())
     56    while ($Line = $DbResult->fetch_assoc())
    5757    {
    58       if($Team == $Line['Id']) $Selected = ' selected="selected"';
     58      if ($Team == $Line['Id']) $Selected = ' selected="selected"';
    5959      else $Selected = '';
    6060      $Output .= '<option value="0'.$Line['Id'].'"'.$Selected.'>'.htmlspecialchars($Line['Name']).'</option>';
     
    8181    </tr>
    8282    </table></fieldset></form>';
    83     return($Output);
     83    return $Output;
    8484  }
    8585
     
    9191    $ShowForm = true;
    9292
    93       if(array_key_exists('user', $_POST)) $UserName = $_POST['user'];
     93      if (array_key_exists('user', $_POST)) $UserName = $_POST['user'];
    9494        else $UserName = '';
    95       if(array_key_exists('pass', $_POST)) $Pass = $_POST['pass'];
     95      if (array_key_exists('pass', $_POST)) $Pass = $_POST['pass'];
    9696        else $Pass = '';
    97       if(array_key_exists('pass2', $_POST)) $Pass2 = $_POST['pass2'];
     97      if (array_key_exists('pass2', $_POST)) $Pass2 = $_POST['pass2'];
    9898        else $Pass2 = '';
    99       if(array_key_exists('Email', $_POST)) $Email = $_POST['Email'];
     99      if (array_key_exists('Email', $_POST)) $Email = $_POST['Email'];
    100100        else $Email = '';
    101       if(array_key_exists('Team', $_POST)) $Team = $_POST['Team'] * 1;
     101      if (array_key_exists('Team', $_POST)) $Team = $_POST['Team'] * 1;
    102102        else $Team = '';
    103       if(array_key_exists('Language', $_POST)) $Language = $_POST['Language'] * 1;
     103      if (array_key_exists('Language', $_POST)) $Language = $_POST['Language'] * 1;
    104104        else $Language = '';
    105       if(array_key_exists('ClientVersion', $_POST)) $PreferredVersion = $_POST['ClientVersion'] * 1;
     105      if (array_key_exists('ClientVersion', $_POST)) $PreferredVersion = $_POST['ClientVersion'] * 1;
    106106        else $PreferredVersion = '';
    107       if($PreferredVersion == '') $PreferredVersion = 'NULL';
    108       if(array_key_exists('sc', $_POST)) $SpamCheck = $_POST['sc'];
     107      if ($PreferredVersion == '') $PreferredVersion = 'NULL';
     108      if (array_key_exists('sc', $_POST)) $SpamCheck = $_POST['sc'];
    109109        else $SpamCheck = '';
    110110
    111       if($SpamCheck != '')
     111      if ($SpamCheck != '')
    112112      {
    113         if(($UserName != '') and ($Pass != '') and ($Pass2 != ''))
     113        if (($UserName != '') and ($Pass != '') and ($Pass2 != ''))
    114114        {
    115           if(!in_array(strtolower($UserName), $Config['ForbiddedUserNames']))
     115          if (!in_array(strtolower($UserName), $Config['ForbiddedUserNames']))
    116116          {
    117             if($Pass == $Pass2)
     117            if ($Pass == $Pass2)
    118118            {
    119119              $DbResult = $this->Database->query('SELECT * FROM `User` WHERE LOWER(`Name`) = LOWER("'.$UserName.'")');
    120120              $Line = $DbResult->fetch_row();
    121               if(!$Line)
     121              if (!$Line)
    122122              {
    123                 if($Team == 0) $Team = 'NULL';
     123                if ($Team == 0) $Team = 'NULL';
    124124                $this->System->User->Register($UserName, $Pass, $Email, $Language, $Team, $PreferredVersion);
    125125                $Output .= ShowMessage(T('Registration was successful'));
     
    154154      } else $Output = ShowMessage('Nejsi člověk. Strojům není dovoleno se registrovat.', MESSAGE_CRITICAL);
    155155
    156       if($ShowForm) $Output .= $this->ShowForm();
    157       return($Output);
     156      if ($ShowForm) $Output .= $this->ShowForm();
     157      return $Output;
    158158  }
    159159
     
    162162    $this->Title = T('User registration');
    163163    $Output = '';
    164     if(array_key_exists('user', $_POST))
     164    if (array_key_exists('user', $_POST))
    165165    {
    166166      $Output .= $this->CheckRegistration();
    167167    } else $Output .= $this->ShowForm();
    168     return($Output);
     168    return $Output;
    169169  }
    170170}
  • trunk/Modules/User/User.php

    r871 r880  
    3434      'Icon' => '',
    3535    ), 0);
    36     if(array_key_exists('Search', $this->System->ModuleManager->Modules))
     36    if (array_key_exists('Search', $this->System->ModuleManager->Modules))
    3737      $this->System->ModuleManager->Modules['Search']->RegisterSearch('user',
    3838      T('Translators'), array('Name'), '`User`', $this->System->Link('/users/?search='));
     
    4949      'WHERE (`ActivityTime` >= NOW() - 300) '.
    5050      'ORDER BY `ActivityTime` DESC ) AS `T` GROUP BY `Name`');
    51     while($DbUser = $DbResult->fetch_assoc())
     51    while ($DbUser = $DbResult->fetch_assoc())
    5252    {
    5353      $Name = '<a href="'.$this->System->Link('/user/?user='.$DbUser['ID']).'">'.$DbUser['Name'].'</a>';
    5454      $Output .= $Name.'<br />';
    5555    }
    56     return($Output);
     56    return $Output;
    5757  }
    5858
     
    6060  {
    6161    $Output = '';
    62     if($this->System->User->Licence(LICENCE_USER))
     62    if ($this->System->User->Licence(LICENCE_USER))
    6363    {
    6464      //$DbResult =$this->Database->query('SELECT `Id`, `Name` FROM `Team` WHERE `Id`='.$this->System->User->Team);
     
    7979        '<a href="'.$this->System->Link('/registration/').'">'.T('Registration').'</a>';
    8080    }
    81     return($Output);
     81    return $Output;
    8282  }
    8383}
     
    104104      </table>
    105105      </fieldset></form>';
    106       return($Output);
     106      return $Output;
    107107  }
    108108}
     
    132132    $this->Database = &$System->Database;
    133133    $this->OnlineStateTimeout = 600; // in seconds
    134     if(isset($_SESSION)) $this->Check();
     134    if (isset($_SESSION)) $this->Check();
    135135  }
    136136
     
    144144    $DbResult = $this->Database->query('SELECT `ID` FROM `User` WHERE '.
    145145      'LOWER(`Name`) = LOWER("'.$Name.'") AND `Pass` = '.$this->CryptPasswordSQL('"'.$Password.'"', '`Salt`'));
    146     if($DbResult->num_rows > 0)
     146    if ($DbResult->num_rows > 0)
    147147    {
    148148      $User = $DbResult->fetch_assoc();
     
    151151      // Prepare cookies for permanent login
    152152      $StayLoggedSalt = $this->GetPasswordSalt();
    153       if($StayLogged == true) $StayLoggedValue = 1; else $StayLoggedValue = 0;
     153      if ($StayLogged == true) $StayLoggedValue = 1; else $StayLoggedValue = 0;
    154154      $this->Database->update('UserOnline', '`SessionId`="'.$SID.'"', array(
    155155        'User' => $User['ID'], 'StayLogged' => $StayLoggedValue, 'StayLoggedHash' => $StayLoggedSalt));
    156       if($StayLogged)
     156      if ($StayLogged)
    157157      {
    158158        setcookie('LoginUserId', $User['ID'], time() + 365 * 24 * 60 * 60);
     
    176176  {
    177177    $SID = session_id();
    178     if($this->Role != LICENCE_ANONYMOUS)
     178    if ($this->Role != LICENCE_ANONYMOUS)
    179179    {
    180180      $this->Database->update('UserOnline', '`SessionId`="'.$SID.'"', array('User' => null));
     
    192192    'LEFT JOIN `ClientVersion` ON `ClientVersion`.`Id` = `User`.`PreferredVersion` '.
    193193    'WHERE `User`.`ID` = '.$this->Id);
    194     if($DbResult->num_rows > 0)
     194    if ($DbResult->num_rows > 0)
    195195    {
    196196      $User = $DbResult->fetch_assoc();
     
    222222  function Licence($Licence)
    223223  {
    224     if(GetRemoteAddress() == '') return(true); // Execution from command line
    225       else return($this->Role >= $Licence);
     224    if (GetRemoteAddress() == '') return true; // Execution from command line
     225      else return $this->Role >= $Licence;
    226226  }
    227227
     
    229229  {
    230230    $DbResult = $this->Database->select('APIToken', 'User', '`Token`="'.$Token.'"');
    231     if($DbResult->num_rows > 0)
     231    if ($DbResult->num_rows > 0)
    232232    {
    233233      $DbRow = $DbResult->fetch_assoc();
    234234      $DbResult2 = $this->Database->select('User', 'GM', '`ID`="'.$DbRow['User'].'"');
    235235      $DbRow2 = $DbResult2->fetch_assoc();
    236       return($DbRow2['GM'] >= $Licence);
    237     } else return(false);
     236      return $DbRow2['GM'] >= $Licence;
     237    } else return false;
    238238  }
    239239
    240240  function GetPasswordSalt()
    241241  {
    242     return(substr(sha1(mt_rand()), 0, 8));
     242    return substr(sha1(mt_rand()), 0, 8);
    243243  }
    244244
    245245  function CryptPasswordSQL($Password, $Salt)
    246246  {
    247     return('SHA1(CONCAT(SHA1('.$Password.'), '.$Salt.'))');
     247    return 'SHA1(CONCAT(SHA1('.$Password.'), '.$Salt.'))';
    248248  }
    249249
     
    253253    // Lookup user record
    254254    $Query = $this->Database->select('UserOnline', '*', 'SessionId="'.$SID.'"');
    255     if($Query->num_rows > 0)
     255    if ($Query->num_rows > 0)
    256256    {
    257257      // Refresh time of last access
    258258      $this->Database->update('UserOnline', 'SessionId="'.$SID.'"', array('ActivityTime' => 'NOW()'));
    259259    } else {
    260       if(GetRemoteAddress() != '') $HostName = gethostbyaddr(GetRemoteAddress());
     260      if (GetRemoteAddress() != '') $HostName = gethostbyaddr(GetRemoteAddress());
    261261        else $HostName = '';
    262262      $this->Database->insert('UserOnline', array('SessionId' => $SID,
     
    267267
    268268    // Logged permanently?
    269     if(array_key_exists('LoginHash', $_COOKIE))
     269    if (array_key_exists('LoginHash', $_COOKIE))
    270270    {
    271271      $DbResult = $this->Database->query('SELECT * FROM `UserOnline` WHERE `User`='.$_COOKIE['LoginUserId'].
    272272        ' AND `StayLogged`=1 AND SessionId!="'.$SID.'"');
    273       if($DbResult->num_rows > 0)
     273      if ($DbResult->num_rows > 0)
    274274      {
    275275        $DbRow = $DbResult->fetch_assoc();
    276         if(sha1($_COOKIE['LoginUserId'].$DbRow['StayLoggedHash']) == $_COOKIE['LoginHash'])
     276        if (sha1($_COOKIE['LoginUserId'].$DbRow['StayLoggedHash']) == $_COOKIE['LoginHash'])
    277277        {
    278278          $this->Database->query('DELETE FROM `UserOnline` WHERE `SessionId`="'.$SID.'"');
     
    285285    $Query = $this->Database->select('UserOnline', '*', '`SessionId`="'.$SID.'"');
    286286    $Row = $Query->fetch_assoc();
    287     if($Row['User'] != '')
     287    if ($Row['User'] != '')
    288288    {
    289289      $this->Id = $Row['User'];
     
    296296    // Remove nonactive users
    297297    $DbResult = $this->Database->select('UserOnline', '`Id`, `User`', '(`ActivityTime` < DATE_SUB(NOW(), INTERVAL '.$this->OnlineStateTimeout.' SECOND)) AND (`StayLogged` = 0)');
    298     while($DbRow = $DbResult->fetch_array())
     298    while ($DbRow = $DbResult->fetch_array())
    299299    {
    300300      $this->Database->delete('UserOnline', 'Id='.$DbRow['Id']);
     
    305305  {
    306306    $Salt = $this->GetPasswordSalt();
    307     if($Team == null) $Team = 'NULL';
    308     if($PreferredVersion == null) $PreferredVersion = 'NULL';
     307    if ($Team == null) $Team = 'NULL';
     308    if ($PreferredVersion == null) $PreferredVersion = 'NULL';
    309309    $this->Database->query('INSERT INTO `User` '.
    310310      '(`Name` , `Pass` , `Salt`, `Email` , `Language` , `Team` , `NeedUpdate`, `RegistrationTime`, `PreferredVersion` ) '.
  • trunk/Modules/User/UserList.php

    r851 r880  
    77    $this->Title = T('Translators');
    88    $Output = '';
    9     if(array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search'];
    10     else if(!array_key_exists('search', $_SESSION)) $_SESSION['search'] = '';
    11     if(array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = '';
    12     if($_SESSION['search'] != '')
     9    if (array_key_exists('search', $_GET)) $_SESSION['search'] = $_GET['search'];
     10    else if (!array_key_exists('search', $_SESSION)) $_SESSION['search'] = '';
     11    if (array_key_exists('search', $_GET) and ($_GET['search'] == '')) $_SESSION['search'] = '';
     12    if ($_SESSION['search'] != '')
    1313    {
    1414      $SearchQuery = ' AND (`User`.`Name` LIKE "%'.$_SESSION['search'].'%")';
     
    1717
    1818    $TeamFilter = '';
    19     if(array_key_exists('team', $_GET))
     19    if (array_key_exists('team', $_GET))
    2020    {
    2121      $TeamId = $_GET['team'] * 1;
    2222      $DbResult = $this->Database->select('Team', 'Name', '`Id`='.$TeamId);
    23       if($DbResult->num_rows > 0)
     23      if ($DbResult->num_rows > 0)
    2424      {
    2525        $Team = $DbResult->fetch_assoc();
     
    5858
    5959    $DbResult = $this->Database->query($Query);
    60     while($Line = $DbResult->fetch_assoc())
     60    while ($Line = $DbResult->fetch_assoc())
    6161    {
    6262      $XP = GetLevelMinMax($Line['XP']);
     
    7171        $PageList['Output'];
    7272
    73     return($Output);
     73    return $Output;
    7474  }
    7575}
  • trunk/Modules/Wiki/Wiki.php

    r843 r880  
    2222  {
    2323    $DbResult = $this->Database->select('WikiPage', '*', '`VisibleInMenu`=1');
    24     while($DbRow = $DbResult->fetch_assoc())
     24    while ($DbRow = $DbResult->fetch_assoc())
    2525    {
    2626      $this->System->RegisterPage($DbRow['NormalizedName'], 'PageWiki');
     
    4040  function Show()
    4141  {
    42     if(array_key_exists('Action', $_GET))
    43     {
    44       if($_GET['Action'] == 'Edit') $Output = $this->EditContent();
    45       else if($_GET['Action'] == 'EditSave') $Output = $this->SaveContent();
    46       else if($_GET['Action'] == 'History') $Output = $this->ShowHistory();
     42    if (array_key_exists('Action', $_GET))
     43    {
     44      if ($_GET['Action'] == 'Edit') $Output = $this->EditContent();
     45      else if ($_GET['Action'] == 'EditSave') $Output = $this->SaveContent();
     46      else if ($_GET['Action'] == 'History') $Output = $this->ShowHistory();
    4747      else $Output = $this->ShowContent();
    4848    } else $Output = $this->ShowContent();
    49     return($Output);
     49    return $Output;
    5050  }
    5151
     
    5454    $PageName = $this->System->PathItems[count($this->System->PathItems) - 1];
    5555    $DbResult = $this->Database->select('WikiPage', 'Name, Id', 'NormalizedName="'.$PageName.'"');
    56     if($DbResult->num_rows > 0)
     56    if ($DbResult->num_rows > 0)
    5757    {
    5858      $DbRow = $DbResult->fetch_assoc();
    59       if(array_key_exists('ver', $_GET))
     59      if (array_key_exists('ver', $_GET))
    6060      {
    6161        $DbResult2 = $this->Database->select('WikiPageContent', '*', 'Page='.$DbRow['Id'].' AND Id='.$_GET['ver']*1);
    62         if($DbResult2->num_rows > 0)
     62        if ($DbResult2->num_rows > 0)
    6363        {
    6464          $DbRow2 = $DbResult2->fetch_assoc();
    6565          $Output = '<h3>Archív stránky '.$DbRow['Name'].' ('.HumanDateTime($DbRow2['Time']).')</h3>';
    6666          $Output .= $DbRow2['Content'];
    67           if($this->System->User->Licence(LICENCE_MODERATOR))
     67          if ($this->System->User->Licence(LICENCE_MODERATOR))
    6868            $Output .= '<div><a href="?Action=Edit">Upravit nejnovější</a> <a href="?Action=History">Historie</a></div>';
    6969        } else $Output = ShowMessage('Wiki stránka nenalezena', MESSAGE_CRITICAL);
     
    7171      {
    7272        $DbResult2 = $this->Database->select('WikiPageContent', '*', 'Page='.$DbRow['Id'].' ORDER BY Time DESC LIMIT 1');
    73         if($DbResult2->num_rows > 0)
     73        if ($DbResult2->num_rows > 0)
    7474        {
    7575          $DbRow2 = $DbResult2->fetch_assoc();
    7676          $Output = '<h3>'.$DbRow['Name'].'</h3>';
    7777          $Output .= $DbRow2['Content'];
    78           if($this->System->User->Licence(LICENCE_MODERATOR))
     78          if ($this->System->User->Licence(LICENCE_MODERATOR))
    7979            $Output .= '<hr><div><a href="?Action=Edit">Upravit</a> <a href="?Action=History">Historie</a></div>';
    8080        } else $Output = ShowMessage('Wiki stránka nenalezena', MESSAGE_CRITICAL);
    8181      }
    8282    } else $Output = ShowMessage('Wiki stránka nenalezena', MESSAGE_CRITICAL);
    83     return($Output);
     83    return $Output;
    8484  }
    8585
    8686  function EditContent()
    8787  {
    88     if($this->System->User->Licence(LICENCE_MODERATOR))
     88    if ($this->System->User->Licence(LICENCE_MODERATOR))
    8989    {
    9090    $PageName = $this->System->PathItems[count($this->System->PathItems) - 1];
    9191    $DbResult = $this->Database->select('WikiPage', 'Name, Id', 'NormalizedName="'.$PageName.'"');
    92     if($DbResult->num_rows > 0)
     92    if ($DbResult->num_rows > 0)
    9393    {
    9494      $DbRow = $DbResult->fetch_assoc();
    9595      $Output = '<h3>Úprava '.$DbRow['Name'].'</h3>';
    9696      $DbResult2 = $this->Database->select('WikiPageContent', '*', 'Page='.$DbRow['Id'].' ORDER BY Time DESC LIMIT 1');
    97       if($DbResult2->num_rows > 0)
     97      if ($DbResult2->num_rows > 0)
    9898      {
    9999        $DbRow2 = $DbResult2->fetch_assoc();
     
    106106    } else $Output = ShowMessage('Wiki stránka nenalezena', MESSAGE_CRITICAL);
    107107    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    108     return($Output);
     108    return $Output;
    109109  }
    110110
    111111  function SaveContent()
    112112  {
    113     if($this->System->User->Licence(LICENCE_MODERATOR))
     113    if ($this->System->User->Licence(LICENCE_MODERATOR))
    114114    {
    115115    $PageName = $this->System->PathItems[count($this->System->PathItems) - 1];
    116116    $DbResult = $this->Database->select('WikiPage', 'Name, Id', 'NormalizedName="'.$PageName.'"');
    117     if($DbResult->num_rows > 0)
     117    if ($DbResult->num_rows > 0)
    118118    {
    119119      $DbRow = $DbResult->fetch_assoc();
    120       if(array_key_exists('content', $_POST) and array_key_exists('save', $_POST))
     120      if (array_key_exists('content', $_POST) and array_key_exists('save', $_POST))
    121121      {
    122122        $DbResult2 = $this->Database->insert('WikiPageContent', array('Content' => stripslashes($_POST['content']),
     
    127127    } else $Output = ShowMessage('Wiki stránka nenalezena', MESSAGE_CRITICAL);
    128128    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    129     return($Output);
     129    return $Output;
    130130  }
    131131
    132132  function ShowHistory()
    133133  {
    134     if($this->System->User->Licence(LICENCE_MODERATOR))
     134    if ($this->System->User->Licence(LICENCE_MODERATOR))
    135135    {
    136136      $PageName = $this->System->PathItems[count($this->System->PathItems) - 1];
    137137      $DbResult = $this->Database->select('WikiPage', 'Name, Id', 'NormalizedName="'.$PageName.'"');
    138       if($DbResult->num_rows > 0)
     138      if ($DbResult->num_rows > 0)
    139139      {
    140140        $DbRow = $DbResult->fetch_assoc();
     
    160160          ' FROM `WikiPageContent` WHERE Page='.
    161161          $DbRow['Id'].' '.$Order['SQL'].$PageList['SQLLimit']);
    162         while($PageContent = $DbResult2->fetch_assoc())
     162        while ($PageContent = $DbResult2->fetch_assoc())
    163163        {
    164164          $Output .= '<tr>'.
     
    173173      } else $Output = ShowMessage('Wiki stránka nenalezena', MESSAGE_CRITICAL);
    174174    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    175     return($Output);
     175    return $Output;
    176176  }
    177177
     
    200200    $text = str_replace("\r\n", '<br/>', $text);
    201201    $text = '<p>'.$text.'</p>';
    202     return($text);
     202    return $text;
    203203  }
    204204}
Note: See TracChangeset for help on using the changeset viewer.