Changeset 21 for forms.php


Ignore:
Timestamp:
Oct 22, 2008, 10:33:11 AM (16 years ago)
Author:
george
Message:
  • Upraveno: Načítání definic typů "na přání" namísto načtení všech najednou. Úspora paměti, více SQL dotazů, možné zpomalení načítání.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • forms.php

    r20 r21  
    99  var $OnSubmit = '';
    1010
    11   function DefinitionTextTypeToNumericType()
    12   {
    13     global $TypeNames;
    14 
    15     foreach($this->Definition['Items'] as $Index => $Definition)
    16       if(!is_numeric($Definition['Type'])) $this->Definition['Items'][$Index]['Type'] = $TypeNames[$Definition['Type']];
    17   }
    18 
    1911  function ShowEditForm()
    2012  {
    21     $this->DefinitionTextTypeToNumericType();
    2213    $Output = '<center><form enctype="multipart/form-data" action="'.$this->OnSubmit.'" method="post"><div align="center">';
    2314    $Table = $this->ShowEditBlock();
     
    2819  function ShowEditBlock($Context = '')
    2920  {
    30     global $Database, $Types, $TypeNames;
     21    global $Database;
    3122
    3223    $Table = array(
     
    3728    foreach($this->Definition['Items'] as $Index => $Item)
    3829    {
    39       if($Item['Type'] != $TypeNames['Hidden'])
     30      if($Item['Type'] != TypeHiddenId)
    4031      {
    4132        if(!array_key_exists($Index, $this->Values) and isset($Item['Value'])) $this->Values[$Index] = $Item['Value'];
     
    4940  function ShowHiddenBlock($Context = '')
    5041  {
    51     global $Database, $Types, $TypeNames;
     42    global $Database;
    5243
    5344    $Output = '';
     
    5546    foreach($this->Definition['Items'] as $Item)
    5647    {
    57       if($Item['Type'] == $TypeNames['Hidden'])
     48      if($Item['Type'] == TypeHiddenId)
    5849      {
    5950        if(!array_key_exists($Item['Name'], $this->Values) and isset($Item['Value'])) $this->Values[$Item['Name']] = $Item['Value'];
     
    6758  function ShowReadOnlyForm()
    6859  {
    69     $this->DefinitionTextTypeToNumericType();
    70 
    7160    $Output = '<center><div align="center">';
    7261    $Table = $this->ShowReadOnlyBlock();
     
    7766  function ShowReadOnlyBlock($Context = '')
    7867  {
    79     global $Database, $Types;
     68    global $Database;
    8069
    8170    $Table = array(
     
    138127  function LoadValuesFromForm()
    139128  {
    140     $this->DefinitionTextTypeToNumericType();
    141129    $this->Values = $this->LoadValuesFromFormBlock();
    142130  }
     
    144132  function LoadValuesFromFormBlock($Context = '')
    145133  {
    146     global $FormTypes;
    147 
    148134    $Values = array();
    149135    foreach($this->Definition['Items'] as $Index => $Item)
Note: See TracChangeset for help on using the changeset viewer.