Changeset 383 for trunk


Ignore:
Timestamp:
Jan 23, 2012, 10:37:31 AM (13 years ago)
Author:
chronos
Message:
  • Přidáno: Kostra základního systémového modulu System.
  • Přidáno: Obsluha datových typů pro HTML kód a HTTP protokol.
  • Upraveno: Do ViewList zkopírování generování tabulky se stránkováním a řazením.
Location:
trunk
Files:
26 added
15 edited

Legend:

Unmodified
Added
Removed
  • trunk/.htaccess

    r373 r383  
    55
    66RewriteEngine On
    7 #RewriteBase /
     7RewriteBase /
    88
    99# Pretty urls on localhost with alias
     
    1111RewriteCond  %{REQUEST_FILENAME}  !-f
    1212RewriteCond  %{REQUEST_FILENAME}  !-d
    13 #RewriteRule   ^(.*)$ centrala/index.php?$1
    14 RewriteRule   ^(.*)$ index.php?$1
     13RewriteRule   ^(.*)$ centrala/index.php?$1
     14#RewriteRule   ^(.*)$ index.php?$1
    1515
    1616# Pretty urls
  • trunk/Common/Global.php

    r379 r383  
    1818include_once('HTML.php');
    1919include_once('XHTML.php');
     20include_once('URL.php');
    2021include_once('PageList.php');
    2122include_once('TableHeader.php');
     
    2324include_once('ViewList.php');
    2425include_once('ViewForm.php');
     26include_once('Types/Type.php');
    2527 
    2628
     
    2830
    2931  var $Pages = array();
     32  var $Type;
     33 
     34  function __construct($Database)
     35  {
     36    parent::__construct($Database);
     37    $this->Type = new Type($this);
     38  }
    3039 
    3140  function HumanDate($Time)
     
    3948   
    4049    return($Config['Web']['RootFolder'].$Target);
    41   }
     50  }    
    4251}
    4352
  • trunk/Common/Module.php

    r379 r383  
    7777  var $Modules = array();
    7878  var $Models = array();
     79  var $Menu = array();
    7980 
    8081  function __construct($Database)
     
    9293    //DebugLog('Loading modules...');
    9394    $this->Modules = array();
    94     $Query = 'SELECT `Id`, `Name` FROM `SystemModule`';
     95    $Query = 'SELECT `Id`, `Name`,`Installed` FROM `SystemModule`';
    9596    if($Installed) $Query .= ' WHERE `Installed`=1';
    96       else $Query .= ' WHERE `Installed`=0';
     97      else $Query .= ''; // WHERE `Installed`=0';
    9798    $DbResult = $this->Database->query($Query);
    9899    while($Module = $DbResult->fetch_array())
     
    103104      $NewModule = new $ModuleClassName($this->Database, $this);     
    104105      $NewModule->Id = $Module['Id'];
     106      $NewModule->Installed = $Module['Installed'];
    105107      $this->Modules[$Module['Name']] = $NewModule;
    106108    }     
     
    146148    $this->LoadModules(false);
    147149    foreach($this->Modules as $Index => $Module)
    148     {
     150    {     
    149151      $this->Modules[$Index]->Install();
    150152    }
  • trunk/Common/PageList.php

    r373 r383  
    7272        }
    7373      }
    74       if($PagesMax < ($PageCount - 1)) $Result .= ' ... ';
     74      if($PagesMax < ($PageCount - 1)) $this->Output .= ' ... ';
    7575      if($this->Page < ($PageCount - 1))
    7676      {
  • trunk/Common/TableHeader.php

    r373 r383  
    1313  var $Columns;
    1414  var $QueryString;
     15  var $System;
    1516
    1617  function __construct($System)
    1718  {
    18     parent::__construct($System);
     19    //parent::__construct($System);
     20    $this->System = &$System;
     21    $this->Order = array();
    1922    $this->OrderDirSQL = array('ASC', 'DESC');
    2023    $this->OrderArrowImage = array('sort_asc.png', 'sort_desc.png');
     
    99102      if(!array_key_exists('Title', $Column)) $Title = $ColumnName;
    100103        else $Title = $Column['Title'];
    101       if(strpos($Title, '<') === false) $Title = $this->System->Localization->Translate($Title);
     104      //if(strpos($Title, '<') === false) $Title = $this->System->Localization->Translate($Title);
    102105
    103106      // Create hyperlink
  • trunk/Common/View.php

    r373 r383  
    2323class View
    2424{
     25  var $System;
    2526  var $Database;
    2627  var $Name;
     
    2930  var $ModelName;
    3031
    31   function __construct($Database)
     32  function __construct($System)
    3233  {
    33     $this->Database = &$Database;   
     34    $this->System = &$System;   
     35    $this->Database = &$System->Database;   
    3436  }
    3537 
  • trunk/Common/ViewForm.php

    r373 r383  
    77  var $OnSubmit = '';
    88   
    9   function __construct($Database)
    10   {
    11     $this->Database = &$Database;   
     9  function __construct($System)
     10  {
     11    parent::__construct($System);
    1212  }
    1313 
  • trunk/Common/ViewList.php

    r373 r383  
    33class ViewList extends View
    44{
    5   function __construct($Database)
     5  var $DefaultOrder;
     6  var $Columns;
     7  var $SQL;
     8  var $SQLJoin;
     9  var $Rows;
     10  var $Actions;
     11  var $PageList;
     12  var $TableHeader;
     13  var $FilterColumn;
     14  var $Module;
     15  var $PanelAction;
     16
     17  function __construct($System)
    618  {
    7     $this->Database = &$Database;   
     19    parent::__construct($System);
     20    $this->FilterColumn = '';
     21    $this->FilterId = 0;
     22    $this->PageList = new PageList($this->System);
     23    $this->TableHeader = new TableHeader($this->System);
     24    $this->Rows = array();
     25    $this->PanelAction = 'ListPanel';
     26    $this->DefaultOrder = array();
    827  }
    928
     29  function Show()
     30  {
     31    $Output = $this->PageList->Output;
     32    $Output .= '<table class="WideTable">';
     33    $Output .= $this->TableHeader->Output;
     34    foreach($this->Rows as $Row2)
     35    {
     36      $Row = array();
     37      foreach($Row2 as $Index => $Item)
     38        $Row[$Index]['Value'] = $Item;
     39      $Row = $this->ProcessRow($Row);
     40
     41      $Output .= '<tr>';
     42      foreach($this->Columns as $ColumnName => $Column)
     43      if($Column['Type'] != 'Hidden')
     44      {
     45        if(array_key_exists('Class', $Row[$ColumnName]) and ($Row[$ColumnName]['Class'] != ''))
     46          $Style = ' class="'.$Row[$ColumnName]['Class'].'"'; else $Style ='';
     47        $Output .= '<td'.$Style.'>';
     48        $Output .= $this->System->Type->ExecuteTypeEvent($Column['Type'],
     49          'OnView', array('Name' => $ColumnName, 'Value' => $Row[$ColumnName]['Value'], 'Type' => $Column['Type']));
     50        $Output .= '</td>';
     51      }
     52      if(is_array($this->Actions))
     53      {
     54        $Output .= '<td>';
     55        foreach($this->Actions as $Action)
     56        {
     57          if(array_key_exists('Confirm', $Action)) $Confirm = ' onclick="return confirmAction(\''.$this->System->Localization->Translate($Action['Confirm']).'\');"';
     58            else $Confirm = '';
     59          if(strpos($Action['Name'], '<') !== false) $ActionName = $Action['Name'];
     60            else $ActionName = $this->System->Localization->Translate($Action['Name']);
     61          $Output .= '<a'.$Confirm.' href="'.$this->System->Navigation->MakeLink($Action['Module'], $Action['Action'], array('Id' => $Row['Id']['Value'])).'">'.
     62            $ActionName.'</a> ';
     63        }
     64        $Output .= '</td>';
     65      }
     66      $Output .= '</tr>';
     67    }
     68    $Output .= '</table>';
     69    $Output .= $this->PageList->Output;
     70    return($Output);
     71  }
     72
     73  function LoadFromDatabase()
     74  {
     75    // Get total item count
     76    $DbResult = $this->System->Database->query('SELECT COUNT(*) FROM '.$this->Name.
     77      ' '.$this->SQLJoin);
     78    $DbRow = $DbResult->fetch_row();
     79    $this->PageList->TotalCount = $DbRow[0];
     80    $this->PageList->HTMLId = $this->Module;
     81    $this->PageList->QueryItems->Data['M'] = $this->Module;
     82    $this->PageList->QueryItems->Data['A'] = $this->PanelAction;
     83    $this->PageList->QueryItems->Data['FilterColumn'] = $this->FilterColumn;
     84    $this->PageList->Process();
     85
     86    // Build table header and ordering
     87    $this->TableHeader->QueryItems = $this->PageList->QueryItems;
     88    $this->TableHeader->HTMLId = $this->Module;
     89    $this->TableHeader->Columns = array();
     90    foreach($this->Columns as $Item)
     91    {
     92      $this->TableHeader->Columns[$Item['Name']] = array('Title' => $Item['Title'],
     93        'Type' => $Item['Type'], 'SQL' => $Item['SQL']);
     94    }
     95    if(is_array($this->Actions))
     96      $this->TableHeader->Columns['Actions'] = array('Type' => 'String', 'SQL' => '');
     97    $this->TableHeader->DefaultOrder = $this->DefaultOrder;
     98    $this->TableHeader->Process();
     99
     100    //$this->System->Navigation->UnsetParameter('Panel');
     101
     102    // Build column list
     103    $Columns = $this->Name.'.Id';
     104    foreach($this->Columns as $ColumnName => $Column)
     105      $Columns .= ', '.$Column['SQL'].' AS `'.$ColumnName.'`';
     106
     107    $this->DbRows = array();
     108    $DbResult = $this->System->Database->query('SELECT '.$Columns.' FROM '.$this->Name.
     109      ' '.$this->SQLJoin.$this->TableHeader->SQL.$this->PageList->SQLLimit);
     110    while($DbRow = $DbResult->fetch_assoc())
     111    {
     112      $this->Rows[] = $DbRow;
     113    }
     114  }
     115
     116  function ProcessRow($Row)
     117  {
     118    return($Row);
     119  }
     120 
    10121  function AddItemString($Name, $Title)
    11122  {
    12     $this->Items[$Name] = array('Name' => $Name, 'Title' => $Title,
    13       'Type' => ViewItemTypeString);
    14   }
    15  
     123    $this->Columns[$Name] = array('Name' => $Name, 'Title' => $Title,
     124      'Type' => ViewItemTypeString, 'SQL' => $Name);
     125  }   
    16126}
    17127
  • trunk/Modules/FrontPage/FrontPage.php

    r378 r383  
    1515      if($HyperLink['IconFile'] == '') $HyperLink['IconFile'] = 'clear.png';
    1616        if(substr($HyperLink['URL'], 0, 4) != 'http') $HyperLink['URL'] = $this->System->Config['Web']['RootFolder'].$HyperLink['URL'];
    17         if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->Models['User']->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation'])))       
     17        if(($HyperLink['PermissionModule'] == '') or (($HyperLink['PermissionModule'] != '') and $this->System->Modules['User']->Models['User']->CheckPermission($HyperLink['PermissionModule'], $HyperLink['PermissionOperation'])))       
    1818        $Output .= '<img alt="'.$HyperLink['Name'].'" src="images/favicons/'.$HyperLink['IconFile'].'" width="16" height="16" /> <a href="'.$HyperLink['URL'].'">'.$HyperLink['Name'].'</a><br />';
    1919    }
     
    5454    //$Output .= 'Server běží: '.$this->GetServerUptime().' &nbsp;  &nbsp; ';
    5555
    56     if($this->System->Models['User']->CheckPermission('Finance', 'DisplaySubjectState'))
    57     {
    58       $DbResult = $this->Database->select('Subject', 'Money', 'Id=(SELECT Subject FROM Member WHERE Id=(SELECT Member FROM User WHERE Id='.$this->System->Models['User']->User['Id'].'))');
     56    if($this->System->Modules['User']->Models['User']->CheckPermission('Finance', 'DisplaySubjectState'))
     57    {
     58      $DbResult = $this->Database->select('Subject', 'Money', 'Id=(SELECT Subject FROM Member WHERE Id=(SELECT Member FROM User WHERE Id='.$this->System->Modules['User']->Models['User']->User['Id'].'))');
    5959      if($DbResult->num_rows > 0)
    6060      {
     
    7171  {
    7272    $Output = '<a href="'.$this->System->Config['Web']['RootFolder'].'/?Action=UserOptions">Profil</a><br />';
    73     if($this->System->Models['User']->CheckPermission('Finance', 'MemberOptions'))
     73    if($this->System->Modules['User']->Models['User']->CheckPermission('Finance', 'MemberOptions'))
    7474      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'?Action=MemberOptions">Domácnost</a><br />';
    75     if($this->System->Models['User']->CheckPermission('Finance', 'DisplaySubjectState'))
     75    if($this->System->Modules['User']->Models['User']->CheckPermission('Finance', 'DisplaySubjectState'))
    7676      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/uzivatel/">Finance</a><br />';
    77     if($this->System->Models['User']->CheckPermission('Network', 'RegistredHostList'))
     77    if($this->System->Modules['User']->Models['User']->CheckPermission('Network', 'RegistredHostList'))
    7878      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/sit/registrovane-pocitace/">Počítače</a><br />';
    79     if($this->System->Models['User']->CheckPermission('News', 'Insert'))
     79    if($this->System->Modules['User']->Models['User']->CheckPermission('News', 'Insert'))
    8080      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/aktuality/?action=add">Vložení aktuality</a><br />';
    81     if($this->System->Models['User']->CheckPermission('EatingPlace', 'Edit'))
     81    if($this->System->Modules['User']->Models['User']->CheckPermission('EatingPlace', 'Edit'))
    8282      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/jidelna/edit/">Editace jídelníčků</a><br />';
    83     if($this->System->Models['User']->CheckPermission('Finance', 'Manage'))
     83    if($this->System->Modules['User']->Models['User']->CheckPermission('Finance', 'Manage'))
    8484      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/finance/sprava/">Správa financí</a><br />';
    85     if($this->System->Models['User']->CheckPermission('Network', 'Administration'))
     85    if($this->System->Modules['User']->Models['User']->CheckPermission('Network', 'Administration'))
    8686      $Output .= '<a href="'.$this->System->Config['Web']['RootFolder'].'/sit/sprava/">Správa sítě</a><br />';
    8787    return($Output);
     
    149149        $Form = new UserLoginView($this->Database);
    150150        $Form->OnSubmit = '?Action=Login';
    151         $Result = $this->System->Models['User']->Login($_POST['Username'], $_POST['Password']);
     151        $Result = $this->System->Modules['User']->Models['User']->Login($_POST['Username'], $_POST['Password']);
    152152        $Output .= $this->SystemMessage('Přihlášení', $Result);
    153153        if($Result <> USER_LOGGED_IN)
     
    162162      if($_GET['Action'] == 'Logout')
    163163      {
    164         $Output .= $this->SystemMessage('Odhlášení', $this->System->Models['User']->Logout());
     164        $Output .= $this->SystemMessage('Odhlášení', $this->System->Modules['User']->Models['User']->Logout());
    165165      } else
    166166      if($_GET['Action'] == 'UserOptions')
    167167      {
    168168        $UserOptions = new UserOptionsView($this->Database);
    169         $UserOptions->LoadValuesFromDatabase($this->System->Models['User']->User['Id']);
     169        $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->Models['User']->User['Id']);
    170170        $UserOptions->OnSubmit = '?Action=UserOptionsSave';
    171171        $Output .= $UserOptions->ShowEditForm();
     
    175175        $UserOptions = new UserOptionsView($this->Dstabase, array());
    176176        $UserOptions->LoadValuesFromForm();
    177         $UserOptions->SaveValuesToDatabase($this->System->Models['User']->User['Id']);
     177        $UserOptions->SaveValuesToDatabase($this->System->Modules['User']->Models['User']->User['Id']);
    178178        $Output .= $this->SystemMessage('Nastavení', 'Nastavení uloženo.');
    179179        $this->System->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $UserOptions->Values['Name']);
    180         $UserOptions->LoadValuesFromDatabase($this->System->Models['User']->User['Id']);
     180        $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->Models['User']->User['Id']);
    181181        $UserOptions->OnSubmit = '?Action=UserOptionsSave';
    182182        $Output .= $UserOptions->ShowEditForm();
     
    191191      if($_GET['Action'] == 'UserRegisterConfirm')
    192192      {
    193         $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Models['User']->RegisterConfirm($_GET['User'], $_GET['H']));
     193        $Output .= $this->SystemMessage('Potvrzení registrace', $this->System->Modules['User']->Models['User']->RegisterConfirm($_GET['User'], $_GET['H']));
    194194      } else
    195195      if($_GET['Action'] == 'PasswordRecovery')
     
    203203        $Form = new PasswordRecoveryView($this->Database);
    204204        $Form->LoadValuesFromForm();
    205         $Result = $this->System->Models['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
     205        $Result = $this->System->Modules['User']->Models['User']->PasswordRecoveryRequest($Form->Values['Name'], $Form->Values['Email']);
    206206        $Output .= $this->SystemMessage('Obnova hesla', $Result);
    207207        if($Result <> USER_PASSWORD_RECOVERY_SUCCESS)
     
    212212      if($_GET['Action'] == 'PasswordRecoveryConfirm')
    213213      {
    214         $Output .= $this->SystemMessage('Obnova hesla', $this->System->Models['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']));
     214        $Output .= $this->SystemMessage('Obnova hesla', $this->System->Modules['User']->Models['User']->PasswordRecoveryConfirm($_GET['User'], $_GET['H'], $_GET['P']));
    215215      } else
    216216      if($_GET['Action'] == 'UserRegisterSave')
     
    218218        $Form = new UserRegisterView($this->Database, array());
    219219        $Form->LoadValuesFromForm();
    220         $Result = $this->System->Models['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']);
     220        $Result = $this->System->Modules['User']->Models['User']->Register($Form->Values['Login'], $Form->Values['Password'], $Form->Values['Password2'], $Form->Values['Email'], $Form->Values['Name'], $Form->Values['PhoneNumber'], $Form->Values['ICQ']);
    221221        $Output .= $this->SystemMessage('Registrace nového účtu', $Result);
    222222        if($Result <> USER_REGISTRATED)
     
    229229      {
    230230        $UserOptions = new MemberOptionsView($this->Database);
    231         $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Models['User']->User['Member']);
     231        $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Modules['User']->Models['User']->User['Member']);
    232232        $DbRow = $DbResult->fetch_array();
    233233        foreach($UserOptions->Items as $Index => $Item)
     
    247247          $UserOptions->Values['BillingPeriodNext'] = 2;
    248248         
    249         $DbResult = $this->Database->update('Member', 'Id='.$this->System->Models['User']->User['Member'], array('InternetTariffNextMonth' => $UserOptions->Values['InternetTariffNextMonth'], 'FamilyMemberCount' => $UserOptions->Values['FamilyMemberCount'], 'BillingPeriodNext' => $UserOptions->Values['BillingPeriodNext']));
    250         $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$this->System->Models['User']->User['Member']);
     249        $DbResult = $this->Database->update('Member', 'Id='.$this->System->Modules['User']->Models['User']->User['Member'], array('InternetTariffNextMonth' => $UserOptions->Values['InternetTariffNextMonth'], 'FamilyMemberCount' => $UserOptions->Values['FamilyMemberCount'], 'BillingPeriodNext' => $UserOptions->Values['BillingPeriodNext']));
     250        $DbResult = $this->Database->query('SELECT Subject FROM Member WHERE Id='.$this->System->Modules['User']->Models['User']->User['Member']);
    251251        $Member = $DbResult->fetch_assoc();
    252252        $DbResult = $this->Database->update('Subject', 'Id='.$Member['Subject'], array('Name' => $UserOptions->Values['Name'], 'AddressStreet' => $UserOptions->Values['AddressStreet'], 'AddressTown' => $UserOptions->Values['AddressTown'], 'AddressPSC' => $UserOptions->Values['AddressPSC'], 'IC' => $UserOptions->Values['IC'], 'DIC' => $UserOptions->Values['DIC']));
    253253        $Output .= $this->SystemMessage('Nastavení', 'Nastavení domácnosti uloženo.');
    254254        $this->System->Modules['Log']->NewRecord('Member+Subject', 'Nastavení člena/subjektu změněno', $UserOptions->Values['Name']);
    255         $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Models['User']->User['Member']);
     255        $DbResult = $this->Database->query('SELECT Member.Id, Member.InternetTariffNextMonth, Member.FamilyMemberCount, Member.BillingPeriodNext, Subject.Name, Subject.AddressStreet, Subject.AddressTown, Subject.AddressPSC, Subject.IC, Subject.DIC FROM Member JOIN Subject ON Subject.Id = Member.Subject WHERE Member.Id='.$this->System->Modules['User']->Models['User']->User['Member']);
    256256        $DbRow = $DbResult->fetch_array();
    257257        foreach($UserOptions->Items as $Index => $Item)
     
    288288        else if($Panel['Module'] == 'UserOptions')
    289289        {
    290           if($this->System->Models['User']->User['Id'] != $this->System->Models['User']->AnonymousUserId)
     290          if($this->System->Modules['User']->Models['User']->User['Id'] != $this->System->Modules['User']->Models['User']->AnonymousUserId)
    291291            $Output .= $this->Panel('Přihlášený uživatel', $this->UserPanel());
    292292        } else
  • trunk/Modules/Log/Log.php

    r378 r383  
    113113  {
    114114    $this->Database->insert('Log', array('Time' => 'NOW()',
    115       'User' => $this->System->Models['User']->User['Id'], 'Module' => $Module,
     115      'User' => $this->System->Module['User']->Models['User']->User['Id'], 'Module' => $Module,
    116116      'Operation' => $Operation, 'Value' => $Value));
    117117    //echo($this->Database->LastQuery);
  • trunk/Modules/NetworkConfig/NetworkConfig.php

    r382 r383  
    2727    $this->Creator = 'Chronos';
    2828    $this->License = 'GNU/GPL';
    29     $this->Description = 'Mikrotik RouterOS configuration';
     29    $this->Description = 'Network device remote configuration';
    3030    $this->Dependencies = array('Network');
    3131    $this->SupportedModels = array('NetworkConfiguration');
  • trunk/Modules/NetworkConfigRouterOS/NetworkConfigRouterOS.php

    r382 r383  
    5151    $this->Dependencies = array('NetworkConfig');
    5252    $this->SupportedModels = array('NetworkFirewall', 'NetworkMark',
    53       'NetworkMangeSubgroup');
     53      'NetworkMangleSubgroup');
    5454  }
    5555 
  • trunk/Modules/News/News.php

    r378 r383  
    130130    $Output = '<div class="NewsPanel"><div class="Title">'.$Row['Caption'];     
    131131    $Output .= '<div class="Action"><a href="aktuality/?category='.$Category.'">Zobrazit</a>';
    132     if($this->System->Models['User']->CheckPermission('News', 'Insert', 'Group', $Category))
     132    if($this->System->Modules['User']->Models['User']->CheckPermission('News', 'Insert', 'Group', $Category))
    133133      $Output .= ' <a href="aktuality/?action=add&amp;category='.$Category.'">Přidat</a>';
    134134    $Output .= '</div></div><div class="Content">';
  • trunk/Modules/Project/Project.php

    r378 r383  
    11<?php
     2
     3class ProjectPage extends Page
     4{
     5  var $FullTitle = 'Projekty';
     6  var $ShortTitle = 'Projekty';
     7
     8  function Show()
     9  {
     10    $View = new ProjectView($this->System);
     11    $View->LoadFromDatabase();
     12    return($View->Show());
     13  }
     14}
     15
     16class ProjectView extends ViewList
     17{
     18  function __construct($System)
     19  {
     20    parent::__construct($System);
     21    $this->Name = 'Project';
     22    //$this->AddPropertyDateTime('TimeSchedule');
     23    //$this->AddPropertyOneToMany('UserAssignedTo', 'User');
     24    //$this->AddPropertyText('Description');
     25    $this->AddItemString('Description', 'Description');
     26  }
     27}
    228
    329class Project extends Model
     
    5076  function Init()
    5177  {
     78    $this->System->Pages['projekt'] = 'ProjectPage';
    5279  }
    5380}
  • trunk/Modules/User/User.php

    r381 r383  
    390390  {
    391391    parent::Install();
    392     $this->Database->insert('User', array('Id' => ANONYMOUS_ID, 'Login' => 'Anonymous', 'Name' => 'Anonymous',
    393       'Password' => ''));
     392    if(!$this->Installed)
     393    {
     394      $this->Database->insert('User', array('Id' => ANONYMOUS_ID, 'Login' => 'Anonymous', 'Name' => 'Anonymous',
     395        'Password' => ''));
     396    }
    394397  }
    395398
Note: See TracChangeset for help on using the changeset viewer.