Ignore:
Timestamp:
Sep 11, 2009, 8:18:38 AM (15 years ago)
Author:
george
Message:
  • Upraveno: Zrušeny samostatné include soubory a správně vloženy přímé závislosti pomocí include_once do všech souborů. Takto se budou načítat jen ty třídy, které jsou skutenčě potřeba.
  • Upraveno: Aplikace se nyní inicializuje přes soubor Application.php, kde je vložena třída odvozená z třídy System. Hlavní soubor index.php se pak odkazuje na soubor aplikace.
  • Objekty Database, Config a Translation jsou nyní lokální v rámci třídy System.
  • Přidáno: Třída pro odesílání pošty. Použita v třídě User.
Location:
trunk/www/Application/View
Files:
1 deleted
14 edited

Legend:

Unmodified
Added
Removed
  • trunk/www/Application/View/Backup.php

    r69 r78  
    11<?php
    22
    3 class BackupView extends Module
     3include_once(dirname(__FILE__).'/../../Base/View.php');
     4
     5class BackupView extends View
    46{
    57  var $ItemListFormClass = array(
  • trunk/www/Application/View/Client.php

    r77 r78  
    11<?php
    22
    3 class ClientView extends Module
     3include_once(dirname(__FILE__).'/../../Base/Module.php');
     4
     5class ClientView extends View
    46{
    57  var $ItemListFormClass = array(
  • trunk/www/Application/View/Cluster.php

    r76 r78  
    11<?php
    22
    3 class ClusterView extends Module
     3include_once(dirname(__FILE__).'/../../Base/View.php');
     4
     5class ClusterView extends View
    46{
    57  var $ItemListFormClass = array(
  • trunk/www/Application/View/Database.php

    r69 r78  
    11<?php
    22
    3 class DatabaseView extends Module
     3include_once(dirname(__FILE__).'/../../Base/View.php');
     4
     5class DatabaseView extends View
    46{
    57  function Import()
  • trunk/www/Application/View/Debug.php

    r72 r78  
    11<?php
    22
    3 class DebugView extends Module
     3include_once(dirname(__FILE__).'/../../Base/View.php');
     4
     5class DebugView extends View
    46{
    57  var $ItemListFormClass = array(
  • trunk/www/Application/View/Emulator.php

    r77 r78  
    11<?php
    22
    3 class EmulatorView extends Module
     3include_once(dirname(__FILE__).'/../../Base/View.php');
     4
     5class EmulatorView extends View
    46{
    57  var $ItemFormClass = array(
  • trunk/www/Application/View/HomePage.php

    r73 r78  
    11<?php
     2
     3include_once(dirname(__FILE__).'/../../Base/View.php');
     4include_once(dirname(__FILE__).'/../Model/Platform.php');
    25
    36class HomePageView extends View
  • trunk/www/Application/View/News.php

    r72 r78  
    11<?php
    22
    3 class NewsView extends Module
     3include_once(dirname(__FILE__).'/../../Base/View.php');
     4
     5class NewsView extends View
    46{
    57  var $ItemFormClass = array(
     
    4345    while($DbRow = $DbResult->fetch_assoc())
    4446    {
    45       $Output .= '<div><strong>'.$DbRow['Title'].'</strong>('.HumanDate($DbRow['Time']).')<br />'.$DbRow['Content'].'</div>';
     47      $Output .= '<div><strong>'.$DbRow['Title'].'</strong>('.$DbRow['Time'].')<br />'.$DbRow['Content'].'</div>';
    4648    }
    4749    $Output .= '</td>';
  • trunk/www/Application/View/Page.php

    r77 r78  
    11<?php
     2
     3include_once(dirname(__FILE__).'/../../Base/View.php');
     4include_once(dirname(__FILE__).'/News.php');
    25
    36class PageView extends View
     
    5659   '<li>Správce: '.$this->Config['Web']['Admin'].'</li>'.
    5760   '<li>E-mail: '.$this->Config['Web']['AdminEmail'].'</li>';
    58     if($this->Config['Web']['ShowRuntimeInfo'] == true) $Output .= '<li>Doba generování: '.$Time.' s / '.ini_get('max_execution_time').' s</li><li>Použitá paměť: '.HumanSize(memory_get_peak_usage(FALSE)).' / '.ini_get('memory_limit').'B</li>';
     61    if($this->Config['Web']['ShowRuntimeInfo'] == true) $Output .= '<li>Doba generování: '.$Time.' s / '.ini_get('max_execution_time').' s</li><li>Použitá paměť: '.$this->System->AddPrefixMultipliers(memory_get_peak_usage(FALSE), 'B').' / '.ini_get('memory_limit').'B</li>';
    5962  $Output .= '</ul></div></body></html>';
    6063    return($Output);
  • trunk/www/Application/View/Realm.php

    r77 r78  
    11<?php
    22
    3 class RealmView extends Module
     3include_once(dirname(__FILE__).'/../../Base/View.php');
     4
     5class RealmView extends View
    46{
    57  var $ItemFormClass = array(
  • trunk/www/Application/View/Server.php

    r77 r78  
    11<?php
    22
    3 class ServerView extends Module
     3include_once(dirname(__FILE__).'/../../Base/View.php');
     4
     5class ServerView extends View
    46{
    57  var $ItemFormClass = array(
     
    256258      $Form->LoadValuesFromDatabase($_GET['Id']);
    257259      $Form->Values['ServerId'] = $_GET['Id'];
    258       $Form->OnSubmit = '?Action=ServerSave';
     260      $Form->OnSubmit = '?Module=Server&amp;Action=Save';
    259261      $Output .= $Form->ShowEditForm();
    260262    } else $Output = $this->System->SystemMessage('Nastavení serveru', 'Nemáte oprávnění');
  • trunk/www/Application/View/Task.php

    r72 r78  
    11<?php
    22
    3 class TaskView extends Module
     3include_once(dirname(__FILE__).'/../../Base/View.php');
     4
     5class TaskView extends View
    46{
    57  var $ItemListFormClass = array(
     
    2628    global $Config;
    2729   
    28     if($this->System->Modules['User']->User['Role'] >= USER_ROLE_USER)
     30    $Output = '<h4>Fronta úloh</h4>';
     31    $Table = new Table($this->ItemListFormClass);
     32    $Table->OnRow = array($this, 'ShowListOnRow');
     33    $Table->Definition['Table'] = '(SELECT Id, (COALESCE(UNIX_TIMESTAMP(TimeEnd), UNIX_TIMESTAMP(NOW())) - UNIX_TIMESTAMP(TimeStart)) AS Duration, TimeCreate, Title, State FROM Task WHERE User='.$this->System->Modules['User']->User['Id'].' ORDER BY Id DESC)';
     34    $Table->Definition['Items']['Id'] = array('Type' => 'Hidden', 'Caption' => '', 'Default' => '');
     35    $Table->LoadValuesFromDatabase($this->Database);
     36    $Table->Definition['Items']['Actions'] = array('Type' => 'String', 'Caption' => '', 'Default' => '');
     37    foreach($Table->Values as $Index => $Item)
    2938    {
    30       $Output = '<h4>Fronta úloh</h4>';
    31       $Table = new Table($this->ItemListFormClass);
    32       $Table->OnRow = array($this, 'ShowListOnRow');
    33       $Table->Definition['Table'] = '(SELECT Id, (COALESCE(UNIX_TIMESTAMP(TimeEnd), UNIX_TIMESTAMP(NOW())) - UNIX_TIMESTAMP(TimeStart)) AS Duration, TimeCreate, Title, State FROM Task WHERE User='.$this->System->Modules['User']->User['Id'].' ORDER BY Id DESC)';
    34       $Table->Definition['Items']['Id'] = array('Type' => 'Hidden', 'Caption' => '', 'Default' => '');
    35       $Table->LoadValuesFromDatabase($this->Database);
    36       $Table->Definition['Items']['Actions'] = array('Type' => 'String', 'Caption' => '', 'Default' => '');
    37       foreach($Table->Values as $Index => $Item)
    38       {
    39         $Table->Values[$Index]['Actions'] = '<a href="?Module=Task&amp;Action=ErrorLog&amp;Id='.$Item['Id'].'">Výpis chyb</a> <a href="?Module=Task&amp;Action=StandardLog&amp;Id='.$Item['Id'].'">Výpis výstupu</a> ';
    40         unset($Table->Values[$Index]['Id']);
    41       }
    42       $Output .= $Table->Show();
    43       $Output .= '<br /><div style="text-align: center;"><a href="?Action=TaskList">Obnovit pohled</a></dev>';     
    44     } else $Output = USER_BAD_ROLE;
     39      $Table->Values[$Index]['Actions'] = '<a href="?Module=Task&amp;Action=ErrorLog&amp;Id='.$Item['Id'].'">Výpis chyb</a> <a href="?Module=Task&amp;Action=StandardLog&amp;Id='.$Item['Id'].'">Výpis výstupu</a> ';
     40      unset($Table->Values[$Index]['Id']);
     41    }
     42    $Output .= $Table->Show();
     43    $Output .= '<br /><div style="text-align: center;"><a href="?Action=TaskList">Obnovit pohled</a></dev>';     
    4544    return($Output);
    4645  }
  • trunk/www/Application/View/Update.php

    r69 r78  
    11<?php
    22
    3 class UpdateView extends Module
     3include_once(dirname(__FILE__).'/../../Base/View.php');
     4
     5class UpdateView extends View
    46{
    57  function ItemList()
  • trunk/www/Application/View/User.php

    r77 r78  
    11<?php
    22
    3 class UserView extends Module
     3include_once(dirname(__FILE__).'/../../Base/View.php');
     4
     5class UserView extends View
    46{
    57  var $OptionsFormClass = array(
     
    142144  {
    143145    $UserOptions = new Form($this->System, $this->OptionsFormClass);
    144     $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']);
     146    $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->Data['Id']);
    145147    $UserOptions->OnSubmit = '?Module=User&amp;Action=UserOptionsSave';
    146148    $Output = $UserOptions->ShowEditForm();
     
    152154    $UserOptions = new Form($this->System, $this->OptionsFormClass, array());
    153155    $UserOptions->LoadValuesFromForm();
    154     $UserOptions->SaveValuesToDatabase($this->System->Modules['User']->User['Id']);
     156    $UserOptions->SaveValuesToDatabase($this->System->Modules['User']->Data['Id']);
    155157    $Page = new PageView($this->System);
    156158    $Output = $Page->SystemMessage('Nastavení', 'Nastavení uloženo.');
    157159    $this->System->Modules['Log']->NewRecord('User', 'Nastavení uživatele změněno', $UserOptions->Values['Name']);
    158     $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->User['Id']);
     160    $UserOptions->LoadValuesFromDatabase($this->System->Modules['User']->Data['Id']);
    159161    $UserOptions->OnSubmit = '?Module=User&amp;Action=UserOptionsSave';
    160162    $Output .= $UserOptions->ShowEditForm();
Note: See TracChangeset for help on using the changeset viewer.