Changeset 6 for branches/2/frontend.php


Ignore:
Timestamp:
May 8, 2008, 8:48:00 PM (17 years ago)
Author:
george
Message:

Přidáno: Zobrazení prvních textů v seznamu položek ve skupinách.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2/frontend.php

    r5 r6  
    3737    foreach($this->System->Modules['Translation']->GetTextList($TranslationGroupId) as $GroupItem)
    3838    {
    39       $Output .= '<tr><th>'.$GroupItem['Name'].'</th><td>'.$GroupItem['Text'].'</td><td><textarea name="GroupItem'.$GroupItem['Id'].'">'.$GroupItem['Text'].'</textarea></td></tr>';
     39      $Output .= '<tr><th>'.$GroupItem['Name'].'</th><td>'.$GroupItem['Text'].'</td><td><div><textarea name="GroupItem'.$GroupItem['Id'].'">'.$GroupItem['Text'].'</textarea></div></td></tr>';
    4040    }
    4141    $Output .= '</table>';
     
    4343  }
    4444
    45   function TranslationGroupItemList($GroupId)
     45  function TextGroupList($GroupId)
    4646  {
     47    $ItemPerPage = 30;
     48    if(array_key_exists('Page', $_GET)) $Page = $_GET['Page']; else $Page = 0;
    4749    $Output = '<strong>Seznam textů:</strong><br/>';
    48     foreach($this->System->Modules['Translation']->GetTextGroupList($GroupId, 1, 1) as $Translation)
     50    foreach($this->System->Modules['Translation']->GetTextGroupList($GroupId, 1, 1, $Page, $ItemPerPage) as $Translation)
    4951    {
    50       $Output .= '<a href="?Action=TranslationGroupEdit&amp;GroupId='.$Translation['Id'].'">'.$Translation['Index'].'</a><br />';
     52      if(strlen($Translation['Text']) > 30) $Translation['Text'] = substr($Translation['Text'], 0, 30).'...';
     53      $Output .= $Translation['Index'].'. <a href="?Action=TranslationGroupEdit&amp;GroupId='.$Translation['Id'].'">'.$Translation['Text'].'</a><br />';
    5154    }
     55    $Output .= $this->System->PagesList('?Action=TextGroupList&amp;GroupId='.$GroupId.'&amp;Page=', $Page, $this->System->Modules['Translation']->GetTextGroupListCount($GroupId, 1, 1), $ItemPerPage);
    5256    return($Output);
    5357  }
     
    5862    foreach($this->System->Modules['Translation']->GetTranslationGroupList() as $Group)
    5963    {
    60       $Output .= '<a href="?Action=TranslationGroupList&amp;GroupId='.$Group['Id'].'">'.$Group['Name'].'</a><br />';
     64      $Output .= '<a href="?Action=TextGroupList&amp;GroupId='.$Group['Id'].'">'.$Group['Name'].'</a><br />';
    6165    }
    6266    return($Output);
     
    7882        $Output = $this->TranslationGroupEdit($_GET['GroupId']);
    7983        break;
    80       case 'TranslationGroupList':
    81         $Output = $this->TranslationGroupItemList($_GET['GroupId']);
     84      case 'TextGroupList':
     85        $Output = $this->TextGroupList($_GET['GroupId']);
    8286        break;
    8387      case 'MangosImport':
Note: See TracChangeset for help on using the changeset viewer.