Changeset 838


Ignore:
Timestamp:
Jan 9, 2016, 11:45:01 PM (8 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.
Location:
trunk
Files:
18 added
5 deleted
33 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Modules/AoWoW/AoWoW.php

    r816 r838  
    33class ModuleAoWoW extends AppModule
    44{
    5   function __construct($System)
     5  function __construct(System $System)
    66  {
    77    parent::__construct($System);
     
    1414  }
    1515
    16   function Start()
     16  function DoStart()
    1717  {
    1818    $this->System->RegisterMenuItem(array(
  • trunk/Modules/ClientVersion/ClientVersion.php

    r816 r838  
    33class ModuleClientVersion extends AppModule
    44{
    5   function __construct($System)
     5  function __construct(System $System)
    66  {
    77    parent::__construct($System);
     
    1111    $this->License = 'GNU/GPL';
    1212    $this->Description = 'Manage and show list of known versions of WoW client.';
    13     $this->Dependencies = array('');
     13    $this->Dependencies = array();
    1414  }
    1515
    16   function Start()
     16  function DoStart()
    1717  {
    1818    $this->System->RegisterPage('client-version', 'PageClientVersion');
  • trunk/Modules/Dictionary/Dictionary.php

    r829 r838  
    33class ModuleDictionary extends AppModule
    44{
    5   function __construct($System)
     5  function __construct(System $System)
    66  {
    77    parent::__construct($System);
     
    1414  }
    1515
    16   function Start()
     16  function DoStart()
    1717  {
    1818    $this->System->RegisterPage('dictionary', 'PageDictionary');
  • trunk/Modules/Download/Download.php

    r816 r838  
    33class ModuleDownload extends AppModule
    44{
    5   function __construct($System)
     5  function __construct(System $System)
    66  {
    77    parent::__construct($System);
     
    1414  }
    1515
    16   function Start()
     16  function DoStart()
    1717  {
    1818    $this->System->RegisterPage('download', 'PageDownload');
  • trunk/Modules/Error/Error.php

    r816 r838  
    33class ModuleError extends AppModule
    44{
    5   var $Encoding;
    6   var $ShowError;
    7   var $UserErrors;
    85  var $OnError;
     6  var $ErrorHandler;
    97
    10   function __construct($System)
     8  function __construct(System $System)
    119  {
    1210    parent::__construct($System);
     
    1816    $this->Dependencies = array();
    1917
    20     $this->Encoding = 'utf-8';
    21     $this->ShowError = false;
    22     $this->UserErrors = E_ALL;  //E_ERROR | E_WARNING | E_PARSE;
    2318    $this->OnError = array();
     19    $this->ErrorHandler = new ErrorHandler();
     20    $this->ErrorHandler->OnError[] = array($this, 'DoError');
    2421  }
    2522
    26   function Install()
     23  function DoStart()
    2724  {
    28     parent::Install();
     25    $this->ErrorHandler->Start();
    2926  }
    3027
    31   function UnInstall()
     28  function DoStop()
    3229  {
    33     parent::UnInstall();
     30    $this->ErrorHandler->Stop();
    3431  }
    3532
    36   function Start()
     33  function DoError($Error)
    3734  {
    38     parent::Start();
    39     set_error_handler(array($this, 'ErrorHandler'));
    40     set_exception_handler(array($this, 'ExceptionHandler'));
    41   }
    42 
    43   function Stop()
    44   {
    45     restore_error_handler();
    46     restore_exception_handler();
    47     parent::Stop();
    48   }
    49 
    50   function ErrorHandler($Number, $Message, $FileName, $LineNumber, $Variables)
    51   {
    52     $ErrorType = array
    53     (
    54       1 => 'Error',
    55       2 => 'Warning',
    56       4 => 'Parsing Error',
    57       8 => 'Notice',
    58       16 => 'Core Error',
    59       32 => 'Core Warning',
    60       64 => 'Compile Error',
    61       128 => 'Compile Warning',
    62       256 => 'User Error',
    63       512 => 'User Warning',
    64       1024 => 'User Notice'
    65     );
    66 
    67     if(($this->UserErrors & $Number))
    68     {
    69       $Backtrace = debug_backtrace();
    70       $Backtrace[0]['function'] = $Message;
    71       $Backtrace[0]['args'] = '';
    72       $Backtrace[0]['file'] = $FileName;
    73       $Backtrace[0]['line'] = $LineNumber;
    74       $this->Report($Backtrace);
    75       //if((E_ERROR | E_PARSE) & $Number)
    76       die();
    77     }
    78   }
    79 
    80   function ExceptionHandler(Exception $Exception)
    81   {
    82     $Backtrace = $Exception->getTrace();
    83     array_unshift($Backtrace, array(
    84       'function' => $Exception->getMessage(),
    85       'file' => $Exception->getFile(),
    86       'line' => $Exception->getLine(),
    87     ));
    88     $this->Report($Backtrace);
    89     die();
    90   }
    91 
    92   function Report($Backtrace)
    93   {
    94     $Date = date('Y-m-d H:i:s');
    95     $Error = '# '.$Date."\n";
    96     foreach($Backtrace as $Item)
    97     {
    98       if(!array_key_exists('line', $Item)) $Item['line'] = '';
    99       if(!array_key_exists('file', $Item)) $Item['file'] = '';
    100 
    101       $Error .= ' '.$Item['file'].'('.$Item['line'].")\t".$Item['function'];
    102       $Arguments = '';
    103       if(array_key_exists('args', $Item) and is_array($Item['args']))
    104         foreach($Item['args'] as $Item)
    105         {
    106           if(is_object($Item)) ;
    107           else if(is_array($Item)) $Arguments .= "'".serialize($Item)."',";
    108           else $Arguments .= "'".$Item."',";
    109         }
    110         if(strlen($Arguments) > 0) $Error .= '('.substr($Arguments, 0, -1).')';
    111         $Error .= "\n";
    112     }
    113     $Error .= "\n";
    114 
    115     // Show error message
    116     $Output = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head>'."\n".
    117       '<meta http-equiv="Content-Language" content="cs">'."\n".
    118       '<meta http-equiv="Content-Type" content="text/html; charset='.$this->Encoding.'"></head><body>'."\n".
    119       T('An internal error occurred! <br /> Administrator has been made ​​aware of it and the error soon will be removed.').'<br/><br/>';
    120     if($this->ShowError == true)
    121       $Output .= '<pre>'.$Error.'</pre><br/>';
    122     $Output .= '</body></html>';
    123     echo($Output);
    12435    foreach($this->OnError as $OnError)
    125       $OnError[0]->$OnError[1]($Error);
     36      call_user_func($OnError, $Error);
    12637  }
    12738}
  • trunk/Modules/Export/Export.php

    r816 r838  
    1616  function Init()
    1717  {
    18     $this->TempDir = dirname(__FILE__).'/../../'.$this->Config['Web']['TempFolder'].'Export/'.$this->Id.'/';
     18    $this->TempDir = dirname(__FILE__).'/../../'.$this->System->Config['Web']['TempFolder'].'Export/'.$this->Id.'/';
    1919    if(!file_exists($this->TempDir)) mkdir($this->TempDir, 0777, true);
    20     $this->TempDirRelative = $this->Config['Web']['TempFolder'].'Export/'.$this->Id.'/';
    21     $this->SourceDir = dirname(__FILE__).'/../../'.$this->Config['Web']['SourceFolder'];
    22     $this->SourceDirRelative = $this->Config['Web']['SourceFolder'];
     20    $this->TempDirRelative = $this->System->Config['Web']['TempFolder'].'Export/'.$this->Id.'/';
     21    $this->SourceDir = dirname(__FILE__).'/../../'.$this->System->Config['Web']['SourceFolder'];
     22    $this->SourceDirRelative = $this->System->Config['Web']['SourceFolder'];
    2323    if(!file_exists($this->SourceDir)) mkdir($this->SourceDir, 0777, true);
    2424  }
     
    161161      "-- ===========================================\n".
    162162      "--\n".
    163       "-- Web projektu: ".$this->Config['Web']['Host'].$this->System->Link('/')."\n".
     163      "-- Web projektu: ".$this->System->Config['Web']['Host'].$this->System->Link('/')."\n".
    164164      "-- Datum exportu: ".date("j.n.Y  H:i:s")."\n".
    165       "-- Znaková sada: ".$this->Config['Database']['Charset']." / ".$this->Config['Web']['Charset']."\n".
     165      "-- Znaková sada: ".$this->System->Config['Database']['Charset']." / ".$this->System->Config['Web']['Charset']."\n".
    166166      "-- Diakritika: ".$this->AnoNe[$this->Export['WithDiacritic']]."\n".
    167167      "-- Vygeneroval uživatel: ".$this->System->User->Name."\n".
     
    229229    /*
    230230    // Data to aowow
    231     $Database2 = new mysqli($this->Config['Database']['Host'], $this->Config['Database']['User'], $this->Config['Database']['Password'], $this->Config['Database']['Database']);
    232     $Database2->query('SET NAMES '.$this->Config['Database']['Charset']);
     231    $Database2 = new mysqli($this->System->Config['Database']['Host'],
     232      $this->System->Config['Database']['User'],
     233      $this->System->Config['Database']['Password'],
     234      $this->System->Config['Database']['Database']);
     235    $Database2->query('SET NAMES '.$this->System->Config['Database']['Charset']);
    233236    $Database2->select_db($AoWoWconf['mangos']['db']);
    234237    $AoWoWTables = array(
     
    256259        {
    257260          $DbResult2 = $Database2->query('SELECT `OptionText` AS `En`,
    258           (SELECT `OptionText` FROM `'.$this->Config['Database']['Database'].'`.`TextNPCOption` AS `TableTran`
     261          (SELECT `OptionText` FROM `'.$this->System->Config['Database']['Database'].'`.`TextNPCOption` AS `TableTran`
    259262           WHERE `TableEn`.`Entry` = `TableTran`.`Entry` AND (`Complete` = 1) AND '.$this->WhereLang.'
    260263            AND '.$this->WhereUsers.$this->OrderByUserList.' LIMIT 1) AS `Tran`
    261           FROM `'.$this->Config['Database']['Database'].'`.`TextNPCOption` AS `TableEn` WHERE
     264          FROM `'.$this->System->Config['Database']['Database'].'`.`TextNPCOption` AS `TableEn` WHERE
    262265            `OptionText` = "'.addslashes($Ori_text).'" LIMIT 1');
    263266          $Tran = $DbResult2->fetch_assoc();
     
    646649    "<document>\n".
    647650    "  <meta>\n".
    648     "    <projecturl>".$this->Config['Web']['Host'].$this->System->Link('/')."</projecturl>\n".
     651    "    <projecturl>".$this->System->Config['Web']['Host'].$this->System->Link('/')."</projecturl>\n".
    649652    "    <time>".date('r')."</time>\n".
    650653    "    <diacritics mode=".'"'.$this->Export['WithDiacritic'].'"'." />\n".
     
    696699class ModuleExport extends AppModule
    697700{
    698   function __construct($System)
     701  function __construct(System $System)
    699702  {
    700703    parent::__construct($System);
     
    707710  }
    708711
    709   function Start()
     712  function DoStart()
    710713  {
    711714    $this->System->RegisterPage('export', 'PageExport');
  • trunk/Modules/Export/Page.php

    r816 r838  
    9696            '<tr><td colspan="2"><input type="submit" value="'.T('Create').'" /></td></tr>'.
    9797            '</table></fieldset></form>';
    98       } else $Output = ShowMessage(T('You can\'t create another export. Max for one user is').$this->System->Config['MaxExportPerUser'].'.', MESSAGE_CRITICAL);
     98      } else $Output = ShowMessage(sprintf(T('You can\'t create another export. Max for one user is %d.'), $this->System->Config['MaxExportPerUser']), MESSAGE_CRITICAL);
    9999    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
    100100    return($Output);
     
    117117          $_GET['Filter'] = 'my';
    118118          $this->ExportList();
    119         } else $Output = ShowMessage(T('You can\'t create another export. Max for one user is').' '.$this->System->Config['MaxExportPerUser'].'.', MESSAGE_CRITICAL);
     119        } else $Output = ShowMessage(sprintf(T('You can\'t create another export. Max for one user is %d.'),$this->System->Config['MaxExportPerUser']), MESSAGE_CRITICAL);
    120120      } else $Output = ShowMessage(T('Missing data in form.'), MESSAGE_CRITICAL);
    121121    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
     
    800800            $this->ExportList();
    801801          } else $Output = ShowMessage('Zdrojový export nenalezen', MESSAGE_CRITICAL);
    802         } else $Output = ShowMessage('Nemůžete vytvářet další export. Max. počet na uživatele je '.
    803           $this->System->Config['MaxExportPerUser'].'.', MESSAGE_CRITICAL);
     802        } else $Output = ShowMessage(sprintf(T('You can\'t create another export. Max for one user is %d.'),
     803          $this->System->Config['MaxExportPerUser']), MESSAGE_CRITICAL);
    804804      } else $Output = ShowMessage(T('Export not found.'), MESSAGE_CRITICAL);
    805805    } else $Output = ShowMessage(T('Access denied'), MESSAGE_CRITICAL);
  • trunk/Modules/Export/ProcessAoWoWExport.php

    r816 r838  
    88include_once('Page.php');
    99
    10   $System = new System();
    11   $System->DoNotShowPage = true;
    12     $System->Run();
     10$System = new Core();
     11$System->DoNotShowPage = true;
     12$System->Run();
    1313
    1414$Output = '';
  • trunk/Modules/Export/ProcessTask.php

    r826 r838  
    1010
    1111//LoadCommandLineParameters();
    12 $System = new System();
     12$System = new Core();
    1313$System->DoNotShowPage = true;
    1414$System->Run();
  • trunk/Modules/Export/Progress.php

    r818 r838  
    33include_once(dirname(__FILE__).'/../../includes/global.php');
    44
    5 $System = new System();
     5$System = new Core();
    66$System->DoNotShowPage = true;
    77$System->Run();
  • trunk/Modules/Export/cmdmpqexport.php

    r816 r838  
    88include_once('Page.php');
    99
    10   $System = new System();
    11   $System->DoNotShowPage = true;
    12     $System->Run();
     10$System = new Core();
     11$System->DoNotShowPage = true;
     12$System->Run();
    1313$PageExport = new PageExport($System);
    1414
  • trunk/Modules/Forum/Forum.php

    r816 r838  
    33class ModuleForum extends AppModule
    44{
    5   function __construct($System)
     5  function __construct(System $System)
    66  {
    77    parent::__construct($System);
     
    1414  }
    1515
    16   function Start()
     16  function DoStart()
    1717  {
    1818    $this->System->RegisterPage('forum', 'PageForum');
  • trunk/Modules/FrontPage/FrontPage.php

    r816 r838  
    33class ModuleFrontPage extends AppModule
    44{
    5   function __construct($System)
     5  function __construct(System $System)
    66  {
    77    parent::__construct($System);
     
    1414  }
    1515
    16   function Start()
     16  function DoStart()
    1717  {
    1818    $this->System->RegisterPage('', 'PageFrontPage');
  • trunk/Modules/Import/Import.php

    r817 r838  
    77class ModuleImport extends AppModule
    88{
    9   function __construct($System)
     9  function __construct(System $System)
    1010  {
    1111    parent::__construct($System);
     
    1818  }
    1919
    20   function Start()
     20  function DoStart()
    2121  {
    2222    $this->System->RegisterPage('import', 'PageImport');
     
    3131  var $System;
    3232
    33   function __construct($System)
     33  function __construct(System $System)
    3434  {
    3535    $this->System = &$System;
  • trunk/Modules/Import/cmd.php

    r816 r838  
    55include_once('Import.php');
    66
    7   $System = new System();
    8   $System->DoNotShowPage = true;
    9     $System->Run();
     7$System = new Core();
     8$System->DoNotShowPage = true;
     9$System->Run();
    1010$Import = new Import($System);
    1111
  • trunk/Modules/Log/Log.php

    r818 r838  
    55  var $Excludes;
    66
    7   function __construct($System)
     7  function __construct(System $System)
    88  {
    99    parent::__construct($System);
     
    1818  }
    1919
    20   function Start()
     20  function DoStart()
    2121  {
    2222    $this->System->RegisterPage('log.php', 'PageLog');
  • trunk/Modules/News/News.php

    r828 r838  
    77  var $RSSChannels;
    88
    9   function __construct($System)
     9  function __construct(System $System)
    1010  {
    1111    parent::__construct($System);
     
    1616    $this->Description = 'Web site annoucements management';
    1717    $this->Dependencies = array();
     18    $this->RSSChannels = array();
    1819  }
    1920
    20   function Start()
     21  function DoStart()
    2122  {
    2223    $this->System->RegisterPage('news', 'PageNews');
  • trunk/Modules/Redirection/Redirection.php

    r816 r838  
    33class ModuleRedirection extends AppModule
    44{
    5   function __construct($System)
     5  function __construct(System $System)
    66  {
    77    parent::__construct($System);
     
    1515  }
    1616
    17   function Start()
     17  function DoStart()
    1818  {
    1919    $this->System->OnPageNotFound = array($this, 'ShowRedirect');
  • trunk/Modules/Referrer/Referrer.php

    r829 r838  
    55  var $Excludes;
    66
    7   function __construct($System)
     7  function __construct(System $System)
    88  {
    99    parent::__construct($System);
     
    1212    $this->Creator = 'Chronos';
    1313    $this->License = 'GNU/GPL';
    14     $this->Description = 'Log HTTP referrer URLs.';
     14    $this->Description = 'Log visitor HTTP referrer URLs to database for later evaluation.';
    1515    $this->Dependencies = array();
    1616
     
    1818  }
    1919
    20   function Start()
     20  function DoStart()
    2121  {
    2222    $this->Log();
  • trunk/Modules/Search/Search.php

    r816 r838  
    55  var $SearchItems;
    66
    7   function __construct($System)
     7  function __construct(System $System)
    88  {
    99    parent::__construct($System);
     
    1717  }
    1818
    19   function Start()
     19  function doStart()
    2020  {
    2121    $this->System->RegisterPage('search', 'PageSearch');
  • trunk/Modules/Server/Server.php

    r816 r838  
    33class ModuleServer extends AppModule
    44{
    5   function __construct($System)
     5  function __construct(System $System)
    66  {
    77    parent::__construct($System);
     
    1414  }
    1515
    16   function Start()
     16  function DoStart()
    1717  {
    1818    $this->System->RegisterPage('server', 'PageServerList');
     
    2929class PageServerList extends PageEdit
    3030{
    31   function __construct($System)
     31  function __construct(System $System)
    3232  {
    3333    parent::__construct($System);
  • trunk/Modules/ShoutBox/ShoutBox.php

    r816 r838  
    33class ModuleShoutBox extends AppModule
    44{
    5   function __construct($System)
     5  function __construct(System $System)
    66  {
    77    parent::__construct($System);
     
    1414  }
    1515
    16   function Start()
     16  function DoStart()
    1717  {
    1818    $this->System->RegisterPage('shoutbox', 'PageShoutBox');
  • trunk/Modules/Team/Team.php

    r826 r838  
    33class ModuleTeam extends AppModule
    44{
    5   function __construct($System)
     5  function __construct(System $System)
    66  {
    77    parent::__construct($System);
     
    1414  }
    1515
    16   function Start()
     16  function DoStart()
    1717  {
    1818    $this->System->RegisterPage('team', 'PageTeam');
  • trunk/Modules/Translation/Translation.php

    r826 r838  
    1111class ModuleTranslation extends AppModule
    1212{
    13   function __construct($System)
     13  function __construct(System $System)
    1414  {
    1515    parent::__construct($System);
     
    2222  }
    2323
    24   function Start()
     24  function DoStart()
    2525  {
    2626    global $TranslationTree;
  • trunk/Modules/User/User.php

    r829 r838  
    88class ModuleUser extends AppModule
    99{
    10   function __construct($System)
     10  function __construct(System $System)
    1111  {
    1212    parent::__construct($System);
     
    1919  }
    2020
    21   function Start()
     21  function DoStart()
    2222  {
    2323    $this->System->User = new User($this->System);
     
    100100  var $PreferredVersion = 0;
    101101
    102   function __construct($System)
     102  function __construct(System $System)
    103103  {
    104104    $this->System = &$System;
  • trunk/Modules/Wiki/Wiki.php

    r831 r838  
    33class ModuleWiki extends AppModule
    44{
    5   function __construct($System)
     5  function __construct(System $System)
    66  {
    77    parent::__construct($System);
     
    1414  }
    1515
    16   function Install()
    17   {
    18     parent::Install();
    19   }
    20 
    21   function UnInstall()
    22   {
    23     parent::UnInstall();
    24   }
    25 
    26   function Start()
    27   {
    28     parent::Start();
     16  function DoStart()
     17  {
    2918    $this->LoadPages();
    30   }
    31 
    32   function Stop()
    33   {
    34     parent::Stop();
    3519  }
    3620
  • trunk/admin/install.php

    r836 r838  
    174174  } else
    175175  {
    176   $System = new System();
     176  $System = new Core();
    177177  $System->Init();
    178178  $UpdateManager = new UpdateManager();
  • trunk/alert.php

    r816 r838  
    11<?php
    22
    3 include('includes/config.php');
     3$InitSystem = true;
     4include_once('includes/global.php');
    45
    5 function HumanDate($SQLDateTime)
     6class PageAlert extends Page
    67{
    7   $DateTimeParts = explode(' ', $SQLDateTime);
    8   if($DateTimeParts[0] != '0000-00-00')
     8  function Show()
    99  {
    10     $DateParts = explode('-', $DateTimeParts[0]);
    11     return(($DateParts[2] * 1).'.'.($DateParts[1] * 1).'.'.($DateParts[0] * 1));
    12   } else return('&nbsp;');
    13 }
    14 
     10    $this->RawPage = true;
    1511    $Output = 'SERVERALERT:'."\n";
    1612
    1713    $Output .= 'Toto jsou aktuality z projektu wowpreklad.zdechov.net:'."\n"."\n";
    1814
    19     $Database = new mysqli($Config['Database']['Host'],$Config['Database']['User'], $Config['Database']['Password'], $Config['Database']['Database']);
    20     $Database->query('SET NAMES "'.$Config['Database']['Charset'].'"');
    21     $DbResult = $Database->query('SELECT `News`.`Time`, `News`.`Text`, `News`.`Title`, '.
     15    $DbResult = $this->Database->query('SELECT `News`.`Time`, `News`.`Text`, `News`.`Title`, '.
    2216        '`User`.`Name` AS `User` FROM `News` JOIN `User` ON `User`.`Id`=`News`.`User` ORDER BY `News`.`Time` DESC ');
    2317    while($Article = $DbResult->fetch_assoc())
     
    2519      $Output .= ('> '.HumanDate($Article['Time']).' '.$Article['Title']."\n".strip_tags($Article['Text'])."\n\n");
    2620    }
    27     echo ($Output);
     21    return($Output);
     22  }
     23}
     24
     25$Page = new PageAlert($System);
     26ShowPageClass($Page);
  • trunk/includes/PageEdit.php

    r837 r838  
    11<?php
    2 
    3 class Page
    4 {
    5   var $System;
    6   var $Database;
    7   var $RawPage;
    8   var $Title;
    9 
    10   function __construct($System)
    11   {
    12     $this->System = &$System;
    13     $this->Database = &$System->Database;
    14     $this->RawPage = false;
    15   }
    16 
    17   function Show()
    18   {
    19     return('');
    20   }
    21 
    22   function GetOutput()
    23   {
    24     $Output = $this->Show();
    25     return($Output);
    26   }
    27 }
    282
    293class PageEdit extends Page
  • trunk/includes/Version.php

    r837 r838  
    66// and system will need database update.
    77
    8 $Revision = 837; // Subversion revision
     8$Revision = 838; // Subversion revision
    99$DatabaseRevision = 811; // Database structure revision
    10 $ReleaseTime = '2015-12-27';
     10$ReleaseTime = '2016-01-11';
  • trunk/includes/global.php

    r836 r838  
    11<?php
    22
    3 include_once(dirname(__FILE__).'/Database.php');
    4 include_once(dirname(__FILE__).'/Base.php');
     3include_once(dirname(__FILE__).'/../Packages/Common/Common.php');
    54include_once(dirname(__FILE__).'/system.php');
    65include_once(dirname(__FILE__).'/Update.php');
    7 include_once(dirname(__FILE__).'/Page.php');
     6include_once(dirname(__FILE__).'/PageEdit.php');
    87if(file_exists(dirname(__FILE__).'/config.php'))
    98  include_once(dirname(__FILE__).'/config.php');
    109include_once(dirname(__FILE__).'/Version.php');
    11 include_once(dirname(__FILE__).'/AppModule.php');
    1210include_once(dirname(__FILE__).'/Locale.php');
    13 include_once(dirname(__FILE__).'/UTF8.php');
    1411require_once(dirname(__FILE__).'/../HTML/BBCodeParser2.php');
    1512
     
    4138if(isset($InitSystem) and $InitSystem)
    4239{
    43   $System = new System();
     40  $System = new Core();
    4441  $System->DoNotShowPage = true;
    4542  $System->Run();
    46   $User = $System->User; // Back compatibility, will be removed
    4743}
    4844
  • 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>';
  • trunk/index.php

    r816 r838  
    33include_once('includes/global.php');
    44
    5 $System = new System();
     5$System = new Core();
    66$System->Run();
  • trunk/locale/cs.php

    r837 r838  
    237237      'Creation of new export' => 'Vytvoření nového exportu',
    238238      'Identification' => 'Označení',
    239       'You can\'t create another export. Max for one user is' => 'Nemůžete vytvářet další export. Max. počet na uživatele je',
     239      'You can\'t create another export. Max for one user is %d.' => 'Nemůžete vytvářet další export. Max. počet na uživatele je %d.',
    240240      'Create' => 'Vytvořit',
    241241      'New export created.<br />Direct link to export' => 'Nový export vytvořen.<br/>Přímý odkaz na tento export',
Note: See TracChangeset for help on using the changeset viewer.