Ignore:
Timestamp:
Dec 30, 2012, 9:13:55 PM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Hlavní stránka přetvořena jako aplikační modul.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Global.php

    r463 r469  
    22
    33$ConfigFileName = dirname(__FILE__).'/../config.php';
     4/* @var $System System */
     5$System = NULL;
     6/* @var $Database Database */
     7$Database = NULL;
    48     
    59if(file_exists($ConfigFileName)) include_once($ConfigFileName);
     
    2327 
    2428include_once(dirname(__FILE__).'/../Modules/Meteostation/Meteostation.php');
     29include_once(dirname(__FILE__).'/../Modules/Portal/Portal.php');
    2530
    2631$PrefixMultipliers = array
     
    95100class System extends Module
    96101{
    97   var $Modules = array();
     102  var $Modules;
    98103  /** @var Type */
    99104  var $Type;
     105  var $Pages;
     106  /** @var AppModuleManager */
     107  var $ModuleManager;
    100108
    101109  function __construct()
    102110  {
    103111    parent::__construct();
     112    $this->Modules = array();
    104113    $this->Type = new Type($this);
     114    $this->Pages = array();
     115    $this->ModuleManager = new AppModuleManager();
     116  } 
     117 
     118  function RegisterPage($Path, $Handler)
     119  {
     120    $this->Pages[$Path] = $Handler;
     121  }
     122 
     123  function ShowPage($Path)
     124  {
     125    /* @var $Page Page */
     126    $ClassName = $this->Pages[$Path];
     127    $Page = new $ClassName();
     128    $Page->System = &$this;
     129    $Page->Database = &$this->Database;
     130    $Page->GetOutput();
    105131  }
    106132 
     
    209235   
    210236    return($Config['Web']['RootFolder'].$Target);
    211   }
     237  }  
    212238}
    213239
     
    243269  $System->AddModule(new Finance());
    244270  $System->Modules['Finance']->LoadMonthParameters(0);
     271 
     272  // Register new modules
     273  $System->ModuleManager->RegisterModule(new Meteostation($System));
     274  $System->ModuleManager->RegisterModule(new Portal($System));
     275  $System->ModuleManager->StartAll();
    245276}
    246277
Note: See TracChangeset for help on using the changeset viewer.