/** * Constructs a new file browser table * @param string $action URL where the table form should point to * @param zibo\filebrowser\model\Filebrowser $fileBrowser * @param zibo\library\filesystem\File $path The path to display in the table * @param string $directoryAction URL to the action behind a directory * @param string $fileAction URL to the action behind a file */ public function __construct($action, Filebrowser $fileBrowser, File $path = null, $directoryAction = null, $fileAction = null) { $this->fileBrowser = $fileBrowser; $paths = $fileBrowser->readDirectory($path); $directories = $fileBrowser->applyFilters($paths, array(new DirectoryFilter())); $files = $fileBrowser->applyFilters($paths, array(new DirectoryFilter(false))); unset($paths); parent::__construct($files, $directories, $action, self::NAME); $fileDecorator = new FileDecorator($fileBrowser); $fileDecorator->setDirectoryAction($directoryAction . ($path ? '/' . $path : '')); $fileDecorator->setFileAction($fileAction); $fileDecorator = new ZebraDecorator($fileDecorator); $this->addDecorator($fileDecorator); $translator = I18n::getInstance()->getTranslator(); $breadcrumbs = $this->getBreadcrumbs(); $breadcrumbs->setLabel($translator->translate(self::TRANSLATION_NAVIGATION)); $breadcrumbs->addBreadcrumb($directoryAction, $translator->translate(self::TRANSLATION_NAVIGATION_HOME)); $this->addBreadcrumbs($breadcrumbs, $directoryAction, $path); }