Extension:FileSystemListing

The FileSystemListing extension provides an easy way to list filesystem contents on your webserver.

The initial intention was to easily map a link for each file provided for download on a website that uses MediaWiki as its backend, and render directory contents nicely inside an article called 'Downloads'.

The author hopes it will be useful, and also extended to provide more functionality

How to use
To use, simply put on your wiki page something like: For the Files/Directorys list:  note: fileprefix="test/sub" // will link to /wiki/test/sub/filename encoded="true" // requires name in urlencoded format, e.g. /var/www/ftp/shared/%23B%20Buchf%FChrung (to allow htmlspecial char in filenames)

for the DateTime of an file : ''' '''

The code
Here is the source code. If somebody has more time to see how can be added to the SVN repository, it'll be nice! See below for Modifications to the use of jQuery expansible tree

Use with FCKEditor
I have noticed that FCKEditor alters some HTML tags as they are entered. This proved to be the case with the custom tag, where the dir="" would be removed.

By replacing $dir = $argv['dir']; with $dir = $argv['name'];

in the function function renderDirList( $input, $argv ) above, FCKeditor allows the argument in the tag to be preserved.

Usage then changes to .

Using jQuery to build collapsable directory tree with icons
Starting from http://homework.nwsnet.de/releases/ea21/#turn-nested-lists-into-a-collapsible-tree-with-jquery one may add a jquery feature to the extension. This Add-On gives the possibility to descent into the filestructure dynamically, compare Screenshot from http://homework.nwsnet.de/releases/ea21/jquery-tree.png.

Since jQuery is not integrated in <1.17, the following only tested in MediaWiki 1.19.

 in your wiki installation, create the path  and place the full code above in some file.  create further directories and the files extensions/FileSystemListing/modules/ext.FileSystemListing.css extensions/FileSystemListing/modules/ext.FileSystemListing.js and place the out-of-the-box icons  and   from http://www.famfamfam.com/lab/icons/silk/ , published under Creative Commons Attribution 2.5 License, in wiki/extensions/FileSystemListing/modules/images/  next, you have to add code as needed and described by http://homework.nwsnet.de/releases/ea21/#turn-nested-lists-into-a-collapsible-tree-with-jquery. For the stylesheet, add  and for the Javascript add  Finally, you have to modify the extension by writing some code to add the resource module. Modify the code above (the original extension), that you already saved in, by adding the js/css files via the extra code directly in the definitions part, e.g. before the. Next, add the module via placing somewhere in the initializing code, that is, in  immediately at the beginning. May also be placed in a bit more global context, but this should reveal better performance if the extension is not embedded on every wiki site...   last, we have to fix some errors and "beauty aspects". Using non standard encoded file system requires minor changes as follows, but most important is that the javascript requires really nested uls, so we do best rewriting the whole: </li> Enjoy! And, of course, don't forget to  the extension in your  ! </li> If you want to restrict the file system listing to specific directories add absolute directory paths in  file </li> </ol>