Changeset 519 for trunk/Common/Page.php


Ignore:
Timestamp:
Apr 14, 2013, 6:18:49 PM (11 years ago)
Author:
chronos
Message:
  • Upraveno: Přepracován systém generování horního navigačního řádků stránek. Nyní mají stránky třídy Page určenu nadřazenou stránky přes nadřazenou třídu.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Page.php

    r518 r519  
    99  var $ShowRuntimeInfo = false;
    1010  var $ClearPage = false;
    11   var $PathTree = array('Rozcestník',
    12     'index.php' => '',
    13     'missing.php' => '',
    14     'manualy.php' => 'Manuály',
    15     'is' => array('',
    16       'index.php' => 'Správa dat',
    17       'topologie.php' => 'Topologie sítě',
    18     ),
    19     'network.php' => 'Technické informace',
    20     'map' => array('',
    21       'index.php' => 'Mapa sítě',
    22     ),
    23     'tv' => array('',
    24       'index.php' => 'Síťová televize',
    25     ),
    26     'network' => array('',
    27       'administration.php' => 'Administrace sítě',
    28       'dostupnost.php' => 'Dostupnost zařízení',
    29       'restart.php' => 'Restart služeb',
    30       'user_hosts.php' => 'Registrované počítače',
    31     ),
    32     'nabidky_pripojeni.php' => 'Nabídky připojení',
    33     'telseznam.php' => 'Telefonní seznam',
    34     'merak.php' => 'Měřič spotřeby',
    35     'tkr.php' => 'Kanály kabelové televize',
    36     'LogShow.php' => 'Záznamy operací',
    37     'share' => array('Prohledat sdílení',
    38       'index.php' => '',
    39       'firefox.php' => 'Integrace do prohlížeče',
    40     ),
    41     'hostlist.php' => 'Seznam počítačů',
    42     'userlist.php' => 'Seznam uživatelů',
    43     'farnost' => array('',
    44       'index.php' => 'Rozpis mší',
    45     ),
    46     'finance' => array('Finance',
    47       'index.php' => '',
    48       'spotreba.php' => 'Spotřeba',
    49       'zivnost.php' => 'Daňová evidence',
    50       'prepocet.php' => 'Přepočet financí',
    51       'changes.php' => 'Změny',
    52       'tarify.php' => 'Tarify',
    53       'clenove.php' => 'Seznam členů',
    54       'zarizeni.php' => 'Zařízení',
    55       'strom.php' => 'Strom zařízení',
    56       'srovnani.php' => 'Porovnání tarifů s konkurencí',
    57       'bills_manage.php' => 'Faktury',
    58       'monthly_overall.php' => 'Měsíční přehledy',
    59       'manage.php' => 'Správa financí',
    60       'faktury' => array('',
    61         'index.php' => 'Faktury za internet',
    62       ),
    63     ),
    64     'statistic' => array('',
    65       'trafficview.php' => 'Vytížení internetu',
    66       'index.php' => 'Statistika',
    67       'trafficview2.php' => 'Statistika',
    68       'bandwidth.php' => 'Zatížení internetu',
    69       'bandwidth_full.php' => 'Zatížení internetu všech počítačů',
    70     ),
    71     'fotbal.php' => 'Fotbal',
    72     'webcam' => array('',
    73        'index.php' => 'Web kamera',
    74     ),
    75     'navody.php' => 'Návody',
    76     'ukoly.php' => 'Plánované projekty',
    77     'otevreno.php' => 'Otvírací doby',
    78     'aktuality' => array('',
    79       'index.php' => 'Aktuality',
    80       'subscription.php' => 'RSS aktuality',
    81     ),
    82     'sluzby.php' => 'Služby',
    83     'history.php' => 'Historie',
    84     'docs' => array('',
    85       'zapisy' => array('',
    86         'zapisy.php' => 'Zápisy ze schůzí',
    87       ),
    88     ),
    89     'jidelna' => array('',
    90       'index.php' => 'Jídelníček',
    91       'menuedit.php' => 'Editace jídelníčku',
    92     ),
    93     'backup' => array('',
    94       'index.php' => 'Nastavení zálohování',
    95     ),
    96     'mapa.php' => 'Mapa webu',
    97   );
     11  var $ParentClass = '';
     12  var $ShortTitle;
     13  var $FullTitle;
    9814 
    9915  function __construct()
     
    11430  function ShowHeader($Title, $Path)
    11531  {
    116     $ScriptName = $_SERVER['SCRIPT_NAME'];
     32    $ScriptName = $_SERVER['REQUEST_URI'];
    11733    while(strpos($ScriptName, '//') !== false)
    11834      $ScriptName = str_replace('//', '/', $ScriptName);
    119     $PathTreePath = '/';
    120     $PathTreeItem = $this->PathTree;
    121     $Navigation = '<a href="'.$this->System->Config['Web']['RootFolder'].$PathTreePath.'">'.$PathTreeItem[0].'</a> &gt; ';
    122     $ScriptName = substr($ScriptName, strlen($this->System->Config['Web']['RootFolder']));
    123     $ScriptNameParts = explode('/', $ScriptName);
    124     array_shift($ScriptNameParts);
    125     foreach($ScriptNameParts as $ScriptNamePart)
     35    $ScriptName = substr($ScriptName, strlen($this->System->Link('')));
     36    if(substr($ScriptName, -1, 1) == '/') $ScriptName = substr($ScriptName, 0, -1);
     37    $Page = $this;
     38    $Navigation = '';
     39    while($Page)
    12640    {
    127       if(array_key_exists($ScriptNamePart, $PathTreeItem))
     41      $Navigation = ' &gt; <a href="'.$this->System->Link($ScriptName).'/">'.$Page->ShortTitle.'</a>'.$Navigation;
     42     
     43      if($Page->ParentClass != '')
    12844      {
    129         if(is_array($PathTreeItem[$ScriptNamePart]))
    130         {
    131           $PathTreeItem = $PathTreeItem[$ScriptNamePart];
    132           $PathTreePath .= $ScriptNamePart.'/';
    133           if($PathTreeItem[0] != '')
    134             $Navigation .= '<a href="'.$this->System->Config['Web']['RootFolder'].$PathTreePath.'">'.$PathTreeItem[0].'</a> &gt; ';
    135         } else
    136         {
    137           if($PathTreeItem[$ScriptNamePart] != '')
    138             $Navigation .= '<a href="'.$this->System->Config['Web']['RootFolder'].$PathTreePath.$ScriptNamePart.'">'.$PathTreeItem[$ScriptNamePart].'</a> &gt; ';
    139         }
    140       }
     45        $PageClass = $Page->ParentClass;
     46        $Page = new $PageClass();
     47        $ScriptName = substr($ScriptName, 0, strrpos($ScriptName, '/'));
     48      } else $Page = null;
    14149    }
    142     $Navigation = substr($Navigation, 0, -6);
     50    $Navigation = substr($Navigation, 6);
    14351
    14452    $BodyParam = '';
     
    194102    $Page->System = $this->System;
    195103    $Page->Database = $this->Database;
     104    $Page->FormatHTML = $this->FormatHTML;
    196105    return($Page);
    197106  }
Note: See TracChangeset for help on using the changeset viewer.