Ignore:
Timestamp:
Apr 7, 2020, 10:15:48 PM (4 years ago)
Author:
chronos
Message:
  • Modified: Improved code formatting.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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}
Note: See TracChangeset for help on using the changeset viewer.