Changeset 385


Ignore:
Timestamp:
Jan 24, 2012, 11:40:43 AM (12 years ago)
Author:
chronos
Message:
  • Upraveno: Sestavení navigačního řádku se nyní provádí postupným připojováním položek namísto globálního seznamu všeho.
Location:
trunk
Files:
2 added
2 deleted
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/Common/Page.php

    r384 r385  
    1212  var $ShowRuntimeInfo = false;
    1313  var $SimplePage = false;
    14   var $PathTree = array('Rozcestník',
    15     'index.php' => '',
    16     'missing.php' => '',
    17     'manualy.php' => 'Manuály',
    18     'is' => array('',
    19       'topologie.php' => 'Topologie sítě',
    20       'dostupnost.php' => 'Dostupnost zařízení',
    21     ),
    22     'network.php' => 'Technické informace',
    23     'map' => array('',
    24       'index.php' => 'Mapa sítě',
    25     ),
    26     'network' => array('',
    27       'administration.php' => 'Administrace sítě',
    28       'dostupnost.php' => 'Dostupnost zařízení',
    29       'restart.php' => 'Restart služeb',
    30     ),
    31     'nabidky_pripojeni.php' => 'Nabídky připojení',
    32     'telseznam.php' => 'Telefonní seznam',
    33     'merak.php' => 'Měřič spotřeby',
    34     'tkr.php' => 'Kanály kabelové televize',
    35     'LogShow.php' => 'Záznamy operací',
    36     'share' => array('Prohledat sdílení',
    37       'index.php' => '',
    38       'firefox.php' => 'Integrace do prohlížeče',
    39     ),
    40     'hostlist.php' => 'Seznam počítačů',
    41     'userlist.php' => 'Seznam uživatelů',
    42     'farnost' => array('',
    43       'index.php' => 'Rozpis mší',
    44     ),
    45     'finance' => array('Finance',
    46       'index.php' => '',
    47       'spotreba.php' => 'Spotřeba',
    48       'zivnost.php' => 'Daňová evidence',
    49       'prepocet.php' => 'Přepočet financí',
    50       'changes.php' => 'Změny',
    51       'tarify.php' => 'Tarify',
    52       'inventory.php' => 'Skladové zásoby',
    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   );
    98  
    99   function __construct()
     14  var $NavigationPath = array();
     15
     16   function __construct()
    10017  {
    10118    global $Config;
     
    10320    $this->FormatHTML = $Config['Web']['FormatHTML'];
    10421    $this->ShowRuntimeInfo = $Config['Web']['ShowRuntimeInfo'];
     22    $this->NavigationPath[] = array('Name' => 'Rozcestník', 'URL' => '');
    10523  }
    10624
     
    11432  function ShowHeader($Title, $Path)
    11533  {
    116     $ScriptName = $_SERVER['SCRIPT_NAME'];
    117     while(strpos($ScriptName, '//') !== false)
    118       $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)
    126     {
    127       //echo($ScriptNamePart.'<br />');
    128       if(array_key_exists($ScriptNamePart, $PathTreeItem))
    129       {
    130         if(is_array($PathTreeItem[$ScriptNamePart]))
    131         {
    132           $PathTreeItem = $PathTreeItem[$ScriptNamePart];
    133           $PathTreePath .= $ScriptNamePart.'/';
    134           if($PathTreeItem[0] != '')
    135             $Navigation .= '<a href="'.$this->System->Config['Web']['RootFolder'].$PathTreePath.'">'.$PathTreeItem[0].'</a> &gt; ';
    136         } else
    137         {
    138           if($PathTreeItem[$ScriptNamePart] != '')
    139             $Navigation .= '<a href="'.$this->System->Config['Web']['RootFolder'].$PathTreePath.$ScriptNamePart.'">'.$PathTreeItem[$ScriptNamePart].'</a> &gt; ';
    140         }
    141       }
    142     }
    143     $Navigation = substr($Navigation, 0, -6);
     34    $Navigation = '';
     35    $URL = '';
     36    foreach($this->NavigationPath as $Index => $PathItem)
     37    {
     38      if($URL != '') $URL .= '/'.$PathItem['URL'];
     39      if($Index > 0) $Navigation .= ' &gt; ';
     40      $Navigation .= '<a href="'.$this->System->Config['Web']['RootFolder'].
     41        $URL.'">'.$PathItem['Name'].'</a>';
     42    }
    14443
    14544    $BodyParam = '';
  • trunk/Common/Types/Type.php

    r383 r385  
    77include(dirname(__FILE__).'/String.php');
    88include(dirname(__FILE__).'/Text.php');
    9 include(dirname(__FILE__).'/PointerOneToMany.php');
    10 include(dirname(__FILE__).'/PointerOneToOne.php');
     9include(dirname(__FILE__).'/OneToMany.php');
     10include(dirname(__FILE__).'/OneToMany2.php');
    1111include(dirname(__FILE__).'/Date.php');
    1212include(dirname(__FILE__).'/Time.php');
     
    4646      'GPS' => array('Name' => 'GPS', 'Class' => 'GPS', 'ParentType' => '', 'Parameters' => array()),
    4747      'IPv4Address' => array('Name' => 'IPv4Address', 'Class' => 'IPv4Address', 'ParentType' => '', 'Parameters' => array()),
    48       'PointerOneToOne' => array('Name' => 'PointerOneToOne', 'Class' => 'PointerOneToOne', 'ParentType' => '', 'Parameters' => array()),
    49       'PointerOneToMany' => array('Name' => 'PointerOneToMany', 'Class' => 'PointerOneToMany', 'ParentType' => '', 'Parameters' => array()),
     48      'OneToOne' => array('Name' => 'OneToOne', 'Class' => 'OneToOne', 'ParentType' => '', 'Parameters' => array()),
     49      'OneToMany' => array('Name' => 'OneToMany', 'Class' => 'OneToMany', 'ParentType' => '', 'Parameters' => array()),
    5050      'Color' => array('Name' => 'Color', 'Class' => 'Color', 'ParentType' => '', 'Parameters' => array()),
    5151    );
  • trunk/Common/ViewList.php

    r383 r385  
    124124      'Type' => ViewItemTypeString, 'SQL' => $Name);
    125125  }   
     126
     127  function AddItemText($Name, $Title)
     128  {
     129    $this->Columns[$Name] = array('Name' => $Name, 'Title' => $Title,
     130      'Type' => ViewItemTypeText, 'SQL' => $Name);
     131  }   
     132
     133  function AddItemDateTime($Name, $Title)
     134  {
     135    $this->Columns[$Name] = array('Name' => $Name, 'Title' => $Title,
     136      'Type' => ViewItemTypeDateTime, 'SQL' => $Name);
     137  }   
     138 
     139  function AddItemOneToMany($Name, $Title, $TargetTable)
     140  {
     141    $this->Columns[$Name] = array('Name' => $Name, 'Title' => $Title,
     142      'Type' => ViewItemTypeOneToMany, 'SQL' => $Name, 'TargetTable' => $TargetTable);
     143  }   
    126144}
    127145
  • trunk/Modules/Chat/Chat.php

    r378 r385  
    33class ChatHistory extends Page
    44{
    5   var $FullTitle = 'Výpis z historie chatu';
    6   var $ShortTitle = 'Historie chatu';
    7 
     5  function __construct()
     6  {
     7    parent::__construct();
     8    $this->FullTitle = 'Výpis z historie chatu';
     9    $this->ShortTitle = 'Historie chatu';
     10    $this->NavigationPath[] = array('Name' => $this->ShortTitle, 'URL' => 'chat');     
     11  }
     12 
    813  function dechexr($Num)
    914  {
     
    1621    global $MonthNames;
    1722   
    18     if(!$this->System->Models['User']->CheckPermission('Chat', 'Display')) return('Nemáte oprávnění');
     23    if(!$this->System->Modules['User']->Models['User']->CheckPermission('Chat', 'Display')) return('Nemáte oprávnění');
    1924
    2025    if(array_key_exists('date', $_GET)) $Date = $_GET['date'];
  • trunk/Modules/Network/Dostupnost.php

    r371 r385  
    1414    //array('Column' => 'TenYear', 'Title' => 'Desetiletí', 'Period' => 87600), // 365 * 24 * 10
    1515  );
     16
     17  function __construct()
     18  {
     19    parent::__construct();
     20    $this->NavigationPath[] = array('Name' => $this->ShortTitle, 'URL' => 'dostupnost');     
     21  }
    1622
    1723  function Show()
  • trunk/Modules/Network/HostList.php

    r364 r385  
    55  var $FullTitle = 'Seznam registrovaných počítačů';
    66  var $ShortTitle = 'Seznam počítačů';
     7
     8  function __construct()
     9  {
     10    parent::__construct();
     11    $this->NavigationPath[] = array('Name' => $this->ShortTitle, 'URL' => 'pocitace');     
     12  }
    713
    814  function Show()
  • trunk/Modules/Network/Network.php

    r379 r385  
    1212class NetworkPage extends Page
    1313{
    14   var $FullTitle = 'Síť';
    15   var $ShortTitle = 'Síť';
    16   var $RowPerPage = 20;
    17 
     14  function __construct()
     15  {
     16    parent::__construct();
     17    $this->FullTitle = 'Síť';
     18    $this->ShortTitle = 'Síť';
     19    $this->RowPerPage = 20;
     20    $this->NavigationPath[] = array('Name' => $this->ShortTitle, 'URL' => 'sit');     
     21  }
     22 
    1823  function Show()
    1924  {
     
    3641      $Page->Config = &$this->Config;
    3742      $Page->System = &$this->System;
    38       return($Page->Show());
     43      $Output = $Page->Show();
     44      array_shift($Page->NavigationPath);
     45      $this->NavigationPath = array_merge($this->NavigationPath, $Page->NavigationPath);
     46      return($Output);
    3947    }
    4048  } 
  • trunk/Modules/Project/Project.php

    r383 r385  
    2020    parent::__construct($System);
    2121    $this->Name = 'Project';
    22     //$this->AddPropertyDateTime('TimeSchedule');
    23     //$this->AddPropertyOneToMany('UserAssignedTo', 'User');
    24     //$this->AddPropertyText('Description');
    25     $this->AddItemString('Description', 'Description');
     22    $this->AddItemDateTime('TimeSchedule', 'Time schedule');
     23    $this->AddItemOneToMany('UserAssignedTo', 'User assigned to', 'User');
     24    $this->AddItemText('Description', 'Description');
    2625  }
    2726}
Note: See TracChangeset for help on using the changeset viewer.