Ignore:
Timestamp:
Mar 16, 2014, 11:15:43 AM (11 years ago)
Author:
chronos
Message:
  • Added: Module Redirection responsible for redirection of old pages to new valid address.
  • Fixed: Error on client version item display if id was not specified.
  • Fixed: Error on silent application module reregistration.
  • Removed: White space on end of lines in some files.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/includes/AppModule.php

    r545 r800  
    66  var $Name;
    77  var $Version;
    8   var $License; 
     8  var $License;
    99  var $Creator;
    1010  var $Description;
     
    1919  var $Manager;
    2020  var $OnChange;
    21  
     21
    2222  function __construct($System)
    2323  {
     
    2727    $this->Dependencies = array();
    2828  }
    29  
     29
    3030  function Install()
    3131  {
    3232  }
    33  
     33
    3434  function Uninstall()
    3535  {
    3636  }
    37  
     37
    3838  function Start()
    3939  {
    4040  }
    41  
     41
    4242  function Stop()
    4343  {
    44   } 
     44  }
    4545}
    4646
    47 class AppModuleManager 
     47class AppModuleManager
    4848{
    4949  var $Modules;
    50  
     50
    5151  function __construct()
    5252  {
    53     $this->Modules = array();     
     53    $this->Modules = array();
    5454  }
    55  
     55
    5656  function StartAll()
    5757  {
     
    7171    }
    7272  }
    73  
     73
    7474  function ModulePresent($Name)
    7575  {
    7676    return(array_key_exists($Name, $this->Modules));
    7777  }
    78  
     78
    7979  function RegisterModule(AppModule $Module)
    8080  {
    81     $this->Modules[$Module->Name] = &$Module; 
    82     $Module->Manager = &$this;
    83     $Module->OnChange = &$this->OnModuleChange;
     81    if(!isset($this->Modules[$Module->Name]))
     82    {
     83      $this->Modules[$Module->Name] = &$Module;
     84      $Module->Manager = &$this;
     85      $Module->OnChange = &$this->OnModuleChange;
     86    } else throw new Exception('Module '.$Module->Name.' redefined');
    8487  }
    85  
     88
    8689  function UnregisterModule($Module)
    8790  {
    88     unset($this->Modules[array_search($Module, $this->Modules)]); 
     91    unset($this->Modules[array_search($Module, $this->Modules)]);
    8992  }
    90  
     93
    9194  /* @return Module */
    9295  function SearchModuleById($Id)
     
    98101    }
    99102    return('');
    100   } 
     103  }
    101104}
Note: See TracChangeset for help on using the changeset viewer.