Register view location of theme.

@param null $theme
163693
public function registerViewLocation($theme = null)
    {
        if (is_null($theme)) {
            $theme = $this->getCurrent();
        }

        $this->views->addLocation($this->getPath() . '/' . $theme . '/views');
    }
1260403
public function setTheme(View $view, $themes)
    {
        $cacheKey = $this->getCacheKey($view);

        $this->themes[$cacheKey] = $themes;
    }
177765
protected function exists(string $resource, Theme $theme = null) : bool
    {
        return is_file($this->getResourcePath($resource, $theme));
    }
224326
public static function theme($theme = null)
    {
        if (!self::$_initialized) {
            self::init();
        }

        if ($theme !== null) {
            if (!isset(self::$_themes[$theme])) {
                throw new Exception(__d('wasabi_cms', 'Theme "{0}" does not exist.', $theme));
            }
            self::$_theme = self::$_themes[$theme];
        }

        return self::$_theme;
    }
153753
public function theme($theme = null)
    {
        deprecationWarning(
            'View::theme() is deprecated. ' .
            'Use getTheme()/setTheme() instead.'
        );

        if ($theme === null) {
            return $this->theme;
        }

        $this->theme = $theme;
    }
1210076
public function registerAssetFiles($view)
    {
        switch ($this->theme) {
            case Quill::THEME_SNOW:
                $this->css = [$this->url . $this->version . '/quill.snow.css'];
                break;

            case Quill::THEME_BUBBLE:
                $this->css = [$this->url . $this->version . '/quill.bubble.css'];
                break;

            default:
                $this->css = [$this->url . $this->version . '/quill.core.css'];
        }
        
        $this->js = [$this->url . $this->version . '/quill.min.js'];
        
        parent::registerAssetFiles($view);
    }
235588
public function register()
    {
        if (! function_exists('add_theme_support') || empty($this->features)) {
            return;
        }

        foreach ($this->features as $feature => $value) {
            add_theme_support($feature, $value);
        }
    }
1240947
public function init($themePath)
    {
        $this->themePath = $themePath;
        $this->themeURL = get_bloginfo('url');

        add_action('after_setup_theme', array($this, 'afterSetupTheme'));
        add_action('template_include', array($this, 'templateInclude'));

    }
892273
public static function init_config($theme_root = null)
    {
        if (static::$setup === false) {
            $config = new Config();

            if ($theme_root === null) {
                $config_cache_path = \get_stylesheet_directory() . '/cache/config/' . \sha1(NONCE_SALT . 'theme');

                if (WP_DEBUG === false && \file_exists($config_cache_path)) {
                    $config->load_from_cache(\file_get_contents($config_cache_path));
                } else {
                    $config->add_path(\get_template_directory() . '/config');

                    if (\is_child_theme()) {
                        $config->add_path(\get_stylesheet_directory() . '/config');
                    }
                }
            }

            if ($theme_root !== null) {
                $config->add_path($theme_root . '/config');
            }

            static::$container->add_instance($config);
            static::$container->alias(Config::class, 'config');
        }
    }
408080
public function theme($theme = null)
    {
        if ($theme === null) {
            return isset($this->_data['theme']) ? $this->_data['theme'] : '';
        }
        $this->_data['theme'] = $theme;
    }
1338824
public function addTheme(Theme $theme)
    {
        $themeName = $this->normalizeKey($theme->getThemeName());

        $this->themes[$themeName] = $theme;
    }
521581
public function theme($theme = null)
    {
        // If theme name is not set, so use default from config.
        if ($theme != false) {
            $this->theme = $theme;
        }

        // Is theme ready?
        if (! $this->exists($theme)) {
            throw new UnknownThemeException("Theme [$theme] not found.");
        }

        // Add location to look up view.
        $this->addPathLocation($this->path());

        // Fire event before set up a theme.
        $this->fire('before', $this);

        // Before from a public theme config.
        $this->fire('appendBefore', $this);

        // Add asset path to asset container.
        $this->asset->addPath($this->path().'/'.$this->getConfig('containerDir.asset'));

        return $this;
    }
1349487
public function registerAssetFiles($view)
    {
        if ($this->language !== null) {
            $this->js[] = 'langs/' . $this->language . '.min.js';
        }

        if (!empty($this->plugins)) {
            foreach ($this->plugins as $plugin => $properties) {
                if (is_string($properties)) {
                    $plugin = $properties;
                }

                if ($plugin === 'colors') {
                    $this->css[] = 'plugins/' . $plugin . '/ui/trumbowyg.' . $plugin . '.css';
                }

                $this->js[] = 'plugins/' . $plugin . '/trumbowyg.' . $plugin . '.js';
            }
        }

        parent::registerAssetFiles($view);
    }
1102578
static function setCurrent($theme = null) {
        //удалить все невостребованные классы тем оформления
        foreach(self::getThemes() as $t) {
            \LaraPage::body()->removeClass(self::getClassTheme($t));
        }
        //добавить класс текущей темы оформления
        \LaraPage::body()->addClass(self::getClassTheme($theme));
        self::$current = $theme;
        \Twig::addGlobal('current_theme', $theme);
    }
1150364
public function view($view = null, $layout = null)
    {
        if (! is_null($layout)) {
            $this->layoutOptions = [
                'default' => $layout,
                'ajax'    => $layout,
            ];
        }

        // Set up the default view resolution
        viewBuilder()->setUp($this->layoutOptions, $view);
        $this->setupLayout();
    }
939799
public function set($theme)
    {
        list($theme, $parent) = $this->resolveTheme($theme);

        if (! $this->isCurrently($theme->get('slug')) and (! is_null($this->getCurrent()))) {
            $this->removeRegisteredLocation();
        }

        $this->setCurrent($theme->get('slug'));
        
        $this->registerAutoload($this->format($theme->get('slug')));
        $this->addRegisteredLocation($theme, $parent);
        $this->symlinkPublicDirectory();
        $this->registerServiceProvider($this->format($theme->get('slug')));
    }
1331920
public static function registerTheme($theme)
    {
        $themes = (array) $theme;
        array_walk($themes, function (&$name) {
            $name .= '.js';
        });
        static::$_themeJsFiles = array_unique(array_merge(static::$_themeJsFiles, $themes));
        if (static::$_themeJsFiles) {
            ThemeAsset::register(Yii::$app->getView())->js = static::$_themeJsFiles;
        }
    }