Changeset 518


Ignore:
Timestamp:
Apr 14, 2013, 5:15:25 PM (11 years ago)
Author:
chronos
Message:
  • Upraveno: Síťové informace přetvořeny na aplikační modul.
Location:
trunk
Files:
1 deleted
4 edited
5 copied

Legend:

Unmodified
Added
Removed
  • trunk/Common/Global.php

    r517 r518  
    5656  var $ModuleManager;
    5757  var $PathItems;
     58  var $RootURLFolder;
    5859
    5960  function __construct()
     
    153154  function Link($Target)
    154155  {
    155     global $Config;
    156    
    157     return($Config['Web']['RootFolder'].$Target);
     156    return($this->RootURLFolder.$Target);
    158157  }   
    159158}
     
    182181  $System->Database->ShowSQLError = $Config['Web']['ShowSQLError'];
    183182  $System->Database->ShowSQLQuery = $Config['Web']['ShowSQLQuery'];
     183  $System->RootURLFolder = $Config['Web']['RootFolder'];
    184184 
    185185  // Check database persistence structure
  • trunk/Common/Page.php

    r501 r518  
    188188    echo($Output);
    189189  }
     190 
     191  function NewPage($ClassName)
     192  {
     193    $Page = new $ClassName();
     194    $Page->System = $this->System;
     195    $Page->Database = $this->Database;
     196    return($Page);
     197  }
    190198
    191199  // Funkce formatovani vystupu
  • trunk/Modules/Network/Administration.php

    r516 r518  
    11<?php
    22
    3 include_once('../Common/Global.php');
    4 
    5 class NetworkAdministrationPage extends Page
     3class PageNetworkAdministration extends Page
    64{
    7   var $FullTitle = 'Administrace sítě';
    8   var $ShortTitle = 'Administrace sítě';
     5  function __construct()
     6  {
     7    parent::__construct();
     8    $this->FullTitle = 'Administrace sítě';
     9    $this->ShortTitle = 'Administrace sítě';
     10    $this->NavigationPath[] = array('Name' => $this->ShortTitle, 'URL' => 'sprava');     
     11  }
    912
    1013  function Show()
     
    4346}
    4447
    45 $System->AddModule(new NetworkAdministrationPage());
    46 $System->Modules['NetworkAdministrationPage']->GetOutput();
    47 
    4848?>
  • trunk/Modules/Network/Availability.php

    r516 r518  
    11<?php
    22
    3 include_once('../Common/Global.php');
    4 
    5 class Availability extends Page
     3class PageAvailability extends Page
    64{
    75  var $FullTitle = 'Dostupnost aktivních prvků sítě';
     
    113111}
    114112
    115 $System->AddModule(new Availability());
    116 $System->Modules['Availability']->GetOutput();
    117 
    118113?>
  • trunk/Modules/Network/Hosting.php

    r516 r518  
    11<?php
    22
    3 include_once('../Common/Global.php');
    4 
    5 class HostingPage extends Page
     3class PageHosting extends Page
    64{
    75  var $FullTitle = 'Hostované projekty';
     
    2119}
    2220
    23 $System->AddModule(new HostingPage());
    24 $System->Modules['HostingPage']->GetOutput();
    25 
    2621?>
  • trunk/Modules/Network/Network.php

    r479 r518  
    11<?php
    22
    3 include_once('HostList.php');
     3include_once(dirname(__FILE__).'/HostList.php');
     4include_once(dirname(__FILE__).'/Administration.php');
     5include_once(dirname(__FILE__).'/Availability.php');
     6include_once(dirname(__FILE__).'/Subnet.php');
     7include_once(dirname(__FILE__).'/Hosting.php');
     8include_once(dirname(__FILE__).'/UserHosts.php');
    49
    5 class PageNetworkInformation extends Page
     10class PageNetwork extends Page
    611{
    712  var $FullTitle = 'Technické informace o síti';
     
    914
    1015  function Show()
     16  {
     17    if(count($this->System->PathItems) > 1)
     18    {
     19      if($this->System->PathItems[1] == 'administration') $Output = $this->NewPage('PageNetworkAdministration')->Show();
     20      else if($this->System->PathItems[1] == 'availability') $Output = $this->NewPage('PageAvailability')->Show();
     21      else if($this->System->PathItems[1] == 'subnet') $Output = $this->NewPage('PageSubnet')->Show();
     22      else if($this->System->PathItems[1] == 'user_hosts') $Output = $this->NewPage('PageNetworkHostList')->Show();
     23      else if($this->System->PathItems[1] == 'hosting') $Output = $this->NewPage('PageHosting')->Show();
     24      else if($this->System->PathItems[1] == 'hosts') $Output = $this->NewPage('PageHostList')->Show();
     25      else $Output = $this->ShowInformation();
     26    } else $Output = $this->ShowInformation();
     27    return($Output); 
     28  }
     29 
     30  function ShowInformation()
    1131  {
    1232    $Output = '';
     
    7292      default:
    7393        $Output .= '<a href="?section=obsazeni_wifi_kanalu">Obsazení Wi-Fi kanálů</a><br />';
    74         $Output .= '<a href="network/dostupnost.php">Měření dostupnosti zařízení</a><br />';
    75         $Output .= '<a href="network/subnet.php">Výpis registrovaných podsítí</a><br />';
     94        $Output .= '<a href="'.$this->System->Link('/network/availability/').'">Měření dostupnosti zařízení</a><br />';
     95        $Output .= '<a href="'.$this->System->Link('/network/subnet/').'">Výpis registrovaných podsítí</a><br />';
    7696        //$Output .= '<a href="tkr.php">Kanály kabelové televize</a>';
    7797    }
     
    104124  {
    105125    parent::Start();
    106     $this->System->RegisterPage('hostlist.php', 'PageHostList');
    107     $this->System->RegisterPage('network.php', 'PageNetworkInformation');   
     126    $this->System->RegisterPage('network', 'PageNetwork');   
    108127  } 
    109128 
  • trunk/Modules/Network/Subnet.php

    r516 r518  
    11<?php
    22
    3 include_once('../Common/Global.php');
    4 
    5 class HostingPage extends Page
     3class PageSubnet extends Page
    64{
    7   var $FullTitle = 'Informace o podsítích';
    8   var $ShortTitle = 'Podsítě';
     5  function __construct()
     6  {
     7    parent::__construct();
     8    $this->FullTitle = 'Informace o podsítích';
     9    $this->ShortTitle = 'Podsítě';
     10  }
    911
    1012  function Show()
     
    5557}
    5658
    57 $System->AddModule(new HostingPage());
    58 $System->Modules['HostingPage']->GetOutput();
    59 
    6059?>
  • trunk/Modules/Network/UserHosts.php

    r516 r518  
    11<?php
    22
    3 include_once('../Common/Global.php');
    4 
    5 class NetworkHostList extends Page
     3class PageNetworkHostList extends Page
    64{
    7   var $FullTitle = 'Registrované počítače';
    8   var $ShortTitle = 'Registrované počítače';
     5  function __construct()
     6  {
     7    parent::__construct();
     8    $this->FullTitle = 'Registrované počítače';
     9    $this->ShortTitle = 'Registrované počítače';
     10  }
    911
    1012  function Show()
     
    3638}
    3739
    38 $System->AddModule(new NetworkHostList());
    39 $System->Modules['NetworkHostList']->GetOutput();
    40 
    4140?>
  • trunk/Modules/Portal/Portal.php

    r515 r518  
    7171  function UserPanel()
    7272  {
    73     $Output = '<a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Profil</a><br />';
     73    $Output = '<a href="'.$this->System->Link('/?Action=UserOptions').'">Profil</a><br />';
    7474    if($this->System->Modules['User']->CheckPermission('Finance', 'MemberOptions'))
    75       $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'?Action=MemberOptions">Domácnost</a><br />';
     75      $Output .= '<a href="'.$this->System->Link('/?Action=MemberOptions').'">Domácnost</a><br />';
    7676    if($this->System->Modules['User']->CheckPermission('Finance', 'DisplaySubjectState'))
    77       $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/user_state.php">Finance</a><br />';
     77      $Output .= '<a href="'.$this->System->Link('/finance/user_state.php').'">Finance</a><br />';
    7878    if($this->System->Modules['User']->CheckPermission('Network', 'RegistredHostList'))
    79       $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/network/user_hosts.php">Počítače</a><br />';
     79      $Output .= '<a href="'.$this->System->Link('/network/user_hosts/').'">Počítače</a><br />';
    8080    if($this->System->Modules['User']->CheckPermission('News', 'Insert'))
    81       $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/aktuality/?action=add">Vložení aktuality</a><br />';
     81      $Output .= '<a href="'.$this->System->Link('/aktuality/?action=add').'">Vložení aktuality</a><br />';
    8282    if($this->System->Modules['User']->CheckPermission('EatingPlace', 'Edit'))
    83       $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/jidelna/menuedit.php">Editace jídelníčků</a><br />';
     83      $Output .= '<a href="'.$this->System->Link('/jidelna/menuedit.php').'">Úprava jídelníčků</a><br />';
    8484    if($this->System->Modules['User']->CheckPermission('Finance', 'Manage'))
    85       $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/manage.php">Správa financí</a><br />';
     85      $Output .= '<a href="'.$this->System->Link('/finance/manage.php').'">Správa financí</a><br />';
    8686    if($this->System->Modules['User']->CheckPermission('Network', 'Administration'))
    87       $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/network/administration.php">Správa sítě</a><br />';
     87      $Output .= '<a href="'.$this->System->Link('/network/administration/').'">Správa sítě</a><br />';
    8888    if($this->System->Modules['User']->CheckPermission('IS', 'Manage'))
    8989      $Output .= '<a href="'.$this->System->Link('/is/').'">Správa dat</a><br />';
Note: See TracChangeset for help on using the changeset viewer.