@author Leo Fajardo (@leorw)
@since  2.0.2

@param array $prepared_themes

@return array
489187
function change_theme_update_info_html( $prepared_themes ) {
            $theme_basename = $this->_fs->get_plugin_basename();

            if ( ! isset( $prepared_themes[ $theme_basename ] ) ) {
                return $prepared_themes;
            }

            $themes_update = get_site_transient( 'update_themes' );
            if ( ! isset( $themes_update->response[ $theme_basename ] ) ||
                empty( $themes_update->response[ $theme_basename ]['package'] )
            ) {
                return $prepared_themes;
            }

            $prepared_themes[ $theme_basename ]['update'] = preg_replace(
                '/(\<p.+>)(.+)(\<a.+\<a.+)\.(.+\<\/p\>)/is',
                '$1 $2 ' . $this->_fs->version_upgrade_checkout_link( $themes_update->response[ $theme_basename ]['new_version'] ) .
                '$4',
                $prepared_themes[ $theme_basename ]['update']
            );

            // Set to false to prevent the "Update now" link for the context theme from being shown on the "Themes" page.
            $prepared_themes[ $theme_basename ]['hasPackage'] = false;

            return $prepared_themes;
        }
500983
public function sectionTemplates()
	{
		Eresus_Kernel::app()->getPage()->title .= ADM_T_DIV.ADM_THEMES_TEMPLATES;

		$result = '';
		switch (arg('action'))
		{
			case 'update':
				$this->sectionTemplatesUpdate();
				break;
			case 'insert':
				$this->sectionTemplatesInsert();
				break;
			case 'add':
				$result = $this->sectionTemplatesAdd();
				break;
			default:
				if (arg('delete'))
				{
					$this->sectionTemplatesDelete();
				}
				elseif (arg('id'))
				{
					$result = $this->sectionTemplatesEdit();
				}
				else
				{
					$result = $this->sectionTemplatesList();
				}
		}
		return $result;
	}
666769
public function getModules()
    {
        $arrModules = [];
        $objModules = $this->Database->execute("SELECT m.id, m.name, t.name AS theme FROM tl_module m LEFT JOIN tl_theme t ON m.pid=t.id ORDER BY t.name, m.name");

        while ($objModules->next())
        {
            $arrModules[$objModules->theme][$objModules->id] = $objModules->name . ' (ID ' . $objModules->id . ')';
        }

        return $arrModules;
    }
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();
    }
317156
public function getActiveThemesList()
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();

        $activeThemeList = [];
        if (!$this->isAdmin()) {
            $activeThemeList[] = $config->getConfigParam('sTheme');

            if ($customThemeId = $config->getConfigParam('sCustomTheme')) {
                $activeThemeList[] = $customThemeId;
            }
        }

        return $activeThemeList;
    }
467840
protected function prepare_per_region_arrays() {
        $result = array();
        foreach ($this->regions as $region => $notused) {
            $result[$region] = array();
        }
        return $result;
    }
226374
public function getActiveThemes()
    {
        $themes = &gplcart_static('module.active.themes');

        if (isset($themes)) {
            return $themes;
        }

        $themes = array($this->config->get('theme_backend', 'backend'));

        if (!$this->db->isInitialized()) {
            return $themes;
        }

        $stores = $this->db->fetchAll('SELECT * FROM store', array());

        foreach ($stores as $store) {
            $data = unserialize($store['data']);
            foreach ($data as $key => $value) {
                if (strpos($key, 'theme') === 0) {
                    $themes[] = $value;
                }
            }
        }

        return $themes;
    }
1090209
public function getDefaultAllowedThemesOptionList()
    {
        $ret = [];
        $all = list_themes();

        foreach ($this->getDefaultAllowedThemes() as $theme) {
            if (isset($all[$theme])) {
                $ret[$theme] = $all[$theme]->info['name'];
            } else {
                $ret[$theme] = "oups";
            }
        }

        return $ret;
    }
792556
public function getEditorThemeOptions()
    {
        $themeDir = new DirectoryIterator("modules/backend/formwidgets/codeeditor/assets/vendor/ace/");
        $themes = [];

        // Iterate through the themes
        foreach ($themeDir as $node) {

            // If this file is a theme (starting by "theme-")
            if (!$node->isDir() && substr($node->getFileName(), 0, 6) == 'theme-') {
                // Remove the theme- prefix and the .js suffix, create an user friendly and capitalized name
                $themeId = substr($node->getFileName(), 6, -3);
                $themeName = ucwords(str_replace("_", " ", $themeId));

                // Add the values to the themes array
                if ($themeId != static::DEFAULT_THEME) {
                    $themes[$themeId] = $themeName;
                }
            }

        }

        // Sort the theme alphabetically, and push the default theme
        asort($themes);
        return [static::DEFAULT_THEME => ucwords(static::DEFAULT_THEME)] + $themes;
    }
108260
protected function getThemesConfig()
    {
        $config = $this->serviceLocator->get('config');

        $myConfig = $config['Rcm'];

        if (empty($myConfig['themes'])) {
            return [];
        }

        return $myConfig['themes'];
    }
545813
public function setFormTheme($themes)
    {
        $themes = is_array($themes) ? $themes : [$themes];
        $this->formThemes = array_merge($this->formThemes, $themes);

        return $this;
    }
1226657
public function getThemeCustomizableStylePresets()
    {
        $presets = [];
        $env = Environment::get();
        if ($this->isThemeCustomizable()) {
            $directory = $env->getPath(
                DIRNAME_THEMES.'/'.$this->getThemeHandle(
                ).'/'.DIRNAME_CSS.'/'.DIRNAME_STYLE_CUSTOMIZER_PRESETS,
                $this->getPackageHandle()
            );
            $urlroot = $env->getURL(
                DIRNAME_THEMES.'/'.$this->getThemeHandle().'/'.DIRNAME_CSS,
                $this->getPackageHandle()
            );
            $dh = Loader::helper('file');
            $files = $dh->getDirectoryContents($directory);
            foreach ($files as $f) {
                if (strrchr($f, '.') == static::THEME_CUSTOMIZABLE_STYLESHEET_EXTENSION) {
                    $preset = Preset::getFromFile($directory.'/'.$f, $urlroot);
                    if (is_object($preset)) {
                        $presets[] = $preset;
                    }
                }
            }
        }
        usort(
            $presets,
            function ($a, $b) {
                if ($a->isDefaultPreset()) {
                    return -1;
                } else {
                    return strcasecmp($a->getPresetDisplayName('text'), $b->getPresetDisplayName('text'));
                }
            }
        );

        return $presets;
    }
933962
public function get_parent_themes($theme_name)
	{
		$return = array($this->create_theme_array($theme_name));
		$theme_info = $this->load_info($theme_name);

		if ( ! empty($theme_info['parent']))
		{
			$return = array_merge($return, $this->get_parent_themes($theme_info['parent']));
		}
		elseif($theme_name !== $this->fallback['name'])
		{
			$return[] = $this->fallback;
		}

		return $return;
	}
35763
public function all() : array
    {
        if ($this->themes !== null) {
            return $this->themes;
        }

        return $this->themes = $this->load();
    }
611377
public static function load_theme_files( $directory, $exclude_underscore = false ) {
		if ( ! is_dir( $directory ) ) {
			return;
		}

		$files = static::get_include_files( $directory, $exclude_underscore );

		foreach ( $files['files'] as $file ) {
			$file = realpath( $file );
			$file = str_replace( realpath( get_template_directory() ), '', $file );
			$file = str_replace( realpath( get_stylesheet_directory() ), '', $file );
			$file = get_theme_file_path( $file );
			include_once( $file );
		}

		foreach ( $files['directories'] as $directory ) {
			static::load_theme_files( $directory, $exclude_underscore );
		}
	}
906957
public static function get_themes()
    {
        $default = [self::PUBLIC_THEME, self::DEFAULT_THEME];

        if (!SSViewer::config()->uninherited('theme_enabled')) {
            return $default;
        }

        // Explicit list is assigned
        $themes = static::$current_themes;
        if (!isset($themes)) {
            $themes = SSViewer::config()->uninherited('themes');
        }
        if ($themes) {
            return $themes;
        }

        // Support legacy behaviour
        if ($theme = SSViewer::config()->uninherited('theme')) {
            return [self::PUBLIC_THEME, $theme, self::DEFAULT_THEME];
        }

        return $default;
    }
950561
private function prepareMessages()
    {
        $prepared = [];

        foreach ($this->messages as $key => $msg) {
            $prepared[(string)$key] = $msg;
        }

        $this->messages = $prepared;
    }