Call theme messaging for single site installation.

@author Seth Carstens

@param array $prepared_themes

@return mixed
967305
public function customize_theme_update_html( $prepared_themes ) {
		foreach ( (array) $this->config as $theme ) {
			if ( empty( $prepared_themes[ $theme->slug ] ) ) {
				continue;
			}

			if ( ! empty( $prepared_themes[ $theme->slug ]['hasUpdate'] ) ) {
				$prepared_themes[ $theme->slug ]['update'] = $this->append_theme_actions_content( $theme );
			} else {
				$prepared_themes[ $theme->slug ]['description'] .= $this->append_theme_actions_content( $theme );
			}
			if ( ! $theme->release_asset ) {
				$prepared_themes[ $theme->slug ]['description'] .= $this->single_install_switcher( $theme );
			}
		}

		return $prepared_themes;
	}
490204
public function get_remote_theme_meta() {
		$themes = [];
		foreach ( (array) $this->config as $theme ) {
			/**
			 * Filter to set if WP-Cron is disabled or if user wants to return to old way.
			 *
			 * @since  7.4.0
			 * @access public
			 *
			 * @param bool
			 */
			if ( ! $this->waiting_for_background_update( $theme ) || static::is_wp_cli()
				|| apply_filters( 'github_updater_disable_wpcron', false )
			) {
				$this->get_remote_repo_meta( $theme );
			} else {
				$themes[ $theme->slug ] = $theme;
			}

			/*
			 * Add update row to theme row, only in multisite.
			 */
			if ( is_multisite() ) {
				add_action( 'after_theme_row', [ $this, 'remove_after_theme_row' ], 10, 2 );
				if ( ! $this->tag ) {
					add_action( "after_theme_row_{$theme->slug}", [ $this, 'wp_theme_update_row' ], 10, 2 );
					if ( ! $theme->release_asset ) {
						add_action( "after_theme_row_{$theme->slug}", [ $this, 'multisite_branch_switcher' ], 15, 2 );
					}
				}
			}
		}

		$schedule_event = defined( 'DISABLE_WP_CRON' ) && DISABLE_WP_CRON ? is_main_site() : true;

		if ( $schedule_event ) {
			if ( ! wp_next_scheduled( 'ghu_get_remote_theme' ) &&
			! $this->is_duplicate_wp_cron_event( 'ghu_get_remote_theme' ) &&
			! apply_filters( 'github_updater_disable_wpcron', false )
			) {
				wp_schedule_single_event( time(), 'ghu_get_remote_theme', [ $themes ] );
			}
		}

		if ( ! static::is_wp_cli() ) {
			$this->load_pre_filters();
		}
	}
1216106
protected function loadViewsFromTheme(Theme $theme)
    {
        $views = $theme->getViewDirectory();

        $this->loadViewsFrom($views, $theme->getName());
        $this->loadViewsFrom($views.'/boomcms', 'boomcms');
        $this->loadViewsFrom($views.'/chunks', 'boomcms.chunks');
    }
1003822
public function getAllowedThemes()
    {
        $event = new AllowListEvent(AllowListEvent::THEMES, variable_get('ucms_site_allowed_themes', []));
        $this->dispatcher->dispatch(AllowListEvent::EVENT_THEMES, $event);

        return $event->getAllowedItems();
    }
494557
public function getThemes()
    {
        $json = $this->container->json;

        if (null === $definition = $json->getJson(ROOT_DIR . 'structure/definitions/themes.json', 'themes')) {
            throw new Exception('PitonCMS: Get themes exception: ' . implode($json->getErrorMessages(), ','));
        }

        return array_column($definition->themes, 'name', 'value');
    }
1246402
public function setOverride($theme = null) : ?Theme
    {
        if ($theme === null) {
            return $this->override = null;
        }

        if ($theme instanceof Theme) {
            $this->override = $theme;
        } elseif ($this->has($theme)) {
            $this->override = $this->get($theme);
        }

        if ($this->override === null || ($this->override !== null && !$this->override->verified())) {
            $this->override = $this->default;
        }

        return $this->override;
    }
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();
				}
			}
		}
	}
715577
public function render_ignored_themes() {
		$themes = array_map( function( $value ) {
			return [
				'name' => $value->display( 'Name' ),
				'slug' => $value->get_stylesheet(),
			];
		}, wp_get_themes() );

		echo $this->template->render( 'options/ignored-packages.php', [ // WPCS: XSS OK.
			'ignored_packages' => $this->options->ignored_themes,
			'packages' => $themes,
			'type' => 'themes',
		] );
	}
673448
public static function setup_notifications() {
		$notifications       = apply_filters( 'themeisle_sdk_registered_notifications', [] );
		$notifications       = array_filter(
			$notifications,
			function ( $value ) {
				if ( ! isset( $value['id'] ) ) {
					return false;
				}
				if ( get_option( $value['id'], '' ) !== '' ) {
					return false;
				}

				return apply_filters( $value['id'] . '_should_show', true );
			}
		);
		self::$notifications = $notifications;
	}
749482
public function get($themeId, array $params = array())
    {
        $endpoint = '/admin/themes/'.$themeId.'.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(Theme::class, $response['theme']);
    }
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;
    }
408080
public function theme($theme = null)
    {
        if ($theme === null) {
            return isset($this->_data['theme']) ? $this->_data['theme'] : '';
        }
        $this->_data['theme'] = $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;
    }
878831
public function main()
    {
        $this->out(__d('installer', '<info>Themes Shell</info>'));
        $this->hr();
        $this->out(__d('installer', '[1] Install new theme'));
        $this->out(__d('installer', '[2] Remove an existing theme'));
        $this->out(__d('installer', '[3] Change site theme'));
        $this->out(__d('installer', '[H]elp'));
        $this->out(__d('installer', '[Q]uit'));

        $choice = (string)strtolower($this->in(__d('installer', 'What would you like to do?'), ['1', '2', '3', 'H', 'Q']));
        switch ($choice) {
            case '1':
                $this->_install();
                break;
            case '2':
                $this->_uninstall();
                break;
            case '3':
                $this->_change();
                break;
            case 'h':
                $this->out($this->OptionParser->help());
                break;
            case 'q':
                return $this->_stop();
            default:
                $this->out(__d('installer', 'You have made an invalid selection. Please choose a command to execute by entering 1, 2, 3, H, or Q.'));
        }
        $this->hr();
        $this->main();
    }
1200788
public function add(array $themes) {

        foreach($themes as $themeId => $label) {
            $prefixedId =  $this->getPrefixedThemeId($themeId);
            if($this->themeExists($prefixedId)) {
                continue;
            }
            $this->register($themeId, $label);
        }

        $this->logInfo('Item themes registered: ' . implode(',', array_keys($themes)));
        return true;
    }
1149750
public static function add_themes($themes = [])
    {
        $currentThemes = SSViewer::get_themes();
        $finalThemes = array_merge($themes, $currentThemes);
        // array_values is used to ensure sequential array keys as array_unique can leave gaps
        static::set_themes(array_values(array_unique($finalThemes)));
    }
410472
public function setTheme(string $theme)
    {
        if (!$this->isPathValid($theme)) {
            throw new NotFoundException('The theme cannot be found.');
        }

        $this->validateTheme($theme);

        $themeInfo = $this->getThemeInfo($theme);

        if (array_key_exists('parent', $themeInfo)) {
            $this->childTheme = $themeInfo;

            $this->setTheme($themeInfo['parent']);
        } else {
            $this->theme = $themeInfo;
        }
    }