Beispiel #1
0
 /**
  * Load the $_GET['mo'] or GWF_DEFAULT_MODULE and execute it
  * @return GWF3 
  */
 public function onLoadModule()
 {
     # Load the module
     $db = gdo_db();
     if (false === (self::$MODULE = GWF_Module::loadModuleDB($_GET['mo']))) {
         if (false === (self::$MODULE = GWF_Module::loadModuleDB(GWF_DEFAULT_MODULE))) {
             self::logDie('No module found.');
         }
         $_GET['me'] = GWF_DEFAULT_METHOD;
     }
     # Module is enabled?
     if (true === self::$MODULE->isEnabled()) {
         # Execute the method
         self::$MODULE->onInclude();
         self::$MODULE->onLoadLanguage();
         $db = gdo_db();
         $db->transactionStart();
         self::$page = self::$MODULE->execute($_GET['me']);
         if (true === isset($_GET['ajax'])) {
             self::$page = GWF_Website::getDefaultOutput() . self::$page;
         }
     } else {
         # TODO: HTTP Response code (by GWF_Exception(?))
         self::$page = GWF_HTML::err('ERR_MODULE_DISABLED', array(self::$MODULE->display('module_name')));
     }
     return $this;
 }