Changeset 49


Ignore:
Timestamp:
Feb 13, 2008, 8:29:29 AM (16 years ago)
Author:
george
Message:

Přepracováno: Zúřehledněna definice stromu stránek a generování navigačního pruhu.

Location:
www
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • www/config.sample.php

    r47 r49  
    1212  'Web' => array(
    1313    'Charset' => 'utf-8',
    14     'BaseURL' => 'http://localhost/dev/centrala/www/',
    15     'Description' => 'Komunitn� po��ta�ov� s��',
    16     'Title' => 'Zd�chovNET',
     14    'Host' => 'localhost',
     15    'RootFolder' => '',
     16    'Description' => 'Komunitní počítačová síť',
     17    'Title' => 'ZděchovNET',
    1718    'Admin' => 'Chronos',
    1819    'AdminEmail' => 'robie@centrum.cz',
  • www/style.php

    r47 r49  
    55{
    66  global $Time_Start, $refresh, $Config;
     7
    78  $Time_Start = GetMicrotime();         // Zjisti počáteční čas
    8   $Rozcestnik = '<a href="/">Rozcestník</a>';
    99  $ScriptName = $_SERVER['SCRIPT_NAME'];
    10   while(strpos($ScriptName, '//')!==false)
     10  while(strpos($ScriptName, '//') !== false)
    1111    $ScriptName = str_replace('//', '/', $ScriptName);
    12   $Cesty = array(
    13     '/index.php' => $Rozcestnik,
    14     '/missing.php' => $Rozcestnik,
    15     '/manualy.php' => $Rozcestnik.' &gt; <a href="/manualy.php">Manuály</a>',
    16     '/is/administration_page.php' => $Rozcestnik.' &gt; <a href="/is/administration_page.php">Administrace sítě</a>',
    17     '/network.php' => $Rozcestnik.' &gt; <a href="/network.php">Technické informace</a>',
    18     '/mapy/mapa_nabidka.php' => $Rozcestnik.' &gt; <a href="mapy/mapa_nabidka.php">Nabídky mapy</a>',
    19     '/map/index.php' => $Rozcestnik.' &gt; <a href="/map/">Mapa</a>',
    20     '/nabidky_pripojeni.php' => $Rozcestnik.' &gt; <a href="nabidky_pripojeni.php">Nabídky připojení</a>',
    21     '/telseznam.php' => $Rozcestnik.' &gt; <a href="/telseznam.php">Telefonní seznam</a>',
    22     '/merak.php' => $Rozcestnik.' &gt; <a href="/merakm.php">Měřič spotřeby</a>',
    23     '/tkr.php' => $Rozcestnik.' &gt; <a href="/tkr.php">Kanály kabelové televize </a>',
    24     '/share/index.php' => $Rozcestnik.' &gt; <a href="/share/index.php">Prohledat sdílení</a>',
    25     '/share/firefox.php' => $Rozcestnik.' &gt; <a href="/share/index.php">Prohledat sdílení</a> &gt; <a href="/share/firefox.php">Integrace do prohlížeče</a> ',
    26     '/hostlist.php' => $Rozcestnik.' &gt; <a href="/hostlist.php">Seznam počítačů</a>',
    27     '/userlist.php' => $Rozcestnik.' &gt; <a href="/userlist.php">Seznam uživatelů</a>',
    28     '/farnost/index.php' => $Rozcestnik.' &gt; <a href="/farnost/index.php">Rozpis mší</a>',
     12  $PathTree = array('Rozcestník',
     13    'index.php' => '',
     14    'missing.php' => '',
     15    'manualy.php' => 'Manuály',
     16    'is' => array('',
     17      'administration_page.php' => 'Administrace sítě',
     18      'topologie.php' => 'Topologie sítě',
     19      'dostupnost.php' => 'Dostupnost zařízení',
     20      'restart.php' => 'Restart služeb',
     21    ),
     22    'network.php' => 'Technické informace',
     23    'mapy' => array('',
     24      'mapa_nabidka.php' => 'Nabídky mapy',
     25      'mapa.php' => 'Mapa',
     26    ),
     27    'map' => array('',
     28      'index.php' => 'Mapa',
     29    ),
     30    'nabidky_pripojeni.php' => 'Nabídky připojení',
     31    'telseznam.php' => 'Telefonní seznam',
     32    'merak.php' => 'Měřič spotřeby',
     33    'tkr.php' => 'Kanály kabelové televize',
     34    'share' => array('Prohledat sdílení',
     35      'index.php' => '',
     36      'firefox.php' => 'Integrace do prohlížeče',
     37    ),
     38    'hostlist.php' => 'Seznam počítačů',
     39    'userlist.php' => 'Seznam uživatelů',
     40    'farnost' => array('',
     41      'index.php' => 'Rozpis mší',
     42    ),
    2943    // Finance
    30     '/finance/index.php' => $Rozcestnik.' &gt; <a href="/finance/">Finance</a>',
    31     '/finance/spotreba.php' => $Rozcestnik.' &gt; <a href="/finance/">Finance</a> &gt; <a href="/finance/spotreba.php">Spotřeba</a>',
    32     '/finance/changes.php' => $Rozcestnik.' &gt; <a href="/finance/">Finance</a> &gt; <a href="/finance/changes.php">Změny</a>',
    33     '/finance/tarify.php' => $Rozcestnik.' &gt; <a href="/finance/">Finance</a> &gt; <a href="/finance/tarify.php">Tarify</a>',
    34     '/finance/inventory.php' => $Rozcestnik.' &gt; <a href="/finance/">Finance</a> &gt; <a href="/finance/inventory.php">Skladové zásoby</a>',
    35     '/finance/clenove.php' => $Rozcestnik.' &gt; <a href="/finance/">Finance</a> &gt; <a href="/finance/clenove.php">Seznam členů</a>',
    36     '/finance/zarizeni.php' => $Rozcestnik.' &gt; <a href="/finance/">Finance</a> &gt; <a href="/finance/zarizeni.php">Zařízení</a>',
    37     '/finance/strom.php' => $Rozcestnik.' &gt; <a href="/finance/">Finance</a> &gt; <a href="/finance/strom.php">Strom zařízení</a>',
    38     '/finance/srovnani.php' => $Rozcestnik.' &gt; <a href="/finance/">Finance</a> &gt; <a href="/finance/srovnani.php">Porovnání tarifů s konkurencí</a>',
    39     '/finance/faktury/index.php' => $Rozcestnik.' &gt; <a href="/finance/">Finance</a> &gt; <a href="/finance/faktury/">Faktury za internet</a>',
    40     '/is/topologie.php' => $Rozcestnik.' &gt; <a href="/is/topologie.php">Topologie sítě</a>',
    41     '/is/dostupnost.php' => $Rozcestnik.' &gt; <a href="/is/dostupnost.php">Dostupnost zařízení</a>',
    42     '/is/restart.php' => $Rozcestnik.' &gt; <a href="/is/restart.php">Restart služeb</a>',
    43     '/statistic/trafficview.php' => $Rozcestnik.' &gt; <a href="/statistic/trafficview.php">Vytížení internetu</a>',
    44     '/statistic/index.php' => $Rozcestnik.' &gt; <a href="/statistic/">Statistika</a>',
    45     '/statistic/trafficview2.php' => $Rozcestnik.' &gt; <a href="/statistic/trafficview2.php">Statistika</a>',
    46     '/statistic/bandwidth.php' => $Rozcestnik.' &gt; <a href="/statistic/bandwidth.php">Zatížení internetu</a>',
    47     '/statistic/bandwidth_full.php' => $Rozcestnik.' &gt; <a href="/statistic/bandwidth_full.php">Zatížení internetu všech počítačů</a>',
    48     '/download/addfile.php' => $Rozcestnik.' &gt; <a href="/download/addfile.php">Stažení souborů</a>',
    49     '/fotbal.php' => $Rozcestnik.' &gt; <a href="/fotbal.php">Fotbal</a>',
    50     '/webcam/index.php' => $Rozcestnik.' &gt; <a href="/webcam/index.php">Web kamera</a>',
    51     '/mapy/mapa.php' => $Rozcestnik.' &gt; <a href="/mapy/mapa.php">Mapa</a>',
    52     '/navody.php' => $Rozcestnik.' &gt; <a href="/navody.php">Návody</a>',
    53     '/ukoly.php' => $Rozcestnik.' &gt; <a href="/ukoly.php">Plány do budoucna</a>',
    54     '/otevreno.php' => $Rozcestnik.' &gt; <a href="/otevreno.php">Otvírací doby</a>',
    55     '/aktuality/index.php' => $Rozcestnik.' &gt; <a href="/aktuality/">Aktuality</a>',
    56     '/aktuality/subscription.php' => $Rozcestnik.' &gt; <a href="/aktuality/subscription.php">RSS aktuality</a>',
    57     '/sluzby.php' => $Rozcestnik.' &gt; <a href="/sluzby.php">Služby</a>',
    58     '/history.php' => $Rozcestnik.' &gt; <a href="/history.php">Historie</a>',
    59     '/lanchat/seznam.php' => $Rozcestnik.' &gt; <a href="/lanchat/seznam.php">Historie SunriseChatu</a>',
    60     '/lanchat/show.php' => $Rozcestnik.' &gt; <a href="/lanchat/seznam.php">Historie SunriseChatu</a>',
    61     '/sunrisechat/history.php' => $Rozcestnik.' &gt; <a href="/sunrisechat/history.php">Historie SunriseChatu</a>',
    62     '/sunrisechat/network.php' => $Rozcestnik.' &gt; <a href="/sunrisechat/network.php">Obsah testu sítě SunriseChatu 2.7+</a>',
    63     '/sunrisechat/network_old.php' => $Rozcestnik.' &gt; <a href="/sunrisechat/network_old.php">Obsah testu sítě SunriseChatu 2.6</a>',
    64     '/sunrisechat/webchat.php' => $Rozcestnik.' &gt; <a href="/sunrisechat/webchat.php">Okno SunriseChatu</a>',
    65     '/docs/zapisy/zapisy.php' => $Rozcestnik.' &gt; <a href="/docs/zapisy/zapisy.php">Zápisy ze schůzí</a>',
    66     '/jidelna/index.php' => $Rozcestnik.' &gt; <a href="/jidelna">Jídelníček</a>',
    67     '/jidelna/menuedit.php' => $Rozcestnik.' &gt; <a href="/jidelna/menuedit.php">Editace jídelníčku</a>',   
    68     '/backup/index.php' => $Rozcestnik.' &gt; <a href="/backup/index.php">Nastavení zálohování</a>',   
     44    'finance' => array('Finance',
     45      'index.php' => '',
     46      'spotreba.php' => 'Spotřeba',
     47      'changes.php' => 'Změny',
     48      'tarify.php' => 'Tarify',
     49      'inventory.php' => 'Skladové zásoby',
     50      'clenove.php' => 'Seznam členů',
     51      'zarizeni.php' => 'Zařízení',
     52      'strom.php' => 'Strom zařízení',
     53      'srovnani.php' => 'Porovnání tarifů s konkurencí',
     54      'faktury' => array('',
     55        'index.php' => 'Faktury za internet',
     56      ),
     57    ),
     58    'statistic' => array('',
     59      'trafficview.php' => 'Vytížení internetu',
     60      'index.php' => 'Statistika',
     61      'trafficview2.php' => 'Statistika',
     62      'bandwidth.php' => 'Zatížení internetu',
     63      'bandwidth_full.php' => 'Zatížení internetu všech počítačů',
     64    ),
     65    'fotbal.php' => 'Fotbal',
     66    'webcam' => array('',
     67       'index.php' => 'Web kamera',
     68    ),
     69    'navody.php' => 'Návody',
     70    'ukoly.php' => 'Plány do budoucna',
     71    'otevreno.php' => 'Otvírací doby',
     72    'aktuality' => array('',
     73      'index.php' => 'Aktuality',
     74      'subscription.php' => 'RSS aktuality',
     75    ),
     76    'sluzby.php' => 'Služby<',
     77    'history.php' => 'Historie',
     78    'sunrisechat' => array('',
     79      'history.php' => 'Historie SunriseChatu',
     80      'network.php' => 'Obsah testu sítě SunriseChatu 2.7+',
     81      'network_old.php' => 'Obsah testu sítě SunriseChatu 2.6',
     82      'webchat.php' => 'Okno SunriseChatu',
     83    ),
     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    ),
    6996  );
     97  $PathTreePath = '/';
     98  $PathTreeItem = $PathTree;
     99  $Navigation = '<a href="'.$Config['Web']['RootFolder'].$PathTreePath.'">'.$PathTreeItem[0].'</a> &gt; ';
     100  $ScriptName = substr($ScriptName, strlen($Config['Web']['RootFolder']));
     101  $ScriptNameParts = explode('/', $ScriptName);
     102  array_shift($ScriptNameParts);
     103  foreach($ScriptNameParts as $ScriptNamePart)
     104  {
     105    //echo($ScriptNamePart.'<br>');
     106    if(is_array($PathTreeItem[$ScriptNamePart]))
     107    {
     108      $PathTreeItem = $PathTreeItem[$ScriptNamePart];
     109      $PathTreePath .= $ScriptNamePart.'/';
     110      if($PathTreeItem[0] != '')
     111        $Navigation .= '<a href="'.$Config['Web']['RootFolder'].$PathTreePath.'">'.$PathTreeItem[0].'</a> &gt; ';
     112    } else
     113    {
     114      if($PathTreeItem[$ScriptNamePart] != '')
     115        $Navigation .= '<a href="'.$Config['Web']['RootFolder'].$PathTreePath.$ScriptNamePart.'">'.$PathTreeItem[$ScriptNamePart].'</a> &gt; ';
     116    }
     117  }
     118  $Navigation = substr($Navigation, 0, -6);
     119
    70120  echo('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    71121<html><head>
    72122  <meta http-equiv="Content-Language" content="cs">
    73   <meta http-equiv="Content-Type" content="text/html; charset=');
    74   echo($Config['Web']['Charset']);
    75  
    76   echo('">');
     123  <meta http-equiv="Content-Type" content="text/html; charset='.$Config['Web']['Charset'].'">');
    77124  if (isset($refresh)) echo('<meta http-equiv="Refresh" content="'.$refresh."\">\n");
    78125  //  <link href="style.css" rel="stylesheet" type="text/css">
     
    80127  </head><body style="font-family: sans-serif;" '.$BodyParam.'>
    81128<div style="padding: 3px; font-size: 20px; border-style: solid; border-color: blue; border-width: 1; background-color: #F0F0FF; margin-bottom: 4px;">'.$Title.'</div>
    82 <div style="border-style: solid; border-bottom-color: gray; border-width: 0 0 1 0; margin-bottom: 3px; padding-bottom: 2px;"><strong>Navigace &gt;&gt;</strong> '.$Cesty[$ScriptName].'</div>');
     129<div style="border-style: solid; border-bottom-color: gray; border-width: 0 0 1 0; margin-bottom: 3px; padding-bottom: 2px;"><strong>Navigace &gt;&gt;</strong> '.$Navigation.'</div>');
    83130}
    84131
Note: See TracChangeset for help on using the changeset viewer.