Changeset 860 for trunk/includes
- Timestamp:
- Jan 21, 2016, 2:49:19 PM (9 years ago)
- Location:
- trunk/includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/Global.php
r859 r860 9 9 include_once(dirname(__FILE__).'/../Application/Version.php'); 10 10 require_once(dirname(__FILE__).'/../HTML/BBCodeParser2.php'); 11 12 // Include application modules13 // TODO: Make modules configurable14 include_once(dirname(__FILE__).'/../Modules/Error/Error.php');15 include_once(dirname(__FILE__).'/../Modules/Log/Log.php');16 include_once(dirname(__FILE__).'/../Modules/Translation/Translation.php');17 include_once(dirname(__FILE__).'/../Modules/AoWoW/AoWoW.php');18 include_once(dirname(__FILE__).'/../Modules/Referrer/Referrer.php');19 include_once(dirname(__FILE__).'/../Modules/Team/Team.php');20 include_once(dirname(__FILE__).'/../Modules/User/User.php');21 include_once(dirname(__FILE__).'/../Modules/Dictionary/Dictionary.php');22 include_once(dirname(__FILE__).'/../Modules/Import/Import.php');23 include_once(dirname(__FILE__).'/../Modules/Export/Export.php');24 include_once(dirname(__FILE__).'/../Modules/Server/Server.php');25 include_once(dirname(__FILE__).'/../Modules/ClientVersion/ClientVersion.php');26 include_once(dirname(__FILE__).'/../Modules/ShoutBox/ShoutBox.php');27 include_once(dirname(__FILE__).'/../Modules/News/News.php');28 include_once(dirname(__FILE__).'/../Modules/Wiki/Wiki.php');29 include_once(dirname(__FILE__).'/../Modules/Search/Search.php');30 include_once(dirname(__FILE__).'/../Modules/FrontPage/FrontPage.php');31 include_once(dirname(__FILE__).'/../Modules/Download/Download.php');32 include_once(dirname(__FILE__).'/../Modules/Forum/Forum.php');33 include_once(dirname(__FILE__).'/../Modules/Redirection/Redirection.php');34 include_once(dirname(__FILE__).'/../Modules/Admin/Admin.php');35 include_once(dirname(__FILE__).'/../Modules/Info/Info.php');36 37 11 38 12 // Back compatibility, will be removed -
trunk/includes/System.php
r859 r860 11 11 /* @var LocaleManager */ 12 12 var $LocaleManager; 13 var $Bars; 13 14 14 15 function __construct() … … 21 22 $this->OnPageNotFound = array(); 22 23 $this->Pages = array(); 24 $this->Bars = array(); 23 25 } 24 26 … … 28 30 29 31 $this->Config = $Config; 30 date_default_timezone_set($this->Config['Web']['Timezone']); 32 if(isset($this->Config['Web']['Timezone'])) 33 date_default_timezone_set($this->Config['Web']['Timezone']); 31 34 mb_internal_encoding("UTF-8"); 32 35 … … 78 81 'Icon' => '', 79 82 ), 80 */ 83 81 84 array( 82 85 'Title' => T('IRC chat'), … … 86 89 'Icon' => '', 87 90 ), 91 */ 88 92 ); 89 93 } … … 106 110 foreach($_GET as $Index => $Item) $_GET[$Index] = addslashes($_GET[$Index]); 107 111 112 $this->RegisterPageBar('Top'); 113 $this->RegisterPageBar('Left'); 114 $this->RegisterPageBar('Right'); 108 115 $this->Init(); 109 116 … … 116 123 $this->ModuleManager->Start(); 117 124 } 118 119 // Initialize application modules120 $this->ModuleManager->RegisterModule(new ModuleError($this));121 $this->ModuleManager->Modules['Error']->ErrorHandler->ShowError = $this->Config['Web']['ShowPHPError'];122 $this->ModuleManager->RegisterModule(new ModuleLog($this));123 $this->ModuleManager->RegisterModule(new ModuleUser($this));124 $this->ModuleManager->RegisterModule(new ModuleAoWoW($this));125 $this->ModuleManager->RegisterModule(new ModuleReferrer($this));126 $this->ModuleManager->Modules['Referrer']->Excludes[] = $this->Config['Web']['Host'];127 $this->ModuleManager->RegisterModule(new ModuleTeam($this));128 $this->ModuleManager->RegisterModule(new ModuleDictionary($this));129 $this->ModuleManager->RegisterModule(new ModuleTranslation($this));130 $this->ModuleManager->RegisterModule(new ModuleImport($this));131 $this->ModuleManager->RegisterModule(new ModuleExport($this));132 $this->ModuleManager->RegisterModule(new ModuleServer($this));133 $this->ModuleManager->RegisterModule(new ModuleClientVersion($this));134 $this->ModuleManager->RegisterModule(new ModuleShoutBox($this));135 $this->ModuleManager->RegisterModule(new ModuleNews($this));136 $this->ModuleManager->RegisterModule(new ModuleWiki($this));137 $this->ModuleManager->RegisterModule(new ModuleSearch($this));138 $this->ModuleManager->RegisterModule(new ModuleFrontPage($this));139 $this->ModuleManager->RegisterModule(new ModuleDownload($this));140 $this->ModuleManager->RegisterModule(new ModuleForum($this));141 $this->ModuleManager->RegisterModule(new ModuleRedirection($this));142 $this->ModuleManager->RegisterModule(new ModuleAdmin($this));143 $this->ModuleManager->RegisterModule(new ModuleInfo($this));144 $this->ModuleManager->FileName = dirname(__FILE__).'/../Config/ModulesConfig.php';145 // TODO: Allow control from web which modules should be installed146 $this->ModuleManager->InstallAll();147 $this->ModuleManager->StartAll();148 125 149 126 $this->BaseView = new BaseView($this); … … 327 304 echo($Output); 328 305 } 306 307 function RegisterPageBar($Name) 308 { 309 $this->Bars[$Name] = array(); 310 } 311 312 function UnregisterPageBar($Name) 313 { 314 unset($this->Bars[$Name]); 315 } 316 317 function RegisterPageBarItem($BarName, $ItemName, $Callback) 318 { 319 $this->Bars[$BarName][$ItemName] = $Callback; 320 } 329 321 } 330 322 … … 357 349 { 358 350 $Output = '<div class="Menu">'; 359 if(!$this->System->User->Licence(LICENCE_USER)) 360 $Output .= '<div class="advert">'.$this->System->Config['Web']['Advertisement'].'</div>'; 351 if(isset($this->System->User)) 352 { 353 if(!$this->System->User->Licence(LICENCE_USER)) 354 $Output .= '<div class="advert">'.$this->System->Config['Web']['Advertisement'].'</div>'; 355 } 361 356 $Output .= '<span class="MenuItem"></span><span class="MenuItem2">'; 362 if($this->System->User->Licence(LICENCE_USER)) 363 { 364 //$DbResult =$this->Database->query('SELECT `Id`, `Name` FROM `Team` WHERE `Id`='.$this->System->User->Team); 365 //$Team = $DbResult->fetch_assoc(); 366 //$Output .= ''<span class="MenuItem">Moje překlady: <a href="">Dokončené</a> <a href="">Rozpracované</a> <a href="">Exporty</a> Tým: <a href="">'.$Team['name'].'</a></span>'; 367 $Output .= $this->System->User->Name.' <a href="'.$this->System->Link('/?action=logout').'">'.T('Logout').'</a>'. 368 ' <a href="'.$this->System->Link('/user/?user='.$this->System->User->Id).'">'.T('My page').'</a>'. 369 ' <a href="'.$this->System->Link('/options/').'">'.T('Options').'</a>'. 370 ' <a title="Vámi přeložené texty" href="'.$this->System->Link('/TranslationList.php?user='. 371 $this->System->User->Id.'&group=0&state=2&text=&entry=').'">'.T('Translated').'</a>'. 372 ' <a title="Vaše rozpracované text" href="'.$this->System->Link('/TranslationList.php?user='. 373 $this->System->User->Id.'&group=0&state=3&text=&entry=').'">'.T('Unfinished').'</a>'. 374 ' <a title="Nikým nepřeložené texty" href="'. 375 $this->System->Link('/TranslationList.php?user=0&group=0&state=1&text=&entry=').'">'.T('Untranslated').'</a>'; 376 } else 377 { 378 $Output .= '<a href="'.$this->System->Link('/login/').'">'.T('Login').'</a> '. 379 '<a href="'.$this->System->Link('/registration/').'">'.T('Registration').'</a>'; 380 } 357 358 // Show bars items 359 $Bar = ''; 360 foreach($this->System->Bars['Top'] as $BarItem) 361 $Bar .= call_user_func($BarItem); 362 if(trim($Bar) != '') $Output .= $Bar; 363 else $Output .= ' '; 364 381 365 $Output .= $this->ShowLocaleSelector(); 382 366 //$Output .= '</form>'; … … 432 416 '<div class="verticalmenu"><ul>'; 433 417 foreach($this->System->Menu as $MenuItem) 434 if( $this->System->User->Licence($MenuItem['Permission']))418 if(!isset($this->System->User) or $this->System->User->Licence($MenuItem['Permission'])) 435 419 { 436 420 if(isset($MenuItem['Click'])) $OnClick = ' onclick="'.$MenuItem['Click'].'"'; … … 466 450 ' <a title="Přeložené texty, můžete zde hlasovat, nebo opravovat překlady" href="'. 467 451 $this->System->Link('/TranslationList.php?group='.$Group['Id'].'&state=2&user=0&entry=&text=').'">'.T('Translated').'</a><br />'; 468 if( $this->System->User->Licence(LICENCE_USER))452 if(isset($this->System->User) and $this->System->User->Licence(LICENCE_USER)) 469 453 { 470 454 $Output .= ' <a title="'.T('Unfinished translations').'" href="'.$this->System->Link('/TranslationList.php?group='.$Group['Id'].'&state=3').'">'.T('Unfinished').'</a><br />'.
Note:
See TracChangeset
for help on using the changeset viewer.