Changeset 434 for trunk/forms.php


Ignore:
Timestamp:
Oct 12, 2012, 9:03:30 AM (12 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/forms.php

    r433 r434  
    2626    );
    2727    foreach($this->Definition['Items'] as $Index => $Item)
     28    if(!array_key_exists($Item['Type'], $FormTypes) or
     29    (array_key_exists($Item['Type'], $FormTypes) and ($FormTypes[$Item['Type']]['Type'] != 'ManyToOne')))
    2830    {
    2931      if(!array_key_exists($Index, $this->Values) and isset($Item['Default'])) $this->Values[$Index] = $Item['Default'];
     
    6466    if($Context != '') $Context = $Context.'-';
    6567    foreach($this->Definition['Items'] as $Index => $Item)
     68    if(!array_key_exists($Item['Type'], $FormTypes) or
     69    (array_key_exists($Item['Type'], $FormTypes) and ($FormTypes[$Item['Type']]['Type'] != 'ManyToOne')))
    6670    {
    6771      if(!array_key_exists($Index, $this->Values) and isset($Item['Default'])) $this->Values[$Index] = $Item['Default'];
     
    154158  function LoadValuesFromDatabase($Id)
    155159  {
    156     global $Database;
     160    global $Database, $FormTypes;
    157161
    158162    $DbResult = $Database->query('SELECT T.* FROM '.$this->Definition['Table'].' AS T WHERE T.Id='.$Id);
    159163    $DbRow = $DbResult->fetch_array();
    160164    foreach($this->Definition['Items'] as $Index => $Item)
     165    if(!array_key_exists($Item['Type'], $FormTypes) or
     166    (array_key_exists($Item['Type'], $FormTypes) and ($FormTypes[$Item['Type']]['Type'] != 'ManyToOne')))
    161167    {
    162168      $this->Values[$Index] = $DbRow[$Index];
Note: See TracChangeset for help on using the changeset viewer.