/** * Setup of the resource * * @param string $path * @param bool $folder */ public function __construct($path, $folder = false, $back = false) { $this->path = $path; $this->name = $folder && $back ? '..' : FsFacade::extractName($path); $this->extension = FsFacade::extension($path); $this->folder = $folder; $this->back = $folder && $back; $this->thumb = $this->thumbUrl(); }
/** * Add files to the local item list * * @param array $items * @param string $field */ private function parseFiles($items, $field) { foreach ($items as $item) { $extension = FsFacade::extension($item); if ($this->allowed($extension, $field)) { $this->addItem(new Item($item)); } } }