Changeset 548
- Timestamp:
- Jun 18, 2013, 7:23:39 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 9 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/AoWoW/AoWoW.php
r547 r548 13 13 $this->Dependencies = array(); 14 14 } 15 16 function Start() 17 { 18 $this->System->RegisterMenuItem(array( 19 'Title' => 'AoWoW', 20 'Hint' => 'Vyhledávací databáze podobná WoWHead s překlady', 21 'Link' => $this->System->Link('/aowow/'), 22 'Permission' => LICENCE_ANONYMOUS, 23 'Icon' => '', 24 )); 25 } 15 26 } -
trunk/Modules/Dictionary/Dictionary.php
r546 r548 1 1 <?php 2 2 3 include('includes/global.php'); 3 class ModuleDictionary extends AppModule 4 { 5 function __construct($System) 6 { 7 parent::__construct($System); 8 $this->Name = 'Dictionary'; 9 $this->Version = '1.0'; 10 $this->Creator = 'Chronos'; 11 $this->License = 'GNU/GPL'; 12 $this->Description = 'Custom dictionary for better translation coordination'; 13 $this->Dependencies = array(); 14 } 15 16 function Start() 17 { 18 $this->System->RegisterPage('dictionary.php', 'PageDictionary'); 19 $this->System->RegisterMenuItem(array( 20 'Title' => 'Slovníček', 21 'Hint' => 'Slovník WoW výrazů', 22 'Link' => $this->System->Link('/dictionary.php'), 23 'Permission' => LICENCE_ANONYMOUS, 24 'Icon' => '', 25 )); 26 } 27 } 28 29 class PageDictionary extends Page 30 { 4 31 5 32 function WriteTranslatNames($Text,$mode) … … 46 73 } 47 74 48 $LanguageList = GetLanguageList();49 50 if(!isset($_SESSION['language']))51 {52 if($User->Licence(LICENCE_USER))53 {54 $_SESSION['language'] = $User->Language;55 } else $_SESSION['language'] = '';56 }57 if(array_key_exists('language', $_GET)) {58 if($_GET['language'] == '') $_SESSION['language'] = '';59 else $_SESSION['language'] = $_GET['language'] * 1;60 }61 62 $Output = '<h3>Slovníček</h3>';63 64 75 function DictionaryInsert() 65 76 { 66 global $ System, $User;77 global $User; 67 78 68 79 $Output = ''; … … 86 97 function DictionarySave() 87 98 { 88 global $ System, $User, $Config;99 global $User, $Config; 89 100 90 101 if($User->Licence(LICENCE_USER)) … … 93 104 { 94 105 // Check if original text exists and determine entry id 95 $DbResult = $ System->Database->query('SELECT * FROM `Dictionary` WHERE '.106 $DbResult = $this->Database->query('SELECT * FROM `Dictionary` WHERE '. 96 107 '`Text` = "'.$_POST['Original'].'" AND `Language`= '.$Config['OriginalLanguage']); 97 108 if($DbResult->num_rows > 0) … … 101 112 } else 102 113 { 103 $DbResult = $ System->Database->query('SELECT MAX(`Entry`) FROM `Dictionary`');114 $DbResult = $this->Database->query('SELECT MAX(`Entry`) FROM `Dictionary`'); 104 115 $DbRow = $DbResult->fetch_row(); 105 116 $Entry = $DbRow[0] + 1; 106 $ System->Database->query('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , '.117 $this->Database->query('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , '. 107 118 '`User`, `Language` ) VALUES ("'.$_POST['Original'].'", "'.$Entry.'", "", NULL, '.$Config['OriginalLanguage'].');'); 108 119 } 109 120 110 $DbResult = $ System->Database->query('SELECT `Id` FROM `Dictionary` WHERE '.121 $DbResult = $this->Database->query('SELECT `Id` FROM `Dictionary` WHERE '. 111 122 '`Entry` = '.$Entry.' AND `Language`='.$_POST['Language'].' AND `User`='.$User->Id); 112 123 if($DbResult->num_rows > 0) 113 124 { 114 125 $DbRow = $DbResult->fetch_assoc(); 115 $ System->Database->query('UPDATE `Dictionary` SET `Text`="'.$_POST['Translated'].'", '.126 $this->Database->query('UPDATE `Dictionary` SET `Text`="'.$_POST['Translated'].'", '. 116 127 '`Description` = "'.$_POST['Description'].'" WHERE Id='.$DbRow['Id']); 117 128 } else 118 $ System->Database->query('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , '.129 $this->Database->query('INSERT INTO `Dictionary` ( `Text` , `Entry` , `Description` , '. 119 130 '`User`, `Language` ) VALUES ("'.$_POST['Translated'].'", "'.$Entry.'", "'.$_POST['Description'].'", '.$User->Id.', '.$_POST['Language'].')'); 120 131 $Output = ShowMessage('Záznam byl uložen!'); … … 126 137 function DictionaryRemove() 127 138 { 128 global $ System, $User;139 global $User; 129 140 130 141 if($User->Licence(LICENCE_USER)) 131 142 { 132 $ System->Database->query('DELETE FROM `Dictionary` WHERE (`User`='.$User->Id.') AND (`Id`='.($_GET['id'] * 1).')');143 $this->Database->query('DELETE FROM `Dictionary` WHERE (`User`='.$User->Id.') AND (`Id`='.($_GET['id'] * 1).')'); 133 144 $Output = ShowMessage('Záznam odstraněn.'); 134 145 } else $Output = ShowMessage('Nemáte oprávnění', MESSAGE_CRITICAL); … … 138 149 function DictionaryModify() 139 150 { 140 global $ System, $User, $Config;151 global $User, $Config; 141 152 142 153 if($User->Licence(LICENCE_USER)) 143 154 { 144 $DbResult = $ System->Database->query('SELECT * FROM `Dictionary` WHERE `Id`='.($_GET['id'] * 1));155 $DbResult = $this->Database->query('SELECT * FROM `Dictionary` WHERE `Id`='.($_GET['id'] * 1)); 145 156 if($DbResult->num_rows > 0) 146 157 { 147 158 $DbRow = $DbResult->fetch_assoc(); 148 $DbResult = $ System->Database->query('SELECT * FROM `Dictionary` WHERE (`User` IS NULL) '.159 $DbResult = $this->Database->query('SELECT * FROM `Dictionary` WHERE (`User` IS NULL) '. 149 160 'AND (`Entry`='.$DbRow['Entry'].') AND (`Language`= '.$Config['OriginalLanguage'].')'); 150 161 $DbRow2 = $DbResult->fetch_assoc(); … … 168 179 function DictionaryGroup() 169 180 { 170 global $ System, $User, $TranslationTree;181 global $User, $TranslationTree; 171 182 172 183 $Output = ''; … … 183 194 '<a href="?action=group&mode=0&group='.$GroupId.'&ID='.$TextID.'" title="Zobrazit pouze přesné výsledky">Přesné</a> '. 184 195 '<a href="?action=group&mode=2&group='.$GroupId.'&ID='.$TextID.'" title="Zobrazit všechny nepřeložené">Nepřeložené</a> '; 185 $DbResult = $ System->Database->query('SELECT * FROM '.$Table.' WHERE ID = '.$TextID);196 $DbResult = $this->Database->query('SELECT * FROM '.$Table.' WHERE ID = '.$TextID); 186 197 $Line = $DbResult->fetch_assoc(); 187 198 if(!$Line) $Output .= ShowMessage('Překlad nenalezen.', MESSAGE_CRITICAL); … … 199 210 function DictionaryShow() 200 211 { 201 global $ System, $User, $LanguageList, $Config;212 global $User, $LanguageList, $Config; 202 213 203 214 $Output = '<form action="dictionary.php" method="get" style="margin: 0px; padding: 0px;">'. … … 246 257 $LanguageFilter.$Condition; 247 258 248 $DbResult = $ System->Database->query('SELECT COUNT(*) FROM ('.$sql.') AS `T1`');259 $DbResult = $this->Database->query('SELECT COUNT(*) FROM ('.$sql.') AS `T1`'); 249 260 $DbRow = $DbResult->fetch_row(); 250 261 $PageList = GetPageList($DbRow[0]); … … 266 277 267 278 $sql_page = $sql.$Order['SQL'].$PageList['SQLLimit']; 268 $DbResult = $ System->Database->query($sql_page);279 $DbResult = $this->Database->query($sql_page); 269 280 while($Line = $DbResult->fetch_assoc()) 270 281 { … … 291 302 } 292 303 293 $Output = ''; 304 function Show() 305 { 306 global $LanguageList; 307 308 $LanguageList = GetLanguageList(); 309 310 if(!isset($_SESSION['language'])) 311 { 312 if($User->Licence(LICENCE_USER)) 313 { 314 $_SESSION['language'] = $User->Language; 315 } else $_SESSION['language'] = ''; 316 } 317 if(array_key_exists('language', $_GET)) { 318 if($_GET['language'] == '') $_SESSION['language'] = ''; 319 else $_SESSION['language'] = $_GET['language'] * 1; 320 } 321 322 $Output = '<h3>Slovníček</h3>'; 323 294 324 $ShowList = true; 295 325 if(array_key_exists('action', $_GET)) 296 326 { 297 327 if($_GET['action'] == 'group') { 298 $Output .= DictionaryGroup();328 $Output .= $this->DictionaryGroup(); 299 329 $ShowList = false; 300 330 } 301 else if($_GET['action'] == 'insert') $Output .= DictionaryInsert();302 else if($_GET['action'] == 'save') $Output .= DictionarySave();303 else if($_GET['action'] == 'remove') $Output .= DictionaryRemove();304 else if($_GET['action'] == 'modify') $Output .= DictionaryModify();331 else if($_GET['action'] == 'insert') $Output .= $this->DictionaryInsert(); 332 else if($_GET['action'] == 'save') $Output .= $this->DictionarySave(); 333 else if($_GET['action'] == 'remove') $Output .= $this->DictionaryRemove(); 334 else if($_GET['action'] == 'modify') $Output .= $this->DictionaryModify(); 305 335 else $Output .= ShowMessage('Neznámá akce', MESSAGE_CRITICAL); 306 336 } 307 if($ShowList == true) $Output .= DictionaryShow(); 308 309 ShowPage($Output); 310 311 ?> 337 if($ShowList == true) $Output .= $this->DictionaryShow(); 338 return($Output); 339 } 340 } -
trunk/Modules/FrontPage/FrontPage.php
r547 r548 17 17 { 18 18 $this->System->RegisterPage('', 'PageFrontPage'); 19 $this->System->RegisterMenuItem(array( 20 'Title' => 'Domů', 21 'Hint' => 'Hlavní stránka', 22 'Link' => $this->System->Link('/'), 23 'Permission' => LICENCE_ANONYMOUS, 24 'Icon' => '', 25 )); 19 26 } 20 27 } -
trunk/Modules/Referrer/Referrer.php
r547 r548 22 22 $this->Log(); 23 23 $this->System->RegisterPage('banners.php', 'PageReferrer'); 24 $this->System->RegisterMenuItem(array( 25 'Title' => 'Propagace', 26 'Hint' => 'Informace k propagaci tohoto projektu', 27 'Link' => $this->System->Link('/banners.php'), 28 'Permission' => LICENCE_ANONYMOUS, 29 'Icon' => '', 30 )); 24 31 } 25 32 -
trunk/Modules/Team/Team.php
r547 r548 17 17 { 18 18 $this->System->RegisterPage('team.php', 'PageTeam'); 19 $this->System->RegisterMenuItem(array( 20 'Title' => 'Týmy', 21 'Hint' => 'Seznam překladatelských týmů', 22 'Link' => $this->System->Link('/team.php?search='), 23 'Permission' => LICENCE_ANONYMOUS, 24 'Icon' => '', 25 )); 19 26 } 20 27 } -
trunk/Modules/User/User.php
r547 r548 26 26 $this->System->RegisterPage('registrace.php', 'PageUserRegistration'); 27 27 $this->System->RegisterPage('user.php', 'PageUserProfile'); 28 $this->System->RegisterMenuItem(array( 29 'Title' => 'Překladatelé', 30 'Hint' => 'Seznam registrovaných uživatelů', 31 'Link' => $this->System->Link('/userlist.php?action=nofilter'), 32 'Permission' => LICENCE_ANONYMOUS, 33 'Icon' => '', 34 )); 28 35 } 29 36 } -
trunk/includes/Page.php
r547 r548 82 82 global $Config, $User, $System; 83 83 84 $Menu = array85 (86 array(87 'Title' => 'Domů',88 'Hint' => 'Hlavní stránka',89 'Link' => $System->Link('/'),90 'Permission' => LICENCE_ANONYMOUS,91 'Icon' => '',92 ),93 array(94 'Title' => 'Slovníček',95 'Hint' => 'Slovník WoW výrazů',96 'Link' => $System->Link('/dictionary.php'),97 'Permission' => LICENCE_ANONYMOUS,98 'Icon' => '',99 ),100 array(101 'Title' => 'Stav dokončení',102 'Hint' => 'Stav dokončení překládů',103 'Link' => $System->Link('/statistic.php'),104 'Permission' => LICENCE_ANONYMOUS,105 'Icon' => '',106 ),107 array(108 'Title' => 'Překladatelé',109 'Hint' => 'Seznam registrovaných uživatelů',110 'Link' => $System->Link('/userlist.php?action=nofilter'),111 'Permission' => LICENCE_ANONYMOUS,112 'Icon' => '',113 ),114 array(115 'Title' => 'Týmy',116 'Hint' => 'Seznam překladatelských týmů',117 'Link' => $System->Link('/team.php?search='),118 'Permission' => LICENCE_ANONYMOUS,119 'Icon' => '',120 ),121 array(122 'Title' => 'Servery',123 'Hint' => 'Seznam serverů, kde je nasazena čeština v praxi',124 'Link' => $System->Link('/serverlist.php'),125 'Permission' => LICENCE_ANONYMOUS,126 'Icon' => '',127 ),128 array(129 'Title' => 'Exporty',130 'Hint' => 'Zde si můžete stáhnout přeložené texty',131 'Link' => $System->Link('/export/'),132 'Permission' => LICENCE_ANONYMOUS,133 'Icon' => '',134 ),135 array(136 'Title' => 'Soubory',137 'Hint' => 'Stahování různých pomocných souborů a programů',138 'Link' => $System->Link('/download.php'),139 'Permission' => LICENCE_ANONYMOUS,140 'Icon' => '',141 ),142 array(143 'Title' => 'Pokyny',144 'Hint' => 'Informace k překladu hry',145 'Link' => $System->Link('/info.php'),146 'Permission' => LICENCE_ANONYMOUS,147 'Icon' => '',148 ),149 array(150 'Title' => 'Zdroje dat',151 'Hint' => 'Informace o překladových skupinách',152 'Link' => $System->Link('/TranslationList.php?action=grouplist'),153 'Permission' => LICENCE_ANONYMOUS,154 'Icon' => '',155 ),156 array(157 'Title' => 'Propagace',158 'Hint' => 'Informace k propagaci tohoto projektu',159 'Link' => $System->Link('/banners.php'),160 'Permission' => LICENCE_ANONYMOUS,161 'Icon' => '',162 ),163 array(164 'Title' => 'Prezentace',165 'Hint' => 'Prezentace a motivace překladu',166 'Link' => $System->Link('/promotion.php'),167 'Permission' => LICENCE_ANONYMOUS,168 'Icon' => '',169 ),170 array(171 'Title' => 'Verze hry',172 'Hint' => 'Seznam verzí herního klienta',173 'Link' => $System->Link('/version.php'),174 'Permission' => LICENCE_ANONYMOUS,175 'Icon' => '',176 ),177 array(178 'Title' => 'AoWoW',179 'Hint' => 'Vyhledávací databáze podobná WoWHead s překlady',180 'Link' => $System->Link('/aowow/'),181 'Permission' => LICENCE_ANONYMOUS,182 'Icon' => '',183 ),184 array(185 'Title' => 'IRC chat',186 'Hint' => 'IRC chat pro překladatele',187 'Link' => 'http://embed.mibbit.com/?server=game.zdechov.net%3A6667&channel=%23wowpreklad&forcePrompt=true&charset=utf-8',188 'Permission' => LICENCE_ANONYMOUS,189 'Icon' => '',190 ),191 array(192 'Title' => 'Správa',193 'Hint' => 'Volby pro správu',194 'Link' => $System->Link('/admin/'),195 'Permission' => LICENCE_ADMIN,196 'Icon' => '',197 ),198 );199 200 84 $Output = '<strong>Nabídka:</strong>'. 201 85 '<div class="verticalmenu"><ul>'; 202 foreach($ Menu as $MenuItem)86 foreach($System->Menu as $MenuItem) 203 87 if($User->Licence($MenuItem['Permission'])) 204 88 { -
trunk/includes/global.php
r547 r548 19 19 include_once(dirname(__FILE__).'/../Modules/Team/Team.php'); 20 20 include_once(dirname(__FILE__).'/../Modules/User/User.php'); 21 include_once(dirname(__FILE__).'/../Modules/Dictionary/Dictionary.php'); 21 22 22 23 GlobalInit(); … … 67 68 $System->ModuleManager->RegisterModule(new ModuleFrontPage($System)); 68 69 $System->ModuleManager->RegisterModule(new ModuleTeam($System)); 70 $System->ModuleManager->RegisterModule(new ModuleDictionary($System)); 69 71 $System->ModuleManager->StartAll(); 70 72 } -
trunk/includes/system.php
r545 r548 43 43 $this->Database->LogSQLQuery = $this->Config['Web']['LogSQLQuery']; 44 44 $this->ModuleManager = new AppModuleManager(); 45 46 $this->Menu = array 47 ( 48 array( 49 'Title' => 'Stav dokončení', 50 'Hint' => 'Stav dokončení překládů', 51 'Link' => $this->Link('/statistic.php'), 52 'Permission' => LICENCE_ANONYMOUS, 53 'Icon' => '', 54 ), 55 array( 56 'Title' => 'Servery', 57 'Hint' => 'Seznam serverů, kde je nasazena čeština v praxi', 58 'Link' => $this->Link('/serverlist.php'), 59 'Permission' => LICENCE_ANONYMOUS, 60 'Icon' => '', 61 ), 62 array( 63 'Title' => 'Exporty', 64 'Hint' => 'Zde si můžete stáhnout přeložené texty', 65 'Link' => $this->Link('/export/'), 66 'Permission' => LICENCE_ANONYMOUS, 67 'Icon' => '', 68 ), 69 array( 70 'Title' => 'Soubory', 71 'Hint' => 'Stahování různých pomocných souborů a programů', 72 'Link' => $this->Link('/download.php'), 73 'Permission' => LICENCE_ANONYMOUS, 74 'Icon' => '', 75 ), 76 array( 77 'Title' => 'Pokyny', 78 'Hint' => 'Informace k překladu hry', 79 'Link' => $this->Link('/info.php'), 80 'Permission' => LICENCE_ANONYMOUS, 81 'Icon' => '', 82 ), 83 array( 84 'Title' => 'Zdroje dat', 85 'Hint' => 'Informace o překladových skupinách', 86 'Link' => $this->Link('/TranslationList.php?action=grouplist'), 87 'Permission' => LICENCE_ANONYMOUS, 88 'Icon' => '', 89 ), 90 array( 91 'Title' => 'Prezentace', 92 'Hint' => 'Prezentace a motivace překladu', 93 'Link' => $this->Link('/promotion.php'), 94 'Permission' => LICENCE_ANONYMOUS, 95 'Icon' => '', 96 ), 97 array( 98 'Title' => 'Verze hry', 99 'Hint' => 'Seznam verzí herního klienta', 100 'Link' => $this->Link('/version.php'), 101 'Permission' => LICENCE_ANONYMOUS, 102 'Icon' => '', 103 ), 104 array( 105 'Title' => 'IRC chat', 106 'Hint' => 'IRC chat pro překladatele', 107 'Link' => 'http://embed.mibbit.com/?server=game.zdechov.net%3A6667&channel=%23wowpreklad&forcePrompt=true&charset=utf-8', 108 'Permission' => LICENCE_ANONYMOUS, 109 'Icon' => '', 110 ), 111 array( 112 'Title' => 'Správa', 113 'Hint' => 'Volby pro správu', 114 'Link' => $this->Link('/admin/'), 115 'Permission' => LICENCE_ADMIN, 116 'Icon' => '', 117 ), 118 ); 119 45 120 } 46 121 … … 69 144 $Page[$LastKey] = $Handler; 70 145 } else $this->Pages[$Path] = $Handler; 146 } 147 148 function RegisterMenuItem($MenuItem) 149 { 150 $this->Menu[] = $MenuItem; 71 151 } 72 152 -
trunk/promotion.php
r504 r548 1 1 <?php 2 2 3 3 include('includes/global.php');
Note:
See TracChangeset
for help on using the changeset viewer.