Changeset 9 for branches/2/frontend.php
- Timestamp:
- May 9, 2008, 2:04:07 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2/frontend.php
r8 r9 46 46 } 47 47 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) 53 51 { 54 52 // Edit new text … … 60 58 $Output .= '</table>'; 61 59 } 62 else if(count($TextList) == 1)60 else 63 61 { 64 62 // Show only one … … 69 67 } 70 68 $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 { 73 80 // 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>'. 75 82 '<tr><th>ID</th><th>Titulek</th></tr>'; 76 83 foreach($TextList as $Text) 77 84 { 78 $Output .= '<tr><td>'.$Text['Index'].'</td><td><a href="?Action=ShowText&GroupId='.$Text['Id'].' ">'.$Text['Text'].'</a></td></tr>';85 $Output .= '<tr><td>'.$Text['Index'].'</td><td><a href="?Action=ShowText&GroupId='.$Text['Id'].'&Edit=0">'.$Text['Text'].'</a></td></tr>'; 79 86 } 80 87 $Output .= '</table>'; … … 92 99 { 93 100 if(strlen($Translation['Text']) > 30) $Translation['Text'] = substr($Translation['Text'], 0, 30).'...'; 94 $Output .= '<tr><td>'.$Translation['Index'].'</td><td><a href="?Action=Show Text&GroupId='.$Translation['Id'].'&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&GroupId='.$Translation['Group'].'&Index='.$Translation['Index'].'">'.$Translation['Text'].'</a></td><td>'.($Translation['TextCount'] - 1).'</td></tr>'; 95 102 } 96 103 $Output .= '</table>'.$this->System->PagesList('?Action=TextGroupList&GroupId='.$GroupId.'&Page=', $Page, $this->System->Modules['Translation']->GetTextGroupListCount($GroupId, 1, 1), $ItemPerPage); … … 205 212 break; 206 213 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']); 208 218 break; 209 219 case 'TextGroupList': … … 229 239 break; 230 240 case 'ImportOldSystem': 231 $Output = $this->System->Modules['MangosImport']->ImportOld Mangos();241 $Output = $this->System->Modules['MangosImport']->ImportOldSystem(); 232 242 break; 233 243 }
Note:
See TracChangeset
for help on using the changeset viewer.