Filesystem tree navigator

THIS CONTRIB HASN’T BEEN TESTED WITH P4A 2.0!!

P4A_Filesystem_Navigator: tree filesystem esploration widget.

Do you need P4A_Filesystem_Navigator?

P4A_Filesystem_Navigator is really useful when you need to draw a tree navigation structure stored on a filesystem.

The tipical situation is when you’re managing a file repository (such as when creating photo galleries).

Features

  • directory creation
  • files upload
  • file/directory delete (only methods, not on web interface for security reasons)
  • file/directory natural case sorting
  • customizable error message for empty folders
  • preview link to open files (in a new window)

Screenshots

Without files in a folder:

With some files:

Sample code

$this->build("p4a_filesystem_navigator", "navigator");
$this->navigator->files->enablePreview(); // enable a preview link to open files
$this->navigator->files->no_files_message = "No files in this folder";
$this->navigator->folders->no_folders_message = "No folders";
$this->navigator->folders->collapse(); // If you want to open only the currently selected folder
 
$this->navigator->f_folders->setTitle("Folders");
$this->navigator->f_files->setTitle("Files");
$this->navigator->folders->create_folder_button->setValue("Create");
$this->navigator->files->upload_field->setLabel("Upload a file");

now you can anchor your P4A_Filesystem_Navigator in a P4A_Frame or where you want.

$this->frame->anchor($this->navigator);

Code reference

Download

Authors

 
filesystem-tree-navigator.txt · Last modified: 2007/04/07 05:41 by p4a
 
Creative Commons License Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki