Changeset 23 for base.php


Ignore:
Timestamp:
Oct 22, 2008, 12:54:08 PM (16 years ago)
Author:
george
Message:
  • Opraveno: Odkazy na konstanty id typů.
  • Upraveno: Definice událostí manipulace se seznamy jako třídy a jejich načítání "na přání".
File:
1 edited

Legend:

Unmodified
Added
Removed
  • base.php

    r22 r23  
    166166        {
    167167          $DefinitionItems[] = array('Name' => $Index, 'Caption' => $Item['TextBefore'].$Required, 'Value' => $DbRow[$Index], 'SourceTable' => $List['TableName'], 'SourceItemId' => $DbRow['Id'], 'Type' => $Item['Type']);
    168         } else $DefinitionItems[] = array('Name' => $Index, 'Type' => 'Hidden', 'Caption' => '', 'Value' => $DbRow[$Index]);
     168        } else $DefinitionItems[] = array('Name' => $Index, 'Type' => TypeHiddenId, 'Caption' => '', 'Value' => $DbRow[$Index]);
    169169      }
    170170    }
     
    246246    if($Item['Name'] == $Column)
    247247    {
    248       $DefinitionItems[] = array('Name' => $Column, 'Type' => 'Hidden', 'Caption' => '', 'Value' => $ColumnValue);
    249     }
    250   }
    251   $DefinitionItems[] = array('Name' => 'Column', 'Type' => 'Hidden', 'Caption' => '', 'Value' => $Column);
     248      $DefinitionItems[] = array('Name' => $Column, 'Type' => TypeHiddenId, 'Caption' => '', 'Value' => $ColumnValue);
     249    }
     250  }
     251  $DefinitionItems[] = array('Name' => 'Column', 'Type' => TypeHiddenId, 'Caption' => '', 'Value' => $Column);
    252252
    253253  $Form = new Form();
     
    288288    if($Item['Name'] == $Column)
    289289    {
    290       $DefinitionItems[] = array('Name' => $Column, 'Type' => 'Hidden', 'Caption' => '', 'Value' => $ColumnValue);
     290      $DefinitionItems[] = array('Name' => $Column, 'Type' => TypeHiddenId, 'Caption' => '', 'Value' => $ColumnValue);
    291291    }
    292292  }
     
    468468       'Items' => $Items,
    469469      );
     470      if(!array_key_exists($List['TableName'], $TypeDefinitionList))
     471      {
     472        $ClassName = 'List'.$DbRow['TableName'];
     473        if(class_exists($ClassName)) $List['Class'] = new $ClassName;
     474      }
    470475      $Lists[$List['TableName']] = $List;
    471476    } else $Lists[$List['TableName']] = NULL;
     
    514519function ExecuteListEvent($Table, $Event, $Parameters)
    515520{
    516   $Callback = 'List'.$Table.$Event;
    517   if(is_callable($Callback)) $Callback($Parameters);
     521  $ListDefinition = GetListDefinition($Table);
     522  if(array_key_exists('Class', $ListDefinition))
     523  {
     524    $ListObject = $ListDefinition['Class'];
     525    if(is_callable(array($ListObject, $Event))) return($ListObject->$Event($Parameters));
     526      else return($ListDefinition['TableName'].'->'.$Event.'('.$List.')');
     527  } else return($ListDefinition['TableName'].'->'.$Event.'('.$List.')');
    518528}
    519529
Note: See TracChangeset for help on using the changeset viewer.