concrete/src/Page/Theme/Theme.php
public static function getAvailableThemes($filterInstalled = true)
    {
        $db = Loader::db();
        $dh = Loader::helper('file');

        $themes = $dh->getDirectoryContents(DIR_FILES_THEMES);
        if ($filterInstalled) {
            // strip out themes we've already installed
            $handles = $db->GetCol('select pThemeHandle from PageThemes');
            $themesTemp = [];
            foreach ($themes as $t) {
                if (!in_array($t, $handles)) {
                    $themesTemp[] = $t;
                }
            }
            $themes = $themesTemp;
        }

        if (count($themes) > 0) {
            $themesTemp = [];
            // get theme objects from the file system
            foreach ($themes as $t) {
                $th = static::getByFileHandle($t);
                if (!empty($th)) {
                    $themesTemp[] = $th;
                }
            }
            $themes = $themesTemp;
        }

        return $themes;
    }
public static function getAvailableThemes($filterInstalled = true)
    {
        $db = Loader::db();
        $dh = Loader::helper('file');

        $themes = $dh->getDirectoryContents(DIR_FILES_THEMES);
        if ($filterInstalled) {
            // strip out themes we've already installed
            $handles = $db->GetCol('select pThemeHandle from PageThemes');
            $themesTemp = [];
            foreach ($themes as $t) {
                if (!in_array($t, $handles)) {
                    $themesTemp[] = $t;
                }
            }
            $themes = $themesTemp;
        }

        if (count($themes) > 0) {
            $themesTemp = [];
            // get theme objects from the file system
            foreach ($themes as $t) {
                $th = static::getByFileHandle($t);
                if (!empty($th)) {
                    $themesTemp[] = $th;
                }
            }
            $themes = $themesTemp;
        }

        return $themes;
    }
public static function getAvailableThemes ( $ filterInstalled = true ) { $ db = Loader :: db ( ) ; $ dh = Loader :: helper ( 'file' ) ; $ themes = $ dh -> getDirectoryContents ( DIR_FILES_THEMES ) ; if ( $ filterInstalled ) { // strip out themes we've already installed $ handles = $ db -> GetCol ( 'select pThemeHandle from PageThemes' ) ; $ themesTemp = [ ] ; foreach ( $ themes as $ t ) { if ( ! in_array ( $ t , $ handles ) ) { $ themesTemp [ ] = $ t ; } } $ themes = $ themesTemp ; } if ( count ( $ themes ) > 0 ) { $ themesTemp = [ ] ; // get theme objects from the file system foreach ( $ themes as $ t ) { $ th = static :: getByFileHandle ( $ t ) ; if ( ! empty ( $ th ) ) { $ themesTemp [ ] = $ th ; } } $ themes = $ themesTemp ; } return $ themes ; }
scans the directory for available themes. For those who don't want to go through the hassle of uploading.

@param bool $filterInstalled

@return static[]
scans the directory for available themes . For those who don t want to go through the hassle of uploading .