concrete/src/View/View.php
protected function loadViewThemeObject()
    {
        $env = Environment::get();
        $app = Facade::getFacadeApplication();
        $tmpTheme = $app->make(ThemeRouteCollection::class)
            ->getThemeByRoute($this->getViewPath());
        if (isset($tmpTheme[0])) {
            $this->themeHandle = $tmpTheme[0];
        }

        if ($this->themeHandle) {
            switch ($this->themeHandle) {
                case VIEW_CORE_THEME:
                    $this->themeObject = new \Concrete\Theme\Concrete\PageTheme();
                    $this->pkgHandle = false;
                    break;
                case 'dashboard':
                    $this->themeObject = new \Concrete\Theme\Dashboard\PageTheme();
                    $this->pkgHandle = false;
                    break;
                default:
                    if (!isset($this->themeObject)) {
                        $this->themeObject = PageTheme::getByHandle($this->themeHandle);
                        $this->themePkgHandle = $this->themeObject->getPackageHandle();
                    }

            }
            $this->themeAbsolutePath = $env->getPath(DIRNAME_THEMES.'/'.$this->themeHandle, $this->themePkgHandle);
            $this->themeRelativePath = $env->getURL(DIRNAME_THEMES.'/'.$this->themeHandle, $this->themePkgHandle);
        }
    }
protected function loadViewThemeObject()
    {
        $env = Environment::get();
        $app = Facade::getFacadeApplication();
        $tmpTheme = $app->make(ThemeRouteCollection::class)
            ->getThemeByRoute($this->getViewPath());
        if (isset($tmpTheme[0])) {
            $this->themeHandle = $tmpTheme[0];
        }

        if ($this->themeHandle) {
            switch ($this->themeHandle) {
                case VIEW_CORE_THEME:
                    $this->themeObject = new \Concrete\Theme\Concrete\PageTheme();
                    $this->pkgHandle = false;
                    break;
                case 'dashboard':
                    $this->themeObject = new \Concrete\Theme\Dashboard\PageTheme();
                    $this->pkgHandle = false;
                    break;
                default:
                    if (!isset($this->themeObject)) {
                        $this->themeObject = PageTheme::getByHandle($this->themeHandle);
                        $this->themePkgHandle = $this->themeObject->getPackageHandle();
                    }

            }
            $this->themeAbsolutePath = $env->getPath(DIRNAME_THEMES.'/'.$this->themeHandle, $this->themePkgHandle);
            $this->themeRelativePath = $env->getURL(DIRNAME_THEMES.'/'.$this->themeHandle, $this->themePkgHandle);
        }
    }
protected function loadViewThemeObject ( ) { $ env = Environment :: get ( ) ; $ app = Facade :: getFacadeApplication ( ) ; $ tmpTheme = $ app -> make ( ThemeRouteCollection :: class ) -> getThemeByRoute ( $ this -> getViewPath ( ) ) ; if ( isset ( $ tmpTheme [ 0 ] ) ) { $ this -> themeHandle = $ tmpTheme [ 0 ] ; } if ( $ this -> themeHandle ) { switch ( $ this -> themeHandle ) { case VIEW_CORE_THEME : $ this -> themeObject = new \ Concrete \ Theme \ Concrete \ PageTheme ( ) ; $ this -> pkgHandle = false ; break ; case 'dashboard' : $ this -> themeObject = new \ Concrete \ Theme \ Dashboard \ PageTheme ( ) ; $ this -> pkgHandle = false ; break ; default : if ( ! isset ( $ this -> themeObject ) ) { $ this -> themeObject = PageTheme :: getByHandle ( $ this -> themeHandle ) ; $ this -> themePkgHandle = $ this -> themeObject -> getPackageHandle ( ) ; } } $ this -> themeAbsolutePath = $ env -> getPath ( DIRNAME_THEMES . '/' . $ this -> themeHandle , $ this -> themePkgHandle ) ; $ this -> themeRelativePath = $ env -> getURL ( DIRNAME_THEMES . '/' . $ this -> themeHandle , $ this -> themePkgHandle ) ; } }
Load all the theme-related variables for which theme to use for this request. May update the themeHandle
property on the view based on themeByRoute settings.
Load all the theme - related variables for which theme to use for this request . May update the themeHandle property on the view based on themeByRoute settings .