Changeset 9 for branches/2/frontend.php


Ignore:
Timestamp:
May 9, 2008, 2:04:07 PM (16 years ago)
Author:
george
Message:

Přidáno: Import uživatelů a questů ze starého systému.
Přidáno: Zobrazení vícenásobných překladů.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2/frontend.php

    r8 r9  
    4646  }
    4747
    48   function ShowText($TranslationGroupId)
    49   {
    50    
    51     $TextList = $this->System->Modules['Translation']->GetMultipleText($TranslationGroupId, $_GET['Index']);
    52     if(count($TextList) == 0)
     48  function ShowText($TranslationGroupId, $Edit)
     49  {
     50    if($Edit)
    5351    {
    5452      // Edit new text
     
    6058      $Output .= '</table>';
    6159    }
    62     else if(count($TextList) == 1)
     60    else
    6361    {
    6462      // Show only one
     
    6967      }
    7068      $Output .= '</table>';
    71     } else
    72     {
     69    }
     70    return($Output);
     71  }
     72 
     73  function ShowMultipleText($TranslationGroupId)
     74  {
     75    $TextList = $this->System->Modules['Translation']->GetMultipleText($TranslationGroupId, $_GET['Index']);
     76    $EnglishText = array_shift($TextList);
     77    if(count($TextList) == 0) $Output = $this->ShowText($EnglishText['Id'], 1);
     78    else if(count($TextList) == 1) $Output = $this->ShowText($EnglishText['Id'], 0);
     79    else {
    7380      // Show multiple possibilites
    74       $Output = '<strong>Více překladů jednoho textu:</strong><table class="TranslationTable">'.
     81      $Output = '<strong>Více překladů jednoho textu:</strong><table>'.
    7582       '<tr><th>ID</th><th>Titulek</th></tr>';
    7683      foreach($TextList as $Text)
    7784      {
    78         $Output .= '<tr><td>'.$Text['Index'].'</td><td><a href="?Action=ShowText&amp;GroupId='.$Text['Id'].'">'.$Text['Text'].'</a></td></tr>';
     85        $Output .= '<tr><td>'.$Text['Index'].'</td><td><a href="?Action=ShowText&amp;GroupId='.$Text['Id'].'&amp;Edit=0">'.$Text['Text'].'</a></td></tr>';
    7986      }
    8087      $Output .= '</table>';
     
    9299    {
    93100      if(strlen($Translation['Text']) > 30) $Translation['Text'] = substr($Translation['Text'], 0, 30).'...';
    94       $Output .= '<tr><td>'.$Translation['Index'].'</td><td><a href="?Action=ShowText&amp;GroupId='.$Translation['Id'].'&amp;Index='.$Translation['Index'].'">'.$Translation['Text'].'</a></td><td>'.($Translation['TextCount'] - 1).'</td></tr>';
     101      $Output .= '<tr><td>'.$Translation['Index'].'</td><td><a href="?Action=ShowMultipleText&amp;GroupId='.$Translation['Group'].'&amp;Index='.$Translation['Index'].'">'.$Translation['Text'].'</a></td><td>'.($Translation['TextCount'] - 1).'</td></tr>';
    95102    }
    96103    $Output .= '</table>'.$this->System->PagesList('?Action=TextGroupList&amp;GroupId='.$GroupId.'&amp;Page=', $Page, $this->System->Modules['Translation']->GetTextGroupListCount($GroupId, 1, 1), $ItemPerPage);
     
    205212        break;
    206213      case 'ShowText':
    207         $Output = $this->ShowText($_GET['GroupId']);
     214        $Output = $this->ShowText($_GET['GroupId'], $_GET['Edit']);
     215        break;
     216      case 'ShowMultipleText':
     217        $Output = $this->ShowMultipleText($_GET['GroupId']);
    208218        break;
    209219      case 'TextGroupList':
     
    229239        break;
    230240      case 'ImportOldSystem':
    231         $Output = $this->System->Modules['MangosImport']->ImportOldMangos();
     241        $Output = $this->System->Modules['MangosImport']->ImportOldSystem();
    232242        break;
    233243    }
Note: See TracChangeset for help on using the changeset viewer.