src/Resource.php
public static function getCurrentTheme()
    {
        if (Resource::$_currentTheme != null) {
            return Resource::$_currentTheme;
        }
        $currentTheme = "";
        if (isset($_GET['theme'])) {
            $currentTheme = $_GET['theme'];
        }
        if ($currentTheme == "") {
            $currentTheme = Openbizx::$app->getSessionContext()->getVar("THEME");
        }
        if ($currentTheme == "") {
            $currentTheme = Openbizx::$app->getUserPreference("theme");
        }
        if ($currentTheme == "" && defined('OPENBIZ_THEME_NAME')) {
            $currentTheme = OPENBIZ_THEME_NAME;
        }
        if ($currentTheme == "") {
            $currentTheme = Resource::DEFAULT_THEME;
        }

        // TODO: user pereference has language setting

        Openbizx::$app->getSessionContext()->setVar("THEME", $currentTheme);
        Resource::$_currentTheme = $currentTheme;

        return $currentTheme;
    }
public static function getCurrentTheme()
    {
        if (Resource::$_currentTheme != null) {
            return Resource::$_currentTheme;
        }
        $currentTheme = "";
        if (isset($_GET['theme'])) {
            $currentTheme = $_GET['theme'];
        }
        if ($currentTheme == "") {
            $currentTheme = Openbizx::$app->getSessionContext()->getVar("THEME");
        }
        if ($currentTheme == "") {
            $currentTheme = Openbizx::$app->getUserPreference("theme");
        }
        if ($currentTheme == "" && defined('OPENBIZ_THEME_NAME')) {
            $currentTheme = OPENBIZ_THEME_NAME;
        }
        if ($currentTheme == "") {
            $currentTheme = Resource::DEFAULT_THEME;
        }

        // TODO: user pereference has language setting

        Openbizx::$app->getSessionContext()->setVar("THEME", $currentTheme);
        Resource::$_currentTheme = $currentTheme;

        return $currentTheme;
    }
theme selection priority: url, session, userpref, system(constant)