Changeset 22 for trunk/index.php


Ignore:
Timestamp:
Mar 1, 2010, 9:12:44 PM (14 years ago)
Author:
george
Message:
  • Přidáno: Skript pro import ze databáze centrály.
  • Přidáno: Zprovozněno přihalšování a odhlašování uživatelů, prohlížení a změna profilu.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/index.php

    r19 r22  
    1414include_once(dirname(__FILE__).'/CustomOutput.php');
    1515
     16include_once(dirname(__FILE__).'/Module/User/Controller.php');
    1617include_once(dirname(__FILE__).'/Module/Main/Controller.php');
    1718include_once(dirname(__FILE__).'/Module/Network/Controller.php');
     
    2728  var $BaseURL;
    2829  var $Type;
     30  var $DefaultModule;
    2931
    3032  function __construct()
     
    4042    $this->BaseURL = new URL();
    4143   
     44    $this->DefaultModule = 'Main';
    4245    $this->BaseURL->Scheme = 'http';
    4346    $this->BaseURL->Host = $_SERVER['SERVER_NAME'];
     
    5962  }
    6063
     64  function GetModuleOutput()
     65  {
     66    if(!array_key_exists('M', $_GET)) $_GET['M'] = $this->DefaultModule;
     67    $ModuleName = $_GET['M'];
     68    $ModuleName .= 'Controller';
     69    if(class_exists($ModuleName))
     70    {
     71      $Module = new $ModuleName($this);
     72      if(array_key_exists('Panel', $_GET)) $Output = $Module->Show();
     73        else $Output = $this->Output->Show($Module->Show());
     74    } else
     75      throw new Exception('Module not found');
     76    return($Output);
     77  }
     78
    6179  function Run()
    6280  {
     
    6583    $this->User->Id = $this->UserOnline->User;
    6684    $this->User->LoadData();
    67     if(!array_key_exists('M', $_GET)) $_GET['M'] = 'Main';
    68     $ModuleName = $_GET['M'];
    69     $ModuleName .= 'Controller';
    70     if(class_exists($ModuleName))
    71     {
    72       $Module = new $ModuleName($this);
    73       if(array_key_exists('Panel', $_GET)) echo($Module->Show());
    74         else $this->Output->Show($Module->Show());
    75     } else
    76       throw new Exception('Module not found');
     85    echo($this->GetModuleOutput());
    7786  }
    7887}
Note: See TracChangeset for help on using the changeset viewer.