Get Array of Themes

@param none
@return 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');
    }
1004064
public function listThemeNames($onlyEnabled = false)
    {
        $themes = $this->all($onlyEnabled);
        $themeNames = [];

        /** @var Theme $theme */
        foreach ($themes as $theme) {
            $themeNames[$theme->getNormalizedName()] = $theme->getName();
        }

        return $themeNames;
    }
1139525
private function getThemeDirs(ContainerBuilder $container, array $themeList): array
    {
        $paths = array_map(
            static function (array $bundleMetadata): string {
                return $bundleMetadata['path'] . '/Resources/views/ngbm/themes';
            },
            // Reversing the list of bundles so bundles added at end have higher priority
            // when searching for a template
            array_reverse($container->getParameter('kernel.bundles_metadata'))
        );

        $paths = array_values(array_filter($paths, 'is_dir'));

        if ($container->hasParameter('twig.default_path')) {
            $defaultTwigDir = $container->getParameterBag()->resolveValue($container->getParameter('twig.default_path')) . '/ngbm/themes';
            if (is_dir($defaultTwigDir)) {
                array_unshift($paths, $defaultTwigDir);
            }
        }

        $appDir = $this->getAppDir($container) . '/Resources/views/ngbm/themes';
        if (is_dir($appDir)) {
            array_unshift($paths, $appDir);
        }

        $themeDirs = [];
        foreach ($paths as $path) {
            foreach ($themeList as $themeName) {
                $themeDirs[$themeName][] = $path . '/' . $themeName;
            }
        }

        return $themeDirs;
    }
845382
private function get_themes( $themes_list, $preferences ) {
		$list = array();
		foreach ( $themes_list as $slug => $nicename ) {
			$theme = $this->call_theme_api( $slug );
			if ( ! $theme ) {
				continue;
			}

			$url = add_query_arg(
				array(
					'theme' => $theme->slug,
				),
				network_admin_url( 'theme-install.php' )
			);

			$name = empty( $nicename ) ? $theme->name : $nicename;

			$theme->custom_url  = $url;
			$theme->custom_name = $name;

			$list[] = $theme;
		}

		return $list;
	}
272828
def get_themes_directory(theme_name=None, png=False):
    """"""
    dir_themes = os.path.join(get_file_directory(), "themes")
    if theme_name is None:
        return dir_themes
    if theme_name in os.listdir(dir_themes):
        return dir_themes
    dir = "png" if png is True else "gif"
    return os.path.join(get_file_directory(), dir)
1316040
function getThemeFiles({ brand, affiliate }) {
  return [
    path.join(__dirname, '/themes/_default.yaml'),
    path.join(__dirname, `/themes/${brand}/_default.yaml`),
    path.join(__dirname, `/themes/${brand}/${affiliate.toUpperCase()}/_default.yaml`)
  ].filter(fs.existsSync);
}
834157
public static function getConfig($themeDirectory)
    {
        $getConfigValues = [];

        // make absolute path work
        if(is_dir($themeDirectory)) {
            $path = $themeDirectory.'/config.json';
        }else{
            $path = base_path()."/themes/".$themeDirectory.'/config.json';
        }

        if(file_exists($path)) {
            $getConfigValues = json_decode(file_get_contents($path), true);
            if(!is_array($getConfigValues)) {
                throw new \Exception("It seems like your theme ".$path." is not well formatted!");
            }
        }

        return $getConfigValues;
    }
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;
    }
360233
public function getInstalledThemes(): array
    {
        $installed = $this->cache->get($this->cacheKey);

        if ($installed !== null) {
            return $installed;
        }

        return $this->findAndInstallThemes();
    }
1252623
def list_themes(dark=True):
    """"""
    dark = "dark" if dark else "light"
    themes = os.scandir(os.path.join(MODULE_DIR, "colorschemes", dark))
    return [t for t in themes if os.path.isfile(t.path)]
441760
public function getAvailableThemePaths()
    {
        $paths      = [];
        $themePaths = $this->getThemePaths();

        foreach ($themePaths as $path) {
            $this->files->isDirectory(base_path($path)) && $paths[] = base_path($path);
        }

        return $paths;
    }
722724
public function getTheme($themeId, $fields = ['name', 'slug', 'url'])
    {
        $apiUrl = $this->getEndpoint('themes');
        $apiUrl .= $themeId;

        $params = array(
            'fields' => implode(',', $fields)
        );

        $apiData = $this->apiGet($apiUrl, $params);

        return $this->decodeSingle($apiData);
    }
201732
public function getAllowedThemesOptionList()
    {
        $ret = [];
        $all = list_themes();

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

        return $ret;
    }
550660
protected function getOptions()
	{
		$path = base_path($this->config->get('theme.themeDir'));

		return array(
			array('path', null, InputOption::VALUE_OPTIONAL, 'Path to theme directory.', $path),
			array('facade', null, InputOption::VALUE_OPTIONAL, 'Facade name.', null),
		);
	}
746559
protected function getListThemeStore()
    {
        $themes = $this->module->getByType('theme', true);
        unset($themes[$this->theme_backend]);

        return $themes;
    }
530383
protected function getFrontendThemesSettings()
    {
        $themes = $this->module->getByType('theme', true);
        unset($themes[$this->theme_backend]);
        return $themes;
    }
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;
	}