1# Directory listing for Dokuwiki
2
3Specify a directory and this plugin will list all contained items and made them downloadable.
4
5This is mostly used for intranets.
6
7**Information #1:** This is still under development and not finished or secured.
8
9**Information #2:** Please be aware, that a wiki user can pick ANY directory on your maschine. I am not responsible for any problems.
10
11## Example
12
13![Image](example1.png?raw=true)
14
15## Requirements
16
17  * PHP >= 5.3
18  * PHP fileinfo extension
19
20## Usage
21
22````
23<directorylist: path="value" ignore="value" recursive="1" fileorder="asc">
24````
25
26### Path argument
27
28The path argument specifies the path which the directorylist plugin will list.
29
30This can be an unix or windows path. It can be absolute or relative.
31
32**Examples:**
33
34````
35<directorylist: path="./relative/path/in/dokuwiki">
36<directorylist: path="C:\Users\Public">
37````
38
39### Ingore argument
40
41You can ignore directories or files with the ignore argument.
42
43The ignore argument has to be a comma separated [shell pattern](http://www.php.net/manual/en/function.fnmatch.php).
44
45This argument is optional, the  value is empty.
46
47**Example:**
48
49````
50<directorylist: [...] ignore="*.pdf,*.js,specialfile.doc,some_*_files.xlsx">
51````
52
53### Recursive argument
54
55You can specify if you want to list your directory recursive or not.
56
57This argument is optional, the default value is: ``true``.
58
59**Examples:**
60
61````
62<directorylist: [...] recursive="0">
63<directorylist: [...] recursive="1">
64````
65
66````
67<directorylist: [...] recursive="false">
68<directorylist: [...] recursive="true">
69````
70
71### Fileorder argument
72
73You can specify the order of files inside a directory.
74
75This argument is optional, the default value is: ``asc``.
76
77**Examples:**
78
79````
80<directorylist: [...] fileorder="asc">
81<directorylist: [...] fileorder="desc">
82````
83
84### Type argument
85
86Adding a new 'type' option to the directorylist syntax to enable different types of href link.
87
88This allows 'direct' links using the file:// protocal.
89(NOTE: this will usually not be a good choice since most browsers, eg. Chrome, forbid the openning of file:// links from non-local pages)
90
91Also allows 'link' links that, using the absolute path and dokuwiki basedir, serve weblinks to content.
92(NOTE: assumes the data directory is reachable by your webserver. This is a big security issue!)
93
94Default option is 'download';
95
96**Examples:**
97
98````
99<directorylist: [...] type="download">
100<directorylist: [...] type="direct">
101<directorylist: [...] type="link">
102````
103
104## Styling
105
106You can style this plugin with the following elements:
107
108  * ``ul.directorylist``
109  * ``ul.directorylist li.file``
110  * ``ul.directorylist li.folder``
111
112## Information
113
114Author: Alexander Wenzel (alexander.wenzel.berlin@gmail.com)
115
116Plugin page: http://www.dokuwiki.org/plugin:directorylist
117
118Icons: [genericons.com](http://genericons.com)
119
120## Changelog
121
122* 0.2.1
123    * PHP7 compatibility
124    * changed default 'type' to 'download'
125* 0.2.0
126    * added 'type' argument