Ignore:
Timestamp:
Mar 10, 2013, 8:15:46 PM (11 years ago)
Author:
chronos
Message:
  • Přidáno: FormManager pro objektové řešení zrušení vazeb na třídu System. FormManager nyní obsluhuje existující formulářové typy a třídy formulářů.
  • Přidáno: Formulářový typ FileContent zajistí načtení obsahu souboru. Typ File pak zajistí i uložení do databáze a přiřazení Id do tabulky File.
  • Odstraněno: Adresář docs obsahoval staré dokumenty. Ty musí být přesunuty do adresáře files a registrovány do databáze.
  • Upraveno: Třídy Database nyní bude hlásit chyby přes výjimky PHP.
Location:
trunk/Common/Form
Files:
1 added
1 copied
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/Common/Form/Types/Type.php

    r500 r501  
    1616include(dirname(__FILE__).'/Hyperlink.php');
    1717include(dirname(__FILE__).'/Hidden.php');
    18 include(dirname(__FILE__).'/File/File.php');
     18include(dirname(__FILE__).'/File.php');
     19include(dirname(__FILE__).'/FileContent.php');
    1920include(dirname(__FILE__).'/GPS.php');
    2021include(dirname(__FILE__).'/IPv4Address.php');
     
    2425class Type
    2526{
    26   var $System;
     27  var $FormManager;
    2728  var $TypeDefinitionList;
    2829  var $Values;
    2930
    30   function __construct($System)
     31  function __construct($FormManager)
    3132  {
    32     $this->System = $System;
     33    $this->FormManager = &$FormManager;
    3334    $this->TypeDefinitionList = array
    3435    (
     
    5253      'Color' => array('Name' => 'Color', 'Class' => 'Color', 'ParentType' => '', 'Parameters' => array()),
    5354      'RandomHash' => array('Name' => 'RandomHash', 'Class' => 'RandomHash', 'ParentType' => '', 'Parameters' => array()),
     55      'FileContent' => array('Name' => 'FileContent', 'Class' => 'FileContent', 'ParentType' => '', 'Parameters' => array()),
    5456    );
    5557  }
     
    6163      $Type = $this->TypeDefinitionList[$TypeName];
    6264      $TypeClass = 'Type'.$Type['Class'];
    63       $TypeObject = new $TypeClass($this->System);
     65      $TypeObject = new $TypeClass($this->FormManager);
    6466      if(is_callable(array($TypeObject, $Event))) return($TypeObject->$Event($Parameters));
    6567        else return($TypeName.'->'.$Event.'('.serialize($Parameters).')');
     
    7375      $Type = $this->TypeDefinitionList[$TypeName];
    7476      $TypeClass = 'Type'.$Type['Class'];
    75       $TypeObject = new $TypeClass($this->System);
     77      $TypeObject = new $TypeClass($this->FormManager);
    7678      return($TypeObject->Hidden);
    7779    } else return(false);
     
    9294  }
    9395
     96  function UnregisterType($Name)
     97  {
     98    unset($this->TypeDefinitionList[$Name]);
     99    // TODO: remove dependent types
     100  }
     101 
    94102  function GetTypeDefinition($TypeName)
    95103  {
Note: See TracChangeset for help on using the changeset viewer.