Ignore:
Timestamp:
Jan 9, 2016, 11:45:01 PM (9 years ago)
Author:
chronos
Message:
  • Modified: Some libraries moved to Common package located at Packages directory.
  • Modified: Application class System renamed to Core. System class is not just basic parent class for application.
  • Fixed: alert file now use same application class as other files.
  • Modified: Error application module.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/system.php

    r837 r838  
    11<?php
    22
    3 include_once('Database.php');
    4 include_once('Application.php');
    5 
    6 class System extends Application
     3class Core extends Application
    74{
    8   var $Database;
    95  var $Config;
    10   var $ModuleManager;
    116  var $PathItems;
    127  var $Menu;
    138  var $DoNotShowPage;
    149  var $OnPageNotFound;
     10  var $Pages;
    1511
    1612  function __construct()
    1713  {
     14    parent::__construct();
    1815    $this->Config = array();
    1916    $this->Menu = array();
     
    2118    $this->DoNotShowPage = false;
    2219    $this->OnPageNotFound = array();
     20    $this->Pages = array();
    2321  }
    2422
     
    2826
    2927    $this->Config = $Config;
    30     $this->Database = new Database();
    3128    $this->Database->Connect($this->Config['Database']['Host'],
    3229      $this->Config['Database']['User'], $this->Config['Database']['Password'],
     
    3633    $this->Database->ShowSQLError = $this->Config['Web']['ShowSQLError'];
    3734    $this->Database->LogSQLQuery = $this->Config['Web']['LogSQLQuery'];
    38     $this->ModuleManager = new AppModuleManager();
    3935
    4036    $this->PathItems = ProcessURL();
     
    5955    $this->Menu = array
    6056    (
    61    /*     array(
    62             'Title' => T('Files'),
    63             'Hint' => 'Stahování různých pomocných souborů a programů',
    64             'Link' => $this->Link('/download.php'),
    65             'Permission' => LICENCE_ANONYMOUS,
    66             'Icon' => '',
    67         ),
    68         */
    69         array(
    70             'Title' => T('Instructions'),
    71             'Hint' => 'Informace k překladu hry',
    72             'Link' => $this->Link('/info.php'),
    73             'Permission' => LICENCE_ANONYMOUS,
    74             'Icon' => '',
    75         ),
    76         array(
    77             'Title' => T('Data source'),
    78             'Hint' => 'Informace o překladových skupinách',
    79             'Link' => $this->Link('/TranslationList.php?action=grouplist'),
    80             'Permission' => LICENCE_ANONYMOUS,
    81             'Icon' => '',
    82         ),
    83         array(
    84             'Title' => T('Presentation'),
    85             'Hint' => 'Prezentace a motivace překladu',
    86             'Link' => $this->Link('/promotion.php'),
    87             'Permission' => LICENCE_ANONYMOUS,
    88             'Icon' => '',
    89         ),
    90         array(
    91             'Title' => T('IRC chat'),
    92             'Hint' => 'IRC chat pro překladatele',
    93             'Link' => 'http://embed.mibbit.com/?server=game.zdechov.net%3A6667&amp;channel=%23wowpreklad&amp;forcePrompt=true&amp;charset=utf-8',
    94             'Permission' => LICENCE_ANONYMOUS,
    95             'Icon' => '',
    96         ),
    97         array(
    98             'Title' => T('Administration'),
    99             'Hint' => 'Volby pro správu',
    100             'Link' => $this->Link('/admin/'),
    101             'Permission' => LICENCE_ADMIN,
    102             'Icon' => '',
    103         ),
     57      /*     array(
     58       'Title' => T('Files'),
     59       'Hint' => 'Stahování různých pomocných souborů a programů',
     60       'Link' => $this->Link('/download.php'),
     61       'Permission' => LICENCE_ANONYMOUS,
     62       'Icon' => '',
     63      ),
     64    */
     65      array(
     66        'Title' => T('Instructions'),
     67        'Hint' => 'Informace k překladu hry',
     68        'Link' => $this->Link('/info.php'),
     69        'Permission' => LICENCE_ANONYMOUS,
     70        'Icon' => '',
     71      ),
     72      array(
     73        'Title' => T('Data source'),
     74        'Hint' => 'Informace o překladových skupinách',
     75        'Link' => $this->Link('/TranslationList.php?action=grouplist'),
     76        'Permission' => LICENCE_ANONYMOUS,
     77        'Icon' => '',
     78      ),
     79      array(
     80        'Title' => T('Presentation'),
     81        'Hint' => 'Prezentace a motivace překladu',
     82        'Link' => $this->Link('/promotion.php'),
     83        'Permission' => LICENCE_ANONYMOUS,
     84        'Icon' => '',
     85      ),
     86      array(
     87        'Title' => T('IRC chat'),
     88        'Hint' => 'IRC chat pro překladatele',
     89        'Link' => 'http://embed.mibbit.com/?server=game.zdechov.net%3A6667&amp;channel=%23wowpreklad&amp;forcePrompt=true&amp;charset=utf-8',
     90        'Permission' => LICENCE_ANONYMOUS,
     91        'Icon' => '',
     92      ),
     93      array(
     94        'Title' => T('Administration'),
     95        'Hint' => 'Volby pro správu',
     96        'Link' => $this->Link('/admin/'),
     97        'Permission' => LICENCE_ADMIN,
     98        'Icon' => '',
     99      ),
    104100    );
    105101  }
     
    107103  function Run()
    108104  {
    109     global $System, $ScriptStartTime, $TranslationTree, $User, $StopAfterUpdateManager,
     105    global $ScriptStartTime, $TranslationTree, $StopAfterUpdateManager,
    110106      $UpdateManager, $Config, $DatabaseRevision;
    111107
     
    139135
    140136    // Initialize application modules
    141     $this->ModuleManager->RegisterModule(new ModuleError($System));
    142     $this->ModuleManager->Modules['Error']->ShowError = $Config['Web']['ShowPHPError'];
    143     $this->ModuleManager->RegisterModule(new ModuleLog($System));
    144     $this->ModuleManager->RegisterModule(new ModuleUser($System));
    145     $this->ModuleManager->RegisterModule(new ModuleAoWoW($System));
    146     $this->ModuleManager->RegisterModule(new ModuleReferrer($System));
    147     $this->ModuleManager->Modules['Referrer']->Excludes[] = $System->Config['Web']['Host'];
    148     $this->ModuleManager->RegisterModule(new ModuleTeam($System));
    149     $this->ModuleManager->RegisterModule(new ModuleDictionary($System));
    150     $this->ModuleManager->RegisterModule(new ModuleTranslation($System));
    151     $this->ModuleManager->RegisterModule(new ModuleImport($System));
    152     $this->ModuleManager->RegisterModule(new ModuleExport($System));
    153     $this->ModuleManager->RegisterModule(new ModuleServer($System));
    154     $this->ModuleManager->RegisterModule(new ModuleClientVersion($System));
    155     $this->ModuleManager->RegisterModule(new ModuleShoutBox($System));
    156     $this->ModuleManager->RegisterModule(new ModuleNews($System));
    157     $this->ModuleManager->RegisterModule(new ModuleWiki($System));
    158     $this->ModuleManager->RegisterModule(new ModuleSearch($System));
    159     $this->ModuleManager->RegisterModule(new ModuleFrontPage($System));
    160     $this->ModuleManager->RegisterModule(new ModuleDownload($System));
    161     $this->ModuleManager->RegisterModule(new ModuleForum($System));
    162     $this->ModuleManager->RegisterModule(new ModuleRedirection($System));
     137    $this->ModuleManager->RegisterModule(new ModuleError($this));
     138    $this->ModuleManager->Modules['Error']->ErrorHandler->ShowError = $Config['Web']['ShowPHPError'];
     139    $this->ModuleManager->RegisterModule(new ModuleLog($this));
     140    $this->ModuleManager->RegisterModule(new ModuleUser($this));
     141    $this->ModuleManager->RegisterModule(new ModuleAoWoW($this));
     142    $this->ModuleManager->RegisterModule(new ModuleReferrer($this));
     143    $this->ModuleManager->Modules['Referrer']->Excludes[] = $this->Config['Web']['Host'];
     144    $this->ModuleManager->RegisterModule(new ModuleTeam($this));
     145    $this->ModuleManager->RegisterModule(new ModuleDictionary($this));
     146    $this->ModuleManager->RegisterModule(new ModuleTranslation($this));
     147    $this->ModuleManager->RegisterModule(new ModuleImport($this));
     148    $this->ModuleManager->RegisterModule(new ModuleExport($this));
     149    $this->ModuleManager->RegisterModule(new ModuleServer($this));
     150    $this->ModuleManager->RegisterModule(new ModuleClientVersion($this));
     151    $this->ModuleManager->RegisterModule(new ModuleShoutBox($this));
     152    $this->ModuleManager->RegisterModule(new ModuleNews($this));
     153    $this->ModuleManager->RegisterModule(new ModuleWiki($this));
     154    $this->ModuleManager->RegisterModule(new ModuleSearch($this));
     155    $this->ModuleManager->RegisterModule(new ModuleFrontPage($this));
     156    $this->ModuleManager->RegisterModule(new ModuleDownload($this));
     157    $this->ModuleManager->RegisterModule(new ModuleForum($this));
     158    $this->ModuleManager->RegisterModule(new ModuleRedirection($this));
     159    $this->ModuleManager->FileName = dirname(__FILE__).'/../Config/ModulesConfig.php';
     160    // TODO: Allow control from web which modules should be installed
     161    $this->ModuleManager->InstallAll();
    163162    $this->ModuleManager->StartAll();
    164163
     
    276275    if($this->System->User->Licence(LICENCE_USER))
    277276    {
    278       //$DbResult = $System->Database->query('SELECT `Id`, `Name` FROM `Team` WHERE `Id`='.$this->System->User->Team);
     277      //$DbResult =$this->Database->query('SELECT `Id`, `Name` FROM `Team` WHERE `Id`='.$this->System->User->Team);
    279278      //$Team = $DbResult->fetch_assoc();
    280279      //$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>';
Note: See TracChangeset for help on using the changeset viewer.