static function findPage() { if (self::$currentPage) { return self::$currentPage; } $uri = $_SERVER['REQUEST_URI']; $uri = preg_replace('/(\\?.*)?/', '', $uri); if ($uri === PATH_REL_ROOT) { return self::GetHomepage(); } if (strpos($uri, PATH_REL_CORE . 'index.php') === 0) { return FALSE; } $obj = utopia::GetInstance('uCMS_View'); $cm = utopia::GetCurrentModule(); if ($cm && $cm !== __CLASS__) { $o = utopia::GetInstance(utopia::GetCurrentModule()); $uuid = $o->GetUUID(); $uuid = explode('/', $uuid); $uuid = end($uuid); $row = $obj->LookupRecord($uuid); if ($row) { self::$currentPage = $row; return $row; } return false; } preg_match('/([^\\/]+)(\\/)?(\\.php)?$/Ui', $uri, $matches); if (array_key_exists(1, $matches)) { $row = $obj->LookupRecord($matches[1]); if ($row) { self::$currentPage = $row; return $row; } } return false; }