Return the themes that can be used with this subsite, as an array of themecode => description

@return array
493122
public function allowedThemes()
    {
        if ($themes = self::$allowed_themes) {
            return ArrayLib::valuekey($themes);
        }

        $themes = [];
        if (is_dir(THEMES_PATH)) {
            foreach (scandir(THEMES_PATH) as $theme) {
                if ($theme[0] == '.') {
                    continue;
                }
                $theme = strtok($theme, '_');
                $themes[$theme] = $theme;
            }
            ksort($themes);
        }
        return $themes;
    }
72684
public function getThemesFromDb($default_theme=null)
	{
		$criteria = new CDbCriteria;
		if($default_theme != null)
			$criteria->compare('default_theme', $default_theme);
		$criteria->order = 'folder ASC';
		$themes = OmmuThemes::model()->findAll($criteria);
		
		return $themes;
	}
1316139
public function findAndInstallThemes(): array
    {
        $theme = new Theme();
        $directories = $this->filesystem->directories($theme->getThemesDirectory());
        $themes = [];

        if (is_array($directories)) {
            foreach ($directories as $directory) {
                $themeName = basename($directory);
                $themes[] = new Theme($themeName);
            }
        }

        $this->cache->forever($this->cacheKey, $themes);

        return $themes;
    }
284680
public function getAssets()
    {
        $css = $this->theme->getThemeInfoExtendAware('css');
        $js = $this->theme->getThemeInfoExtendAware('javascript');

        return [
            'css' => $css,
            'javascript' => $js,
        ];
    }
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;
    }
1165151
public function getThemesFromDir()
	{
		$themeList = array();
		$themePath = Yii::getPathOfAlias('webroot.themes');
		$themes    = scandir($themePath);
		foreach($themes as $theme) {
			$themeName = $this->urlTitle($theme);
			$themeFile = $themePath.'/'.$theme.'/'.$themeName.'.yaml';
			if(file_exists($themeFile)) {
				if(!in_array($themeName, $this->getIgnoreTheme())) {
					$themeList[] = $theme;
				}
			}
		}

		if(count($themeList) > 0)
			return $themeList;
		else
			return false;
	}
1263912
public function all()
    {
        $list = [];

        /** @var UniformResourceLocator $locator */
        $locator = $this->grav['locator'];

        $iterator = $locator->getIterator('themes://');

        /** @var \DirectoryIterator $directory */
        foreach ($iterator as $directory) {
            if (!$directory->isDir() || $directory->isDot()) {
                continue;
            }

            $theme = $directory->getFilename();
            $result = $this->get($theme);

            if ($result) {
                $list[$theme] = $result;
            }
        }
        ksort($list);

        return $list;
    }
9667
public function get_regions() {
        if (is_null($this->defaultregion)) {
            $this->page->initialise_theme_and_output();
        }
        return array_keys($this->regions);
    }
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();
		}
	}
359324
public static function getThemesForSelect()
    {
        if (!self::$_initialized) {
            self::init();
        }

        $results = [];
        foreach (self::$_themes as $theme) {
            $results[$theme->id()] = $theme->name();
        }

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

        return $this->themes = $this->load();
    }
535583
public static function get_top_level_templates()
	{

		$ss_templates_array = array();
		$current_theme_path = THEMES_PATH.'/'.Config::inst()->get('SSViewer', 'theme');

		//theme directories to search
		$search_dir_array = array(
			MAINTENANCE_MODE_PATH.'/templates',
			$current_theme_path.'/templates'
		);

		foreach ($search_dir_array as $directory) {

			//Get all the SS templates in the directory
			foreach (glob("{$directory}/*.ss") as $template_path) {

				//get the template name from the path excluding the ".ss" extension
				$template = basename($template_path, '.ss');

				//Add the key=>value pair to the ss_template_array
				$ss_templates_array[$template] = $template;
			}

		}

		return $ss_templates_array;

	}
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');
    }
1091756
protected function get_theme_meta() {
		$this->delete_current_theme_cache();
		$git_themes = [];
		$themes     = wp_get_themes( [ 'errors' => null ] );

		/**
		 * Filter to add themes not containing appropriate header line.
		 *
		 * @since   5.4.0
		 * @access  public
		 *
		 * @param array $additions Listing of themes to add.
		 *                         Default null.
		 * @param array $themes    Listing of all themes.
		 * @param         string        'theme'    Type being passed.
		 */
		$additions = apply_filters( 'github_updater_additions', null, $themes, 'theme' );

		foreach ( (array) $themes as $theme ) {
			$git_theme = [];

			foreach ( (array) static::$extra_headers as $value ) {
				$header   = null;
				$repo_uri = $theme->get( $value );

				/**
				 * Get $repo_uri from themes added to GitHub Updater via hook.
				 */
				foreach ( (array) $additions as $addition ) {
					if ( $theme->stylesheet === $addition['slug'] ) {
						if ( ! empty( $addition[ $value ] ) ) {
							$repo_uri = $addition[ $value ];
							break;
						}
					}
				}

				if ( empty( $repo_uri ) || false === stripos( $value, 'Theme' ) ) {
					continue;
				}

				$header_parts = explode( ' ', $value );
				$repo_parts   = $this->get_repo_parts( $header_parts[0], 'theme' );

				if ( $repo_parts['bool'] ) {
					$header = $this->parse_header_uri( $repo_uri );
					if ( empty( $header ) || $theme->stylesheet !== $header['repo'] ) {
						continue;
					}
				}

				$header         = $this->parse_extra_headers( $header, $theme, $header_parts, $repo_parts );
				$current_branch = "current_branch_{$header['repo']}";
				$branch         = isset( static::$options[ $current_branch ] )
					? static::$options[ $current_branch ]
					: false;

				$git_theme['type']                    = 'theme';
				$git_theme['git']                     = $repo_parts['git_server'];
				$git_theme['uri']                     = "{$header['base_uri']}/{$header['owner_repo']}";
				$git_theme['enterprise']              = $header['enterprise_uri'];
				$git_theme['enterprise_api']          = $header['enterprise_api'];
				$git_theme['owner']                   = $header['owner'];
				$git_theme['slug']                    = $header['repo'];
				$git_theme['file']                    = "{$header['repo']}/style.css";
				$git_theme['name']                    = $theme->get( 'Name' );
				$git_theme['theme_uri']               = $theme->get( 'ThemeURI' );
				$git_theme['author']                  = $theme->get( 'Author' );
				$git_theme['local_version']           = strtolower( $theme->get( 'Version' ) );
				$git_theme['sections']['description'] = $theme->get( 'Description' );
				$git_theme['local_path']              = get_theme_root() . '/' . $git_theme['slug'] . '/';
				$git_theme['branch']                  = $branch ?: 'master';
				$git_theme['languages']               = $header['languages'];
				$git_theme['ci_job']                  = $header['ci_job'];
				$git_theme['release_asset']           = $header['release_asset'];
				$git_theme['broken']                  = ( empty( $header['owner'] ) || empty( $header['repo'] ) );

				break;
			}

			// Exit if not git hosted theme.
			if ( empty( $git_theme ) ) {
				continue;
			}

			$git_themes[ $git_theme['slug'] ] = (object) $git_theme;
		}

		return $git_themes;
	}
490667
public function getTheme()
    {
        $themeId = $this->getThemeIdFromThemeDetailsProviders();
        if (empty($themeId)) {
            $themeId = $this->getCurrentThemeId();
        }

        return $this->getThemeById($themeId);
    }
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;
    }
906507
protected function get_current_theme()
	{
		if ( ! $this->is_logged_in() ) {
			throw new \Exception( "You are not logged in" );
		}

		$this->getSession()->visit( $this->locatePath( $this->get_admin_url() . '/themes.php' ) );
		$page = $this->getSession()->getPage();
		$e = $page->find( 'css', ".theme.active" );
		if ( $e ) {
			$classes = preg_split( "/\s+/", trim( $e->getAttribute( "aria-describedby" ) ) );
			$theme = preg_replace( "/\-(name|action)$/", "", $classes[0] );
			if ( $theme ) {
				return $theme;
			}
		}

		throw new \Exception( "Maybe you don't have permission to get the current theme." );
	}