/** * GetCurrentModule: Returns class name of module to run (syn: current module) */ static function GetCurrentModule() { // cm variable if (utopia::VarExists('current_module')) { return utopia::GetVar('current_module'); } // GET uuid if (isset($_GET['uuid'])) { $m = utopia::UUIDExists($_GET['uuid']); if ($m) { return $m['module_name']; } } // rewritten url? /u/MOD/ $u = self::GetRewriteURL(); if (!isset(self::$cmCache[$u])) { foreach (self::GetModules() as $m) { if ($m['uuid'] && preg_match('/^' . preg_quote($m['uuid'] . '/', '/') . '/i', $u . '/')) { self::$cmCache[$u] = $m['module_name']; return $m['module_name']; } self::$cmCache[$u] = false; } } if (self::$cmCache[$u]) { return self::$cmCache[$u]; } // admin root? if (strpos($_SERVER['REQUEST_URI'], PATH_REL_CORE) === 0) { return 'uDashboard'; } // CMS return 'uCMS_View'; }