Changeset 431 for trunk/is/index.php


Ignore:
Timestamp:
Oct 11, 2012, 9:15:05 PM (12 years ago)
Author:
chronos
Message:
  • Přidáno: Zobrazení položek pro čtení ve správě dat.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/is/index.php

    r430 r431  
    3434    {
    3535      if(array_key_exists('Table', $_SESSION))
    36         $Output .= $this->ShowTable($FormClasses[$_SESSION['Table']]);
     36        $Output .= $this->ShowList($FormClasses[$_SESSION['Table']]);
    3737    } else
    38     if($_SESSION['Action'] == 'edit')
    39     {
    40       $Form = new Form($_SESSION['Table']);
    41       $Form->LoadValuesFromDatabase($_SESSION['Id']);
    42       $Form->OnSubmit = '?a=view';
    43       $Output .= $Form->ShowEditForm();
    44     } else
    45     if($_SESSION['Action'] == 'view')
    46     {
    47    
    48     } else
    49     if($_SESSION['Action'] == 'delete')
    50     {
    51    
    52     }
     38    if($_SESSION['Action'] == 'edit') $Output .= $this->ShowEdit();
     39    else if($_SESSION['Action'] == 'add') $Output .= $this->ShowAdd();
     40    else if($_SESSION['Action'] == 'view') $Output .= $this->ShowView();
     41    else if($_SESSION['Action'] == 'delete') $Output .= $this->ShowDelete();
    5342    $Output .= '</td></tr></table>';
    5443   
     
    5645  }
    5746 
    58   function ShowTable($FormClass)
     47  function ShowEdit()
     48  {
     49    $Form = new Form($_SESSION['Table']);
     50    $Form->LoadValuesFromDatabase($_SESSION['Id']);
     51    $Form->OnSubmit = '?a=view';
     52    $Output = $Form->ShowEditForm();
     53    return($Output);
     54  }
     55 
     56  function ShowDelete()
     57  {
     58    $Output = '';
     59    return($Output);
     60  }
     61 
     62  function ShowAdd()
     63  {
     64    $Form = new Form($_SESSION['Table']);
     65    $Form->OnSubmit = '?a=view';
     66    $Output = $Form->ShowEditForm();
     67    return($Output);
     68  }
     69 
     70  function ShowView()
     71  {
     72    $Form = new Form($_SESSION['Table']);
     73    $Form->LoadValuesFromDatabase($_SESSION['Id']);
     74    $Form->OnSubmit = '?a=view';
     75    $Output = $Form->ShowViewForm();
     76    $Output .= '<br/><div style="text-align: center;"><a href="?a=edit"><img alt="Upravit" title="Upravit" src="'.
     77        $this->System->Link('/images/edit.png').'"/></a></div>';
     78    return($Output);
     79  }
     80 
     81  function ShowList($FormClass)
    5982  {   
    6083    global $Type, $FormTypes;
     
    7093      $TableColumns[] = array('Name' => $ItemIndex, 'Title' => $FormItem['Caption']);
    7194    $TableColumns[] = array('Name' => '', 'Title' => 'Akce');
    72     $Order = GetOrderTableHeader($TableColumns, 'Name', 0);
     95    if(!array_key_exists('DefaultSortColumn', $FormClass))
     96      $FormClass['DefaultSortColumn'] = 'Id';
     97    $Order = GetOrderTableHeader($TableColumns, $FormClass['DefaultSortColumn'], 0);
    7398    $Output .= $Order['Output'];
    7499
Note: See TracChangeset for help on using the changeset viewer.