Get the folder list.

This is limited to the folders in the root folder.

@return array of folders.
437223
protected function get_folder_list() {
        if (empty($this->folders)) {
            $folders = array();
            $result = $this->boxclient->get_folder_items();
            foreach ($result->entries as $item) {
                if ($item->type != 'folder') {
                    continue;
                }
                $folders[$item->id] = $item->name;
                if (!empty($item->shared)) {
                    $folders[$item->id] .= ' (' . get_string('sharedfolder', 'portfolio_boxnet') . ')';
                }
            }
            $this->folders = $folders;
        }
        return $this->folders;
    }
1047143
public static function getFolders($root)
    {
        $iterator = new RecursiveIteratorIterator(
            new RecursiveDirectoryIterator($root, RecursiveDirectoryIterator::SKIP_DOTS),
            RecursiveIteratorIterator::SELF_FIRST,
            RecursiveIteratorIterator::CATCH_GET_CHILD // Ignore "Permission denied"
        );

        $paths = [
            $root,
        ];

        foreach ($iterator as $path => $dir) {
            if (true === $dir->isDir()) {
                $paths[] = $path;
            }
        }

        return $paths;
    }
1266387
public function getAllRoots()
    {
        $roots = [];
        foreach ($this->filesystems->keys() as $ident) {
            $disk = $this->getNamedRoot($ident);
            if ($disk !== null) {
                $roots[$ident] = $disk;
            }
        }

        return $roots;
    }
926250
private function _getRoots()
    {
        $directories = [];

        if (is_string($this->module->root)) {
            $root = Yii::getAlias($this->module->root);
            if ($this->module->scanRootParentDirectory) {
                $root = dirname($root);
            }

            $directories[] = $root;
        } elseif (is_array($this->module->root)) {
            foreach ($this->module->root as $root) {
                $directories[] = Yii::getAlias($root);
            }
        } else {
            throw new InvalidConfigException('Invalid `root` option value!');
        }

        return $directories;
    }
885839
public function getParentDirectories()
    {
        if ($this->isCurrentDirectoryBase()) {
            return [];
        }

        $currentDir = $this->currentDir;
        $dirs = [];
        do {
            $dir = dirname($currentDir);
            $dirs[] = $this->getPathRelativeToBaseDir($dir)
                ?: DIRECTORY_SEPARATOR;
            $currentDir = $dir;
        } while ($dir !== $this->baseDir);

        return array_reverse($dirs);
    }
883080
public function folderContent()
    {
        $result = [];
        $path = $this->ensureUserPath($this->blob->path);

        $list = collect($this->storage->getDriver()->listContents($path))
            ->pluck('path');

        $exclude = (new ThumbService($this->package))->getSizes()->all();
        $isExcluded = function ($path) use ($exclude) {
            $parts = explode('/', Str::normalizePath($path));
            if (count($parts) > 0) {
                return array_key_exists($parts[0], $exclude);
            }

            return false;
        };

        $list->each(function ($glob) use (&$result, $isExcluded) {
            if ($isExcluded($glob)) {
                // skip any thumbs dir and do not show it for users
                return;
            }

            $result[] = (new Blob($this->package))
                ->setPath($glob)
                ->fullDetails();
        });

        return $result;
    }
441669
public function getCategoriesList()
    {
        $list = [];
        
        foreach($this->Categories() as $cat) {
            $list[] = $cat->FullHierarchy;
        }

        return implode(", ", $list);
    }
59925
public function getFileList()
    {
        $files = new Filesystem;
        return array_map(function (SplFileInfo $file) {
            return $file->getRelativePathname();
        }, $files->allFiles($this->stubDirectory));
    }
723143
public function getFiles()
    {
        if (isset($this->raw->files)) {
            $base = $this->getBasePath();
            $files = array();

            foreach ((array) $this->raw->files as $file) {
                $file = new SplFileInfo(
                    $path = $base . DIRECTORY_SEPARATOR . Path::canonical($file)
                );

                if (false === $file->isFile()) {
                    throw new RuntimeException(
                        sprintf(
                            'The file "%s" does not exist or is not a file.',
                            $path
                        )
                    );
                }

                $files[] = $file;
            }

            return $files;
        }

        return array();
    }
940063
public function getList()
    {
        $list = glob($this->basePath . "/*.md");
        foreach ($list as $key=>$item) {
            $item = pathinfo($item);
            $item = $item['filename'];
            $item = preg_split("/^[\d-]+/", $item, 2, PREG_SPLIT_NO_EMPTY);
            $list[$key] = ucfirst(str_replace('-',' ',$item[0]));
        }

        return $list;
    }
223690
protected function getCurrentFolderPermissions()
    {
        if ($this->currentFolderPermissions === null) {
            $folder = $this->getCurrentFolder();
            if ($folder === null) {
                $folder = $this->app->make(Filesystem::class)->getRootFolder();
                if ($folder === null) {
                    $folder = new FileFolder();
                }
            }
            $this->currentFolderPermissions = new Checker($folder);
        }

        return $this->currentFolderPermissions;
    }
1192760
public function getFiles()
    {
        if (empty($this->files)) {
            foreach ($this->path as $path) {
                if (is_dir($path)) {
                    $this->files = array_merge($this->files, $this->getFilesFromDir($path));
                } elseif (is_file($path)) {
                    $this->files[$path] = new SplFileInfo($path, $path, $path);
                }
            }
        }

        return $this->files;
    }
1361613
public function getTree(): array
    {
        $tree = [];
        $size = count($this->segments);

        for ($index = 0; $index < $size; $index = $index + 1) {
            $temp = array_slice($this->segments, 0, $index + 1);
            $path = implode(DIRECTORY_SEPARATOR, $temp);

            $tree[] = Path::normalize($path);
        }

        return $tree;
    }
1137662
public function allDirectories()
    {
        $directories = $this->disk->allDirectories('/');

        return collect($directories)->filter(function ($directory) {
            return !(starts_with($directory, '.'));
        })->map(function ($directory) {
            return DIRECTORY_SEPARATOR.$directory;
        })->reduce(function ($allDirectories, $directory) {
            $parts = explode('/', $directory);
            $name = str_repeat('&nbsp;', (count($parts)) * 4).basename($directory);

            $allDirectories[$directory] = $name;

            return $allDirectories;
        }, collect())->prepend($this->breadcrumbRootLabel, '/');
    }
1214916
public function getAllCategoryTreesAsArray()
    {
        $rootIds = $this->getAllRootIds();

        $trees = array();
        foreach ($rootIds as $rootId) {
            $trees[$rootId] = $this->getCategoryTreeAsArray($rootId);
        }

        return $trees;
    }
260823
public function getAllDirectories(): array
    {
        $directories = [];

        foreach ($this->filesystem->listContents('/'.$this->path) as $info) {
            $id = $info['filename'];

            if ($this->hasDirectory($id)) {
                $directories[$id] = $this->getDirectory($id);
            }
        }

        return $directories;
    }
37094
def folders(self):
        ''''''
        if self._folders is None :
            self.__init()
        if self._folders is not None and isinstance(self._folders, list):
            if len(self._folders) == 0:
                self._loadFolders()
        return self._folders