Changeset 893 for trunk/Modules/Translation/Translation.php
- Timestamp:
- Mar 6, 2023, 1:48:45 AM (21 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/Translation/Translation.php
r888 r893 11 11 class ModuleTranslation extends Module 12 12 { 13 public array $TranslationTree; 14 13 15 function __construct(System $System) 14 16 { … … 79 81 ( 80 82 'Title' => strip_tags($DbRow['Text'].' ('.$DbRow['UserName'].')'), 81 'Link' => 'http://'. $this->System->Config['Web']['Host'].$this->System->Link('/'),83 'Link' => 'http://'.Core::Cast($this->System)->Config['Web']['Host'].$this->System->Link('/'), 82 84 'Description' => $DbRow['Text'], 83 85 'Time' => $DbRow['Date'], … … 86 88 $Output = GenerateRSS(array 87 89 ( 88 'Title' => $this->System->Config['Web']['Title'].' - '.T('Last translations'),89 'Link' => 'http ://'.$this->System->Config['Web']['Host'].$this->System->Link('/'),90 'Description' => $this->System->Config['Web']['Description'],91 'WebmasterEmail' => $this->System->Config['Web']['AdminEmail'],90 'Title' => Core::Cast($this->System)->Config['Web']['Title'].' - '.T('Last translations'), 91 'Link' => 'https://'.Core::Cast($this->System)->Config['Web']['Host'].$this->System->Link('/'), 92 'Description' => Core::Cast($this->System)->Config['Web']['Description'], 93 'WebmasterEmail' => Core::Cast($this->System)->Config['Web']['AdminEmail'], 92 94 'Items' => $Items, 93 95 )); … … 113 115 $DbRow['Id'].' AS `Group`, "'.addslashes($DbRow['Name']).'" AS `GroupName`, `T`.`Take` FROM `'. 114 116 $DbRow['TablePrefix'].'` AS `T`'. 115 ' WHERE (`T`.`Complete` = 1) AND (`T`.`Language` != '. $this->System->Config['OriginalLanguage'].') ORDER BY `T`.`ModifyTime` DESC LIMIT '.117 ' WHERE (`T`.`Complete` = 1) AND (`T`.`Language` != '.Core::Cast($this->System)->Config['OriginalLanguage'].') ORDER BY `T`.`ModifyTime` DESC LIMIT '. 116 118 $Count.') AS `T`'; 117 119 } … … 139 141 { 140 142 if (isset($this->TranslationTree)) return $this->TranslationTree; 141 else { 143 else 144 { 142 145 $Result = array(); 143 146 $Groups = array(); … … 164 167 function ShowTranslatedMenu() 165 168 { 169 $User = ModuleUser::Cast($this->System->GetModule('User'))->User; 166 170 $TranslationTree = $this->GetTranslationTree(); 167 171 … … 183 187 ' <a title="Přeložené texty, můžete zde hlasovat, nebo opravovat překlady" href="'. 184 188 $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))189 if (isset($User) and $User->Licence(LICENCE_USER)) 186 190 { 187 191 $Output .= ' <a title="'.T('Unfinished translations').'" href="'.$this->System->Link('/TranslationList.php?group='.$Group['Id'].'&state=3').'">'.T('Unfinished').'</a><br />'. 188 192 ' <a title="Všechny překlady, které jste přeložil" href="'. 189 193 $this->System->Link('/TranslationList.php?group='.$Group['Id'].'&state=1&user='. 190 $ this->System->User->Id).'&entry=&text=">'.T('Own').'</a><br />';194 $User->Id).'&entry=&text=">'.T('Own').'</a><br />'; 191 195 } 192 196 $Output .= ' <a title="'.T('Compose special filter').'" href="'. … … 198 202 return $Output; 199 203 } 204 205 static function Cast(Module $Module): ModuleTranslation 206 { 207 if ($Module instanceof ModuleTranslation) 208 { 209 return $Module; 210 } 211 throw new Exception('Expected '.ModuleTranslation::GetClassName().' type but got '.gettype($Module)); 212 } 200 213 }
Note:
See TracChangeset
for help on using the changeset viewer.