Changeset 880 for trunk/Modules/Translation/Translation.php
- Timestamp:
- Apr 7, 2020, 10:15:48 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/Translation.php
r861 r880 47 47 'Icon' => '', 48 48 )); 49 if (array_key_exists('Search', $this->System->ModuleManager->Modules))49 if (array_key_exists('Search', $this->System->ModuleManager->Modules)) 50 50 { 51 51 $TranslationTree = $this->System->ModuleManager->Modules['Translation']->GetTranslationTree(); 52 foreach ($TranslationTree as $Group)52 foreach ($TranslationTree as $Group) 53 53 { 54 54 $Table = $Group['TablePrefix']; 55 55 56 56 $Columns = array('ID', 'Entry'); 57 foreach ($Group['Items'] as $Item)57 foreach ($Group['Items'] as $Item) 58 58 { 59 if ($Item['Column'] != '') $Columns[] = $Item['Column'];59 if ($Item['Column'] != '') $Columns[] = $Item['Column']; 60 60 } 61 61 … … 74 74 $DbResult = $this->Database->query('SELECT UNIX_TIMESTAMP(`Date`) AS `Date`, `User`.`Name` AS `UserName`, `Text` FROM `Log` '. 75 75 'JOIN `User` ON `User`.`ID` = `Log`.`User` WHERE `Type` = 1 ORDER BY `Date` DESC LIMIT 100'); 76 while ($DbRow = $DbResult->fetch_assoc())76 while ($DbRow = $DbResult->fetch_assoc()) 77 77 { 78 78 $Items[] = array … … 92 92 'Items' => $Items, 93 93 )); 94 return ($Output);94 return $Output; 95 95 } 96 96 … … 105 105 $UnionItems = array(); 106 106 $DbResult = $this->Database->query($GroupListQuery); 107 if ($DbResult->num_rows > 0)108 { 109 while ($DbRow = $DbResult->fetch_assoc())107 if ($DbResult->num_rows > 0) 108 { 109 while ($DbRow = $DbResult->fetch_assoc()) 110 110 { 111 111 $UnionItems[] = 'SELECT `T`.`ID`, `T`.`Take`, `T`.`User`, `T`.`ModifyTime`, `T`.`Group`, `T`.`GroupName` '. … … 122 122 $DbResult = $this->Database->query($Query); 123 123 $Output .= '<table class="MiniTable"><tr><th>'.T('Date').'</th><th>'.T('Who').'</th><th>'.T('New').'</th><th>'.T('Source').'</th><th>'.T('Group').'</th></tr>'; 124 while ($DbRow = $DbResult->fetch_assoc())124 while ($DbRow = $DbResult->fetch_assoc()) 125 125 { 126 126 $Output .= '<tr><td>'.HumanDate($DbRow['ModifyTime']).'</td>'. … … 133 133 } 134 134 $Output .= '</div>'; 135 return ($Output);135 return $Output; 136 136 } 137 137 138 138 function GetTranslationTree() 139 139 { 140 if (isset($this->TranslationTree)) return($this->TranslationTree);140 if (isset($this->TranslationTree)) return $this->TranslationTree; 141 141 else { 142 142 $Result = array(); 143 143 $Groups = array(); 144 144 $DbResult = $this->System->Database->query('SELECT *, UNIX_TIMESTAMP(`LastImport`) AS `LastImportTime` FROM `Group`'); 145 while ($DbRow = $DbResult->fetch_assoc())145 while ($DbRow = $DbResult->fetch_assoc()) 146 146 $Groups[T($DbRow['Name'])] = $DbRow; 147 147 ksort($Groups); 148 foreach ($Groups as $Group)148 foreach ($Groups as $Group) 149 149 { 150 150 $Group['Items'] = array(); … … 153 153 } 154 154 $DbResult = $this->System->Database->query('SELECT * FROM `GroupItem` ORDER BY `Group`, `Sequence`'); 155 while ($DbRow = $DbResult->fetch_assoc())155 while ($DbRow = $DbResult->fetch_assoc()) 156 156 { 157 157 $Result[$DbRow['Group']]['Items'][] = $DbRow; 158 158 } 159 159 $this->TranslationTree = $Result; 160 return ($Result);160 return $Result; 161 161 } 162 162 } … … 168 168 $Output = '<strong>'.T('Translate groups').':</strong><br /><div id="TranslationMenu">'; 169 169 $DbResult = $this->System->Database->select('Group', '`Id`, `Name`', '1 ORDER BY `Name`'); 170 while ($Group = $DbResult->fetch_assoc())170 while ($Group = $DbResult->fetch_assoc()) 171 171 { 172 172 $Groups[T($Group['Name'])] = $Group; 173 173 } 174 174 ksort($Groups); 175 foreach ($Groups as $Group)175 foreach ($Groups as $Group) 176 176 { 177 177 $Output .= '<div id="menuitem-group'.$Group['Id'].'" onmouseover="show(\'group'.$Group['Id'].'\')" onmouseout="hide(\'group'.$Group['Id'].'\')">'. … … 183 183 ' <a title="Přeložené texty, můžete zde hlasovat, nebo opravovat překlady" href="'. 184 184 $this->System->Link('/TranslationList.php?group='.$Group['Id'].'&state=2&user=0&entry=&text=').'">'.T('Translated').'</a><br />'; 185 if (isset($this->System->User) and $this->System->User->Licence(LICENCE_USER))185 if (isset($this->System->User) and $this->System->User->Licence(LICENCE_USER)) 186 186 { 187 187 $Output .= ' <a title="'.T('Unfinished translations').'" href="'.$this->System->Link('/TranslationList.php?group='.$Group['Id'].'&state=3').'">'.T('Unfinished').'</a><br />'. … … 196 196 } 197 197 $Output .= '</div>'; 198 return ($Output);198 return $Output; 199 199 } 200 200 }
Note:
See TracChangeset
for help on using the changeset viewer.