Changeset 817 for trunk/Packages


Ignore:
Timestamp:
Mar 16, 2016, 8:51:59 PM (9 years ago)
Author:
chronos
Message:
Location:
trunk/Packages/Common
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Packages/Common/AppModule.php

    r791 r817  
    6969    $this->License = '';
    7070    $this->Version = '';
    71     $this->Creator = '';
    7271    $this->Description = '';
    7372    $this->Dependencies = array();
    7473    $this->Type = ModuleType::Normal;
    7574  }
    76 
     75 
    7776  function Install()
    7877  {
  • trunk/Packages/Common/Application.php

    r790 r817  
    11<?php
     2
     3class ModelDef
     4{
     5  var $OnChange;
     6 
     7  function __construct()
     8  {
     9    $this->OnChange = array();
     10  }
     11 
     12  function DoOnChange()
     13  {
     14    foreach($this->OnChange as $Callback)
     15    {
     16      call_user_func($Callback);
     17    }
     18  }
     19 
     20  function RegisterOnChange($SysName, $Callback)
     21  {
     22    $this->OnChange[$SysName] = $Callback;
     23  }
     24 
     25  function UnregisterOnChange($SysName)
     26  {
     27    unset($this->OnChange[$SysName]);
     28  }
     29}
    230
    331class Application extends System
     
    735  var $ModuleManager;
    836  var $Modules;
    9 
     37  var $Models;
     38 
    1039  function __construct()
    1140  {
     
    1443    $this->ModuleManager = new AppModuleManager($this);
    1544    $this->Modules = array();
     45    $this->Models = array();
     46  }
     47 
     48  function RegisterModel($SysName, $Model)
     49  {
     50    $NewModelDef = new ModelDef();
     51    $NewModelDef->Title = $Model['Title'];
     52    $this->Models[$SysName] = $NewModelDef;
    1653  }
    1754
     55  function UnregisterModel($SysName)
     56  {
     57    unset($this->Models[$SysName]);
     58  }
     59 
    1860  function Run()
    1961  {
Note: See TracChangeset for help on using the changeset viewer.