source: branches/MootoolsFileManager-Update/plugins/MootoolsFileManager/mootools-filemanager/README.md @ 1302

Last change on this file since 1302 was 1302, checked in by gogo, 9 years ago

Updates to http://www.github.com/sleemanj/mootools-filemanager from GerHoblett?

http://www.github.com/GerHoblett/

Changes to said updates by gogo (sleemanj @ github)

Modifications to MootoolsFileManager? to work with those updates, some courtesy of GerHoblett?, some sleemanj

GerHoblett? provided a large diff which accomplished the goal in a quite different way. It has merit, however I have opted for a less-affecting path in so far as Xinha's "way" is concerned, namely, not splitting the config for a single plugin into several calls to backend config passing functions which seemed a little cumbersome.

Instead I take the option of using POST to send backend data around, at the minor expense of an extra round trip when displaying thumbnails (for each one). This could be reduced by checking for thumbnail existence and returning the thumbnail name directly in "onView" rather than the backend request to generate said thumbnail.

Still to do, is to make the preview pane thumbnail also work.


File size: 8.7 KB
Line 
1MooTools FileManager
2====================
3
4A filemanager for the web based on MooTools that allows you to (pre)view, upload and modify files and folders via your browser.
5
6![Screenshot](https://github.com/frozeman/mootools-filemanager/raw/master/screenshot.png)
7
8### Authors
9
10* [Christoph Pojer](http://cpojer.net)
11* [Fabian Vogelsteller](http://frozeman.de)
12* [Ger Hobbelt](http://hobbelt.com / http://hebbut.net)
13
14### Features
15
16* Browse through Files and Folders on your Server
17* Rename, Delete, Move (Drag&Drop), Copy (Drag + hold CTRL) and Download Files
18* View detailed Previews of Images, Text-Files, Compressed-Files or Audio Content
19* Nice User Interface ;)
20* Upload Files via FancyUpload (integrated Feature)
21* Option to automatically resize big Images when uploading
22* Use it to select a File anywhere you need to specify one inside your Application's Backend
23* Use as a FileManager in TinyMCE or CKEditor
24* Provides your client with the most possible convenience
25* Create galleries using the Gallery-Plugin
26* History and state management
27* Backend PHP support for mod_alias/mod_vhost_alias/otherwise nonlinear mapped filesystems
28* Auto-adjusts directory views, balancing performance and the amount of data shown, unsuring optimum user experience
29
30### Issues
31
32  - sometimes "illegal character (Error #2038) mootools-core-1.3.js (line 5015)" when uploading multiple files
33
34How to use
35----------
36
37### Demos
38
39* Open the "Demos/" folder and have fun
40
41### Installation
42
43* First you need to include the follwing scripts
44  * Source/FileManager.js
45  * Source/Uploader/Fx.ProgressBar.js
46  * Source/Uploader/Swiff.Uploader.js
47  * Source/Uploader.js
48  * Source/Gallery.js (if you want to create a gallery, see example in the Demos/index.html)
49  * Language/Language.en.js (or the language(s) do you need)
50
51* Then you need to modify the "Demos/manager.php" or "Demos/selectImage.php" to set up your upload folder etc
52* See the "Demos/index.html" for examples, but basically you need to do the following:
53
54      var myFileManager = new FileManager({
55        url: 'path/to/the/manager.php',
56        assetBasePath: '../Assets'
57      });
58      myFileManager.show();
59
60### Configurable Options
61
62Options
63
64* url: (string) The base url to a file with an instance of the FileManager php class (FileManager.php), without QueryString
65* assetBasePath: (string) The path to all images and swf files used by the filemanager
66* directory: (string, relative to the directory set in to the filemanager php class) Can be used to load a subfolder instead of the base folder
67* language: (string, defaults to *en*) The language used for the FileManager
68* selectable: (boolean, defaults to *false*) If true, provides a button to select a file
69* destroy: (boolean, defaults to *false*) Whether to allow deletion of files or not
70* rename: (boolean, defaults to *false*) Whether to allow renaming of files or not
71* download: (boolean, defaults to *false*) Whether to allow downloading of files or not
72* createFolders: (boolean, defaults to *false*) Whether to allow creation of folders or not
73* filter: (string) If specified, it reduces the shown and upload-able filetypes to these mimetypes. possible options are
74  * image: *.jpg; *.jpeg; *.bmp; *.gif; *.png
75  * video: *.avi; *.flv; *.fli; *.movie; *.mpe; *.qt; *.viv; *.mkv; *.vivo; *.mov; *.mpeg; *.mpg; *.wmv; *.mp4
76  * audio: *.aif; *.aifc; *.aiff; *.aif; *.au; *.mka; *.kar; *.mid; *.midi; *.mp2; *.mp3; *.mpga; *.ra; *.ram; *.rm; *.rpm; *.snd; *.wav; *.tsi
77  * text: *.txt; *.rtf; *.rtx; *.html; *.htm; *.css; *.as; *.xml; *.tpl
78  * application: *.ai; *.bin; *.ccad; *.class; *.cpt; *.dir; *.dms; *.drw; *.doc; *.dvi; *.dwg; *.eps; *.exe; *.gtar; *.gz; *.js; *.latex; *.lnk; *.lnk; *.oda; *.odt; *.ods; *.odp; *.odg; *.odc; *.odf; *.odb; *.odi; *.odm; *.ott; *.ots; *.otp; *.otg; *.pdf; *.php; *.pot; *.pps; *.ppt; *.ppz; *.pre; *.ps; *.rar; *.set; *.sh; *.skd; *.skm; *.smi; *.smil; *.spl; *.src; *.stl; *.swf; *.tar; *.tex; *.texi; *.texinfo; *.tsp; *.unv; *.vcd; *.vda; *.xlc; *.xll; *.xlm; *.xls; *.xlw; *.zip;
79* hideClose: (boolean, defaults to *false*) Whether to hide the close button in the right corner
80* hideOnClick: (boolean, defaults to *false*) When true, hides the FileManager when the area outside of it is clicked
81* hideOverlay: (boolean, defaults to *false*) When true, hides the background overlay
82* hideQonDelete: (boolean, defaults to *false*) When true, hides the Dialog asking 'are you sure' when you have clicked on any 'delete file/directory' button
83* listPaginationSize: (integer, defaults to *100*) When non-zero, add pagination, i.e. split the view of huge directories into pages of N items each (this speeds up rendering and interaction)
84* listPaginationAvgWaitTime: (integer, defaults to *2000*) When non-zero, enable adaptive pagination: strive to, on average, not to spend more than this number of milliseconds on rendering a directory view. This is a great help to adapt the view to match the power of your clients' machines.
85* propagateData: (object, defaults to *empty*) Specify extra elements, all of which will be sent with every request to the backend
86
87Options if Uploader is included
88
89* upload: (boolean, defaults to *true*)
90* uploadAuthData: (object, defaults to *empty*) Extra data to be send with the GET-Request of an Upload as Flash ignores authenticated clients
91* resizeImages: (boolean, defaults to *true*) Whether to show the option to resize big images or not
92
93Events
94
95* onComplete(path, file, legal_url, cur_dir, url): fired when a file gets selected via the "Select file" button
96* onModify(file): fired when a file gets renamed/deleted or modified in another way
97* onShow(): fired when the FileManager opens
98* onHide(): event fired when FileManager closes
99* onPreview(src): event fired when the user clicks an image in the preview
100* onDetails(json): event fired when an item is picked form the files list, supplies object (e.g. {width: 123, height:456} )
101* onHidePreview(): event fired when the preview is hidden (e.g. when uploading)
102
103Backend
104
105* See Assets/Connector/FileManager.php and Assets/Connector/FMgr4Alias.php for all available server-side options
106
107* Note that you can configure these items by changing the related PHP define:
108
109  - MTFM_THUMBNAIL_JPEG_QUALITY  (default: 75) the jpeg quality for the largest thumbnails (smaller ones are automatically done at increasingly higher quality to ensure they look good)
110
111  - MTFM_NUMBER_OF_DIRLEVELS_FOR_CACHE  (default: 1) the number of directory levels in the thumbnail cache; set to 2 when you expect to handle huge image collections.  Note that each directory level distributes the files evenly across 256 directories; hence, you may set this level count to 2 when you expect to handle more than 32K images in total -- as each image will have two thumbnails: a 48px small one and a 250px large one.
112
113### Custom Authentication and Authorization
114
115* As Flash and therefore the Uploader ignores authenticated clients[*] you need to specify your own authentication / session initialization. This is taken care of by FileManager itself, so you don't need to bother, except provide a tiny bit of custom code in the "UploadIsAuthorized_cb" callback function on the serverside, manually initializing and starting your session-based authentication.
116
117  [*] More specifically: Flash does not pass along any cookies of itself, hence the FileManager will place the cookies in the GET URI query section for extraction by the server.
118 
119* You may pass along additional (key, value) elements to the server during upload by adding those items in the 'uploadAuthData' options' section. These will all be passed along in the GET URL query section.
120
121* Any (key, value) elements included in the "propagateData" options' section are sent to the server as part of every request URI (action) and will show up in the $_GET[] array, where you can extract them.
122
123* FM now provides a server-side callback hook for each request so you can apply your own business logic to determine if a given (file or directory, user context) mix is indeed permitted to be viewed / detailed / thumbnailed / uploaded / created / deleted / moved / renamed / copied / downloaded.
124
125  These hooks can be configured as part of the server-side options for the Backend/FileManager instance. For more info and a sample see the Demos/manager.php and Demos/selectImage.php files.
126
127  Server-side authorization hooks:
128
129  * UploadIsAuthorized_cb
130  * DownloadIsAuthorized_cb
131  * CreateIsAuthorized_cb
132  * DestroyIsAuthorized_cb
133  * MoveIsAuthorized_cb
134  * ViewIsAuthorized_cb
135  * DetailIsAuthorized_cb
136  * ThumbnailIsAuthorized_cb
137
138
139
140### Credits
141
142Loosely based on a Script by [Yannick Croissant](http://dev.k1der.net/dev/brooser-un-browser-de-fichier-pour-mootools/)
Note: See TracBrowser for help on using the repository browser.