Register theme constants.
972030
protected function setThemeConstants()
    {
        $this->parsedHeaders = $this->headers($this->dirPath.'/style.css', $this->headers);

        // Theme text domain.
        $textdomain = (isset($this->parsedHeaders['text_domain']) && ! empty($this->parsedHeaders['text_domain']))
            ? $this->parsedHeaders['text_domain']
            : 'themosis_theme';

        defined('THEME_TD') ? THEME_TD : define('THEME_TD', $textdomain);
    }
965754
def themed_default(self, cls, name, theme_overrides):
        ''' 

        '''
        overrides = theme_overrides
        if overrides is None or name not in overrides:
            overrides = cls._overridden_defaults()

        if name in overrides:
            default = self._copy_default(overrides[name])
        else:
            default = self._raw_default()
        return self.prepare_value(cls, name, default)
557367
public function registerCustomTheme(){
        Yii::app()->clientScript->registerCssFile( Yii::app()->baseUrl.'/themes/'.$this->customThemeName );
    }
531945
def load_config(files=None, root_path=None, local_path=None):
    """"""

    config = cfg.ConfigOpts()
    config.register_opts([
        cfg.Opt('root_path', default=root_path),
        cfg.Opt('local_path', default=local_path),
    ])
    # XXX register actual config groups here
    # theme_group = config_theme.register_config(config)
    if files is not None:
        config(args=[], default_config_files=files)
    return config
715737
public function setThemes()
	{
		$installedTheme	= $this->getThemesFromDir();
		$cacheTheme		= file(Yii::getPathOfAlias('application.config').'/cache_theme.php');
		$toBeInstalled	= array();
		
		$caches = array();
		foreach($cacheTheme as $val) {
			$caches[] = $val;
		}

		if(!$installedTheme)
			$installedTheme = array();
		
		foreach($caches as $cache) {
			$cache = trim($cache);
			if(!in_array($cache, array_map("trim", $installedTheme))) {
				$this->deleteTheme($cache, true);
			}
		}

		$themeDb = $this->cacheThemeConfig(true);
		foreach($installedTheme as $theme) {
			if(!in_array(trim($theme), array_map("trim", $themeDb))) {
				$config = $this->getThemeConfig($theme);
				$themeName = $this->urlTitle($theme);

				if($config && $themeName == $config['folder']) {
					$model=new OmmuThemes;
					$model->group_page = $config['group_page'];
					$model->folder = $theme;
					$model->layout = $config['layout'];
					$model->name = $config['name'];
					$model->thumbnail = $config['thumbnail'];
					$model->save();
				}
			}
		}
	}
910370
public function registerAssets()
    {
        $view = $this->getView();

        $asset = NotificationsAsset::register($view);

        // Register the theme assets
        if (!is_null($this->theme)) {
            if (!in_array($this->theme, self::$_builtinThemes)) {
                throw new Exception("Unknown theme: " . $this->theme, 501);
            }
            foreach (['js' => 'registerJsFile', 'css' => 'registerCssFile'] as $type => $method) {
                $filename = NotificationsAsset::getFilename($this->theme, $type);
                if ($filename) {
                    $view->$method($asset->baseUrl . '/' . $filename, [
                        'depends' => NotificationsAsset::className()
                    ]);
                }
            }
        }

        // Register timeago i18n file
        if ($filename = NotificationsAsset::getTimeAgoI18n($this->timeAgoLocale)) {
            $view->registerJsFile($asset->baseUrl . '/' . $filename, [
                'depends' => NotificationsAsset::className()
            ]);
        }

        $params = [
            'url' => Url::to(['/notifications/notifications/poll']),
            'xhrTimeout' => Html::encode($this->xhrTimeout),
            'delay' => Html::encode($this->delay),
            'options' => $this->clientOptions,
            'pollSeen' => !!$this->pollSeen,
            'pollInterval' => Html::encode($this->pollInterval),
            'counters' => $this->counters,
        ];

        if ($this->theme) {
            $params['theme'] = Html::encode($this->theme);
        }

        if ($this->markAllSeenSelector) {
            $params['markAllSeenSelector'] = $this->markAllSeenSelector;
            $params['seenAllUrl'] = Url::to(['/notifications/notifications/read-all']);
        }

        if ($this->deleteAllSelector) {
            $params['deleteAllSelector'] = $this->deleteAllSelector;
            $params['deleteAllUrl'] = Url::to(['/notifications/notifications/delete-all']);
        }

        if ($this->listSelector) {
            $params['seenUrl'] = Url::to(['/notifications/notifications/read']);
            $params['deleteUrl'] = Url::to(['/notifications/notifications/delete']);
            $params['flashUrl'] = Url::to(['/notifications/notifications/flash']);
            $params['listSelector'] = $this->listSelector;
            if ($this->listItemTemplate) {
                $params['listItemTemplate'] = $this->listItemTemplate;
            }
            if ($this->listItemBeforeRender instanceof JsExpression) {
                $params['listItemBeforeRender'] = $this->listItemBeforeRender;
            }
        }

        $js = 'Notifications(' . Json::encode($params) . ');';

        $view->registerJs($js);
    }
803312
def _load_themes(self):
        """"""
        with utils.temporary_chdir(utils.get_file_directory()):
            self._append_theme_dir("themes")
            self.tk.eval("source themes/pkgIndex.tcl")
            theme_dir = "gif" if not self.png_support else "png"
            self._append_theme_dir(theme_dir)
            self.tk.eval("source {}/pkgIndex.tcl".format(theme_dir))
        self.tk.call("package", "require", "ttk::theme::scid")
677777
public static function registerTheme($theme)
    {
        if (in_array($theme, self::$_registeredThemes)) {
            throw new Exception(__d('wasabi_cms', 'The Theme "{0}" is already registered.', $theme));
        }

        self::$_registeredThemes[] = $theme;
    }
1140984
function initThemes() {
        var activeThemeName = settingsCache.get('active_theme'),
            self = this;

        debug('init themes', activeThemeName);

        // Register a listener for server-start to load all themes
        common.events.on('server.start', function readAllThemesOnServerStart() {
            themeLoader.loadAllThemes();
        });

        // Just read the active theme for now
        return themeLoader
            .loadOneTheme(activeThemeName)
            .then(function activeThemeHasLoaded(theme) {
                // Validate
                return validate
                    .check(theme)
                    .then(function validationSuccess(checkedTheme) {
                        if (!validate.canActivate(checkedTheme)) {
                            const checkError = new common.errors.ThemeValidationError({
                                message: common.i18n.t('errors.middleware.themehandler.invalidTheme', {theme: activeThemeName}),
                                errorDetails: Object.assign(
                                    _.pick(checkedTheme, ['checkedVersion', 'name', 'path', 'version']), {
                                        errors: checkedTheme.results.error
                                    }
                                )
                            });

                            common.logging.error(checkError);

                            self.activate(theme, checkedTheme, checkError);
                        } else {
                            // CASE: inform that the theme has errors, but not fatal (theme still works)
                            if (checkedTheme.results.error.length) {
                                common.logging.warn(new common.errors.ThemeValidationError({
                                    errorType: 'ThemeWorksButHasErrors',
                                    message: common.i18n.t('errors.middleware.themehandler.themeHasErrors', {theme: activeThemeName}),
                                    errorDetails: Object.assign(
                                        _.pick(checkedTheme, ['checkedVersion', 'name', 'path', 'version']), {
                                            errors: checkedTheme.results.error
                                        }
                                    )
                                }));
                            }

                            debug('Activating theme (method A on boot)', activeThemeName);

                            self.activate(theme, checkedTheme);
                        }
                    });
            })
            .catch(common.errors.NotFoundError, function (err) {
                // CASE: active theme is missing, we don't want to exit because the admin panel will still work
                err.message = common.i18n.t('errors.middleware.themehandler.missingTheme', {theme: activeThemeName});
                common.logging.error(err);
            })
            .catch(function (err) {
                // CASE: theme threw an odd error, we don't want to exit because the admin panel will still work
                // This is the absolute catch-all, at this point, we do not know what went wrong!
                common.logging.error(err);
            });
    }
60187
protected function registerImageSizes()
    {
        do_action("before_theme_register_image-sizes");

        foreach ($this->getConfig("image-sizes") as $id => $data):
            add_image_size($id, $data["width"], $data["height"], $data["crop"]);
        endforeach;

        do_action("after_theme_register_image-sizes");
    }
1294041
public function register()
    {
        foreach ($this->templates as $post_type => $templates) {
            if (empty($templates)) {
                continue;
            }

            $this->filter->add("theme_{$post_type}_templates", function ($registered) use ($templates) {
                return array_merge($registered, $templates);
            });
        }
    }
812723
protected function registerNamespaces()
    {
        $configPath = __DIR__ . '/../config/config.php';
        $viewsPath = __DIR__ . '/../views';
        $this->mergeConfigFrom($configPath, 'menus');
        $this->loadViewsFrom($viewsPath, 'menus');

        $this->publishes([
            $configPath => config_path('menus.php'),
        ], 'config');

        $this->publishes([
            $viewsPath => base_path('resources/views/vendor/nwidart/menus'),
        ], 'views');
    }
793381
public function registerTheme()
	{
		$this->app->singleton('theme', function($app)
		{
			return new Theme($app['config'], $app['events'], $app['view'], $app['asset'], $app['files'], $app['breadcrumb'], $app['manifest']);
		});

		$this->app->alias('theme', 'Facuz\Theme\Contracts\Theme');
	}
914909
private function registerBindings()
    {
        $this->app->bind('society.isInstalled', function ($app) {
            return
                file_exists(base_path('.env')) &&
                file_exists(storage_path('app/installed')) &&
                Schema::hasTable('migrations');
        });
    }
744080
protected function loadThemes()
    {
        $themesDirs = array(
            __DIR__.'/../../data/themes/Ladybug/Theme',
            __DIR__.'/../../../ladybug-themes/Ladybug/Theme'
        );

        foreach ($themesDirs as $dir) {
            if (is_dir($dir)) {
                $finder = new Finder();
                $finder->in($dir)->files()->depth(1)->name('*Theme.php');

                foreach ($finder as $file) {
                    /** @var SplFileInfo $file */
                    $this->registerTheme($file);
                }
            }
        }
    }
813950
public function after_setup_theme(): void {

		foreach ( $this->event_configs as $config ) {
			$this->add_events( $config->get_events() );
		}
	}
1009300
protected function registerFacadesAliases(): void
    {
        $loader = AliasLoader::getInstance();

        foreach ((array) $this->facades as $facade => $aliases) {
            foreach ((array) $aliases as $alias) {
                $loader->alias($alias, $facade);
            }
        }
    }