File manager module for Nailblog-2 by Martin Wikström
http://www.waxjism.org/nail/

Content ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

User documentation
 * About
 * Administration
 * Usage

API documentation
 * File formats
 * PHP functions
 * PHP variables
 * JavaScript functions

About ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

This module provides adds a file manager to Nailblog2 where
users can upload, download, view, and manage files. The access
privileges can be set for each file and folder separately.

Administration ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Initially only admin and fileadmin has access to the
filemanager. Access is given to other users by modifying the
access privileges for individual files and folders.

See Usage for more information on file management.

The toolbox on the Admin page provides only the possibility of
disabling thumbnails or changing the thumbnail size.

Usage ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The file manager is browsed by going to page ?act=file.

The folder tree is browsed by clicking on the folder names. You
can only see the content of a folder if you have read access
rights to said folder. You need write access to a folder in
order to upload files to it and create new folders in it. You
need modify access for a file or folder in order to rename it
or change its attributes.

Creating a folder:
 * If you are inside a folder to which you have write access
   you can create a new folder there by typing the folders name
   into the textbox and then clicking the "Create folder"
   button.

Uploading a file:
 * If you are inside a folder to which you have write access
   you can upload a new file by clicking the "Browse" button,
   selecting the file you'd like to upload, and then clicking
   the "Upload" button.
 * Note that you can't upload larger files than what is defined
   by the server and noted beside the "Upload" button.

Modifying files and folder:
 * By clicking "select" next to files and folders you can select
   which files and folders you'd like to modify. When at least
   one item is selected a toolbar appears under the list. Click
   on the "Modify" button to go to the "Modify files and
   folders" page.
 * The following attributes can be modified:
    * File or folder name
      (This is only available if only one item is selected)
    * Groups
      Which groups the file or folder belongs to.
    * Read access
      Who may view a folders content or download a file.
    * Write access
      Who may create new folders and upload files to a folder.
    * Modify access
      Who has access to the "Modify files or folders" page.
    * Description
      A short text that is visible on the file info page.
       * Note that the description is language dependent. If you
         change it in one language nothing will change for the
         other languages.

Moving, deleting, and copying files and folders:
 * Files and folders are moved, copied, and deleted using the
   same toolbar as described in "Modifying files and folders".

File formats ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

file/index.php
 * This file contains a list of every file and folder and their
   settings.
 * First row: A php exit function and the version number.
 * Following rows: File and folder definitions.
 * File and folder definition (tab separated):
    * Id
    * Path
    * Name
    * Type (file or folder)
    * Owner
    * Groups
    * Access
       * Download
       * Upload
       * Modify/Delete
    * Description

file/index.[lang].php
 * Language specific descriptions with row numbers matching index.php
 * Each row:
    * Description

file/settings.php
 * This file contains the settings for the file manager module.
 * One item per row:
    * A php exit function and the version number.
    * Use thumbnails (1 or 0)
    * Thumbnail width
    * Thumbnail height

PHP functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 * file_admin()
   File manager administration page

 * file_savesets()
   Update file manager settings

 * file_main()
   The file manager

 * file_mkdir()
   Create a folder

 * file_delete($step)
   Delete files or folders

 * file_chmod($step)
   Modify metadata for files and folders

 * file_move($step)
   Move files or folders

 * file_copy($step)
   Move files or folders

 * file_modify()
   Alters one or more files or folders

 * file_upload()
   Upload a file

 * file_rename()
   Rename a file or folder

 * file_getrow($entryid)
   Get row data including translation when available

 * file_info()
   Display information about a single file

 * file_view()
   View a file in the browser

 * file_download()
   Download a file

 * file_edit()
   Edit a text file

 * file_makethumb($fileid)
   Creates a thumbnail version of a file

 * file_thumb()
   Displays the thumbnail for a file

 * file_getsets($set)
   Returns a specific file manager related setting, or all

PHP variables ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 * $mod_file=true;
   Tells the Nailblog that the blog module is in use.
 
 * $file_version="2.0.2";
   Version the module is developed for
 
 * $file_mime=array(...);
   Supported mime types - each mime type = array:
    * File ending
    * Function
    * File mime
    * Link title

 * $file_settings=false;
   Temporary holder for settings data so it won't have to be
   loaded more than once

JavaScript functions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 * file_select(id)
   Marks an item as selected or not selected
   
 * file_action(act)
   Sumbits the action form
   
 * file_markchange(field)
   Marks a field as changed
   
 * file_tohere(path)
   Selects a target and posts the form

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
