Ignore:
Timestamp:
Dec 22, 2009, 1:10:06 PM (14 years ago)
Author:
george
Message:
  • Upraveno: Vytovřena funkce pro podporu řazení tabulek. Různé tabulky načítané za databáze mají nyní v hlavičce možnost řazení sestupně/vzestupně podle dostupných sloupců.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/TranslationList.php

    r287 r288  
    9797  }
    9898 
    99   echo('<table class="BaseTable"><tr>
    100     <th><a href="?group='.$GroupId.'&amp;action='.$address.'&amp;order=ID&amp;desc='.$desc.'">Pořadové číslo</a></th>
    101     <th><a href="?group='.$GroupId.'&amp;action='.$address.'&amp;order=entry&amp;desc='.$desc.'">Identifikační číslo</a></th>
    102     <th><a href="?group='.$GroupId.'&amp;action='.$address.'&amp;order='.$TranslationTree[$GroupId]['Items'][0]['Column'].'&amp;desc='.$desc.'">Název</a></th>
    103     <th>Verze</th>');
    104   if ($address == 'selection') echo('<th><a href="?group='.$GroupId.'&amp;action='.$address.'&amp;order=CountQuests&amp;desc='.$desc.'">Výskyt</a></th>');
    105   else if ($address == 'connexion') echo ('<th>Již přeložil</th>');
    106   else if($address <> 'notran') echo('<th><a href="?group='.$GroupId.'&amp;action='.$address.'&amp;order=user&amp;desc='.$desc.'">Uživatel</a></th>');
    107   echo('</tr>');
     99  $TableColumns = array(
     100    array('Name' => 'ID', 'Title' => 'Pořadové číslo'),
     101    array('Name' => 'entry', 'Title' => 'Identifikační číslo'),
     102    array('Name' => $TranslationTree[$GroupId]['Items'][0]['Column'], 'Title' => 'Název'),
     103    array('Name' => 'VersionStart', 'Title' => 'Verze'),
     104  );
     105  if($address == 'selection') $TableColumns[] = array('Name' => 'CountQuests', 'Title' => 'Výskyt');
     106  else if($address == 'connexion') $TableColumns[] = array('Name' => '', 'Title' => 'Již přeložil');
     107  else if($address <> 'notran') $TableColumns[] = array('Name' => 'User', 'Title' => 'Překladatel');
     108   
     109  $Order = GetOrderTableHeader($TableColumns, 'ID');
     110  echo('<table class="BaseTable">');
     111  echo($Order['Output']);
    108112   
    109113  //print_r($TranslationTree[$GroupId]['Items']);
    110   $ID = $Database->SQLCommand($sql.' '.$order.' '.$desc.' '.$limit);
     114  $ID = $Database->SQLCommand($sql.' '.$Order['SQL'].' '.$limit);
    111115  while($Line = mysql_fetch_assoc($ID))
    112116  {
Note: See TracChangeset for help on using the changeset viewer.