Ignore:
Timestamp:
Apr 8, 2010, 7:58:16 AM (14 years ago)
Author:
george
Message:
  • Upraveno: Doplněny upravené soubory do vývojové větve CombinedTextTables.
  • Nastavení ignorování obsahu složek s ikonami u AoWoW.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/CombinedTextTables/form.php

    r420 r425  
    55function ColorNames($Text, $names)
    66{
    7  
    8    // $buff[] = array($Line['ID'],GetIDbyName($Table),$Line[$Column],$Line['Tran']);
    9   foreach($names as $Line) {
    10    if ($Line[3] <> '') {
    11      $Text = str_replace($Line[2],'<span Title="Byl nalezen překlad: '.$Line[3].'" class="edit">'.$Line[2].'</span>',$Text);
    12      $Text = str_replace(strtolower($Line[2]),'<span Title="Byl nalezen překlad: '.$Line[3].'" class="edit">'.$Line[2].'</span>',$Text);
    13    } else {
    14        $Text = str_replace($Line[2],'<span Title="Jméno bylo nalezeno v názvech a můžete ho přeložit. Začnete kliknutím na: Vyhledat v názvech" class="edit">'.$Line[2].'</span>',$Text);
    15        $Text = str_replace(strtolower($Line[2]),'<span Title="Jméno bylo nalezeno v názvech a můžete ho přeložit. Začnete kliknutím na: Vyhledat v názvech" class="edit">'.$Line[2].'</span>',$Text);
    16      }
     7  // $buff[] = array($Line['ID'],GetIDbyName($Table),$Line[$Column],$Line['Tran']);
     8  foreach($names as $Line)
     9  {
     10    if($Line[3] <> '')
     11    {
     12      $Text = str_replace($Line[2], '<span Title="Byl nalezen překlad: '.$Line[3].'" class="edit">'.$Line[2].'</span>',$Text);
     13      $Text = str_replace(strtolower($Line[2]), '<span Title="Byl nalezen překlad: '.$Line[3].'" class="edit">'.$Line[2].'</span>', $Text);
     14    } else
     15    {
     16      $Text = str_replace($Line[2], '<span Title="Jméno bylo nalezeno v názvech a můžete ho přeložit. Začnete kliknutím na: Vyhledat v názvech" class="edit">'.$Line[2].'</span>', $Text);
     17      $Text = str_replace(strtolower($Line[2]), '<span Title="Jméno bylo nalezeno v názvech a můžete ho přeložit. Začnete kliknutím na: Vyhledat v názvech" class="edit">'.$Line[2].'</span>', $Text);
     18    }
    1719  }
    1820  return $Text;
     
    2224
    2325$GroupId = LoadGroupIdParameter();
    24 $Table = $TranslationTree[$GroupId]['TablePrefix'];
     26$Group = $TranslationTree[$GroupId];
    2527if(array_key_exists('action', $_GET)) $Action = $_GET['action'];
    2628  else $Action = '';
    2729
    28 if(array_key_exists('ID', $_GET))
     30if(array_key_exists('ID', $_GET) and is_numeric($_GET['ID']))
    2931{
    30   $TextID = $_GET['ID'] * 1
     32  $TextID = $_GET['ID']
    3133
    32   $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `ID` = '.$TextID);
     34  $DbResult = $Database->SQLCommand('SELECT * FROM `Translation` WHERE `ID` = '.$TextID);
    3335  $Line = mysql_fetch_assoc($DbResult);
    3436  if(!$Line) ErrorMessage('Překlad nenalezen.');
    3537   
    36   $DbResult = $Database->SQLCommand('SELECT * FROM `'.$Table.'` WHERE `Language` = 0  AND `Entry` = '.$Line['Entry'].' AND `VersionEnd` = '.$Line['VersionEnd'].' LIMIT 1');
     38  $DbResult = $Database->SQLCommand('SELECT * FROM `Translation` WHERE (`Language` = 0) AND (`Entry` = '.$Line['Entry'].') AND (`VersionEnd` = '.$Line['VersionEnd'].') LIMIT 1');
    3739  $LineAJ = mysql_fetch_assoc($DbResult);
    3840  if(!$Line) ErrorMessage('Anglický originál k překladu nenalezen.');
     41  $DbResult = $System->Database->query('SELECT * FROM `TranslationItem` WHERE `Translation`='.$LineAJ['Id']);
     42  while($DbRow = $DbResult->fetch_assoc())
     43    $LineAJ['Item'.$DbRow['Sequence']] = $DbRow['Value'];
    3944 
    4045  $IDUser = $Database->SQLCommand('SELECT * FROM `User` WHERE `ID` = '.$Line['User']);
     
    4550  if(($Line['Language'] <> 0) and ($LineUser['Name'] <> ''))
    4651    echo('Přeložil: <strong>'.$LineUser['Name'].'</strong> <br />');
    47   if(($Line['Take'] <> 0) and ($Line['Take'] <> $Line['ID']))
     52  if(($Line['Original'] <> 0) and ($Line['Original'] <> $Line['Id']))
    4853  {
    49     $Language = mysql_fetch_assoc($Database->SQLCommand('SELECT `Language`,`VersionStart`,`VersionEnd` FROM `'.$Table.'` WHERE `ID` = '.$Line['Take']));
     54    $Language = mysql_fetch_assoc($Database->SQLCommand('SELECT `Language`,`VersionStart`,`VersionEnd` FROM `Translation` WHERE `ID` = '.$Line['Original']));
    5055    // echo $Language['Language'].'  '.$Line['Take'];
    5156    if($Language['Language'] <> 0)
    52       echo('Převzato z: <a href="form.php?group='.$GroupId.'&amp;ID='.$Line['Take'].'">'.$Line['Take'].'</a> <br />');
     57      echo('Převzato z: <a href="form.php?group='.$GroupId.'&amp;ID='.$Line['Original'].'">'.$Line['Original'].'</a> <br />');
    5358  }
    5459  echo('Text: ');
     
    6368  echo('<br />');
    6469   
    65   $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `'.$Table.'` WHERE `Entry` = '.$Line['Entry'].' AND `Language` <> 0');
     70  $DbResult = $Database->SQLCommand('SELECT COUNT(*) FROM `Translation` WHERE (`Entry` = '.$Line['Entry'].') AND (`Language` <> 0)');
    6671  $Version = mysql_fetch_row($DbResult);
    6772  $Version = $Version[0];
     
    7580      <option value="-1">Vyberte text k porovnání</option>
    7681      <option value="-1">Zobrazit/porovnat všechny</option>');
    77     $DataID = $Database->SQLCommand('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'].')'); 
     82    $DataID = $Database->SQLCommand('SELECT *, (SELECT `User`.`Name` AS `UserName` FROM `User` WHERE `User`.`ID` = `Translate`.`User`) AS `UserName` FROM `Translate` WHERE (`Entry` = '.$Line['Entry'].') AND (`Id` <> '.$Line['Id'].')'); 
    7883    while($version = mysql_fetch_array($DataID))
    7984    {     
    80       if ($version['ID'] == $Line['Take']) echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$version['User'].' (převzato)</option>');   
     85      if ($version['Id'] == $Line['Original']) echo('<option value="'.$version['Id'].'">'.$version['Id'].' - '.$version['User'].' (převzato)</option>');   
    8186      else
    8287      {
    8388        if($version['Language'] == 0) $version['UserName'] = 'Předloha';
    84         echo('<option value="'.$version['ID'].'">'.$version['ID'].' - '.$Version['UserName'].' ('.GetVersionWOW($version['VersionStart']).' - '.GetVersionWOW($version['VersionEnd']).')</option>');
     89        echo('<option value="'.$version['Id'].'">'.$version['Id'].' - '.$Version['UserName'].' ('.GetVersionWOW($version['VersionStart']).' - '.GetVersionWOW($version['VersionEnd']).')</option>');
    8590      }
    8691    }
     
    95100  if($User->Licence(LICENCE_USER))
    96101  {
    97     if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11)) echo('<a href="dictionary.php?group='.$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">Vyhledat v názvech</a>');
     102    if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11)) echo('<a href="dictionary.php?group='.$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">Vyhledat v názvech</a>');
    98103    echo(' <input type="submit" value="Uložit do rozepsaných" name="save" title="Klikněte na uložit pro pozdější dokončení překladu" />
    99104    <input type="submit" value="Dokončeno" name="End" title="Klikněte na Dokončeno jesli jsou všechny texty hotové a chcete již publikovat" /> ');
    100     FollowingTran($TextID, $Table, $GroupId, true);
    101     FollowingTran($TextID, $Table, $GroupId);
     105    //FollowingTran($TextID, $Table, $GroupId, true);
     106    //FollowingTran($TextID, $Table, $GroupId);
    102107  }
    103108
     
    128133  echo('</td></tr>');
    129134
    130   //zvýrazňování jmen
    131     $Text = '';
    132     foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    133       if($TextItem['Visible'] == 1)
    134         $Text = $Text.' '.$LineAJ[$TextItem['Column']];
     135  /*
     136  // zvýrazňování jmen
     137  $Text = '';
     138  foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
     139    if($TextItem['Visible'] == 1)
     140      if(array_key_exists('Item'.$TextItem['Sequence'], $LineAJ))
     141        $Text = $Text.' '.$LineAJ['Item'.$TextItem['Sequence']];
    135142
    136   if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11)) {
    137   //<span class="edit">barvou.</span>
    138     $names = GetTranslatNames($Text,0,array('Dictionary' => 'Text','TextCreature' => 'name'));
    139   } else {
    140     $names = GetTranslatNames($Text,0,array('Dictionary' => 'Text'));
     143  if(($GroupId < 4) or ($GroupId == 10) or ($GroupId == 11))
     144  {
     145    //<span class="edit">barvou.</span>
     146    $names = GetTranslatNames($Text, 0, array('Dictionary' => 'Text', 'TextCreature' => 'name'));
     147  } else
     148  {
     149    $names = GetTranslatNames($Text, 0, array('Dictionary' => 'Text'));
    141150  }
    142151  //print_r($names);
    143 
    144   foreach($TranslationTree[$GroupId]['Items'] as $Index => $TextItem)
    145   if($TextItem['Visible'] == 1)
    146   {         
    147     if(($LineAJ[$TextItem['Column']] <> '') or ($Line[$TextItem['Column']] <> '')) 
     152  */
     153  $names = array();
     154 
     155  $DbResult = $System->Database->query('SELECT * FROM TranslationItem WHERE Translation='.$TextID);
     156  while($TranslationItem = $DbResult->fetch_assoc())
     157  {
     158    $TextItem = $TranslationTree[$GroupId]['Items'][$TranslationItem['Sequence']];
     159    if($TextItem['Visible'] == 1)
     160    {         
     161      if(($LineAJ['Item'.$TranslationItem['Sequence']] <> '') or ($TranslationItem['Value'] <> '')) 
     162      {
     163        //if($TextItem['Name'] == 'Text' AND (($Table == 'global_strings') OR ($Table == 'glue_strings'))) echo('<tr><th>'.$LineAJ['ShortCut'].'</th>');
     164        //else
     165        echo('<tr><th>'.$TextItem['Name'].'</th>');
     166       
     167        echo('<td>'.str_replace("\n", '<br/>', ColorNames(htmlspecialchars($LineAJ['Item'.$TranslationItem['Sequence']]),$names)).'</td>'.
     168        '<td><textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="Item'.$TranslationItem['Sequence'].'" name="Item'.$TranslationItem['Sequence'].'">'.htmlspecialchars($TranslationItem['Value']).'</textarea></td></tr>');
     169      }
     170    } else
    148171    {
    149       if ($TextItem['Name'] == 'Text' AND (($Table == 'global_strings') OR ($Table == 'glue_strings'))) echo('<tr><th>'.$LineAJ['ShortCut'].'</th>');
    150         else echo('<tr><th>'.$TextItem['Name'].'</th>');
    151       echo('<td>'.str_replace("\n", '<br/>', ColorNames(htmlspecialchars($LineAJ[$TextItem['Column']]),$names)).'</td>
    152       <td><textarea rows="8" cols="40" onkeydown="ResizeTextArea(this)" class="textedit" id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'">'.htmlspecialchars($Line[$TextItem['Column']]).'</textarea></td></tr>');
     172      echo('<input id="Item'.$TranslationItem['Sequence'].'" name="Item'.$TranslationItem['Sequence'].'" type="hidden" value="'.htmlspecialchars($TranslationItem['Value']).'" />');
    153173    }
    154   } else
    155   {
    156     echo('<input id="'.$TextItem['Column'].'" name="'.$TextItem['Column'].'" type="hidden" value="'.htmlspecialchars($Line[$TextItem['Column']]).'" />');
    157174  }
    158175  echo('</table></div></form>');
Note: See TracChangeset for help on using the changeset viewer.