/** * Initializes and run theme feature. */ public function run() { if (false == $this->settings || !isset($this->settings['options'])) { return; } $theme = null; $selected = $this->defineSelectedThemeName($this->app->getSite()); foreach (ThemeTool::getThemesFromOptions($this->settings['options']) as $name => $obj) { if ($name === $selected) { $theme = $obj; } } $this->initializeTheme($theme); }
/** * Returns an array that contains every declared theme. * * @return array */ protected function getThemes() { $config = $this->app->getConfig()->getThemesConfig(); if (!is_array($config) || !isset($config['options']) || false == $config['options']) { $output->writeln("<info>No theme to install.</info>"); exit(0); } return ThemeTool::getThemesFromOptions($config['options']); }