source: trunk/plugins/ExtendedFileManager/config.inc.php @ 524

Last change on this file since 524 was 524, checked in by koto, 13 years ago
File size: 8.5 KB
Line 
1<?php
2/**
3 * ExtendedFileManager configuration file.
4 * Authors: Wei Zhuo, Afru
5 * Version: Updated on 08-01-2005 by Afru
6 * Version 1.1.2: Updated on 04-07-2006 by Krzysztof Kotowicz <koto@webworkers.pl>
7 * Package: ExtendedFileManager
8 * http://www.afrusoft.com/htmlarea
9 */
10
11/*  Configuration file usage:
12 *      There are two insertModes for this filemanager.
13 *      One is "image" and another is "link".
14 *      So you can assign config values as below
15 *
16 *      if($insertMode=="image") $IMConfig['property']=somevalueforimagemode;
17 *      else if($insertMode=="link") $IMConfig['property']=somevalueforlinkmode;
18 *
19 *      (or) you can directly as $IMConfig['property']=somevalueforbothmodes;
20 *
21 *      Best of Luck :) Afru.
22 */
23
24/**
25* Default backend URL
26*
27* URL to use for unified backend.
28*
29* The ?__plugin=ExtendedFileManager& is required.
30*/
31
32$IMConfig['backend_url'] = "backend.php?__plugin=ExtendedFileManager&";
33
34/**
35* Backend Installation Directory
36*
37* location of backend install; these are used to link to css and js
38* assets because we may have the front end installed in a different
39* directory than the backend. (i.e. nothing assumes that the frontend
40* and the backend are in the same directory)
41*/
42$IMConfig['base_dir'] = getcwd();
43$IMConfig['base_url'] = '';
44
45
46/*
47         File system path to the directory you want to manage the images
48         for multiple user systems, set it dynamically.
49
50         NOTE: This directory requires write access by PHP. That is,
51                   PHP must be able to create files in this directory.
52                   Able to create directories is nice, but not necessary.
53*/
54$IMConfig['images_dir'] = 'demo_images';
55
56/*
57 The URL to the above path, the web browser needs to be able to see it.
58 It can be protected via .htaccess on apache or directory permissions on IIS,
59 check you web server documentation for futher information on directory protection
60 If this directory needs to be publicly accessiable, remove scripting capabilities
61 for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets
62 in this directory and its subdirectories.
63*/
64$IMConfig['images_url'] = str_replace( "backend.php", "", $_SERVER["PHP_SELF"] ) . "demo_images";
65
66/*
67  Possible values: true, false
68
69  TRUE - If PHP on the web server is in safe mode, set this to true.
70         SAFE MODE restrictions: directory creation will not be possible,
71                 only the GD library can be used, other libraries require
72                 Safe Mode to be off.
73
74  FALSE - Set to false if PHP on the web server is not in safe mode.
75*/
76$IMConfig['safe_mode'] = false;
77
78/*
79This specifies whether any image library is available to resize and edit images.TRUE - Thumbnails will be resized by image libraries and if there is no library, default thumbnail will be shown.
80FALSE - Thumbnails will be resized by browser ignoring image libraries.
81*/
82$IMConfig['img_library'] = true;
83
84
85/*
86View type when the File manager is in insert image mode.
87Valid values are "thumbview" and "listview".
88*/
89
90if(empty($insertMode))
91    $insertMode="image";
92   
93if ($insertMode == 'image')
94        $IMConfig['view_type'] = "thumbview";
95       
96else if($insertMode == "link")
97        $IMConfig['view_type'] = "listview";
98
99$IMConfig['insert_mode'] = $insertMode;
100
101/*
102 Possible values: 'GD', 'IM', or 'NetPBM'
103
104 The image manipulation library to use, either GD or ImageMagick or NetPBM.
105 If you have safe mode ON, or don't have the binaries to other packages,
106 your choice is 'GD' only. Other packages require Safe Mode to be off.
107*/
108define('IMAGE_CLASS', 'GD');
109
110
111/*
112 After defining which library to use, if it is NetPBM or IM, you need to
113 specify where the binary for the selected library are. And of course
114 your server and PHP must be able to execute them (i.e. safe mode is OFF).
115 GD does not require the following definition.
116*/
117define('IMAGE_TRANSFORM_LIB_PATH', 'C:/"Program Files"/ImageMagick-5.5.7-Q16/');
118
119
120/*
121  The prefix for thumbnail files, something like .thumb will do. The
122  thumbnails files will be named as "prefix_imagefile.ext", that is,
123  prefix + orginal filename.
124*/
125$IMConfig['thumbnail_prefix'] = 't_';
126
127
128/*
129  Thumbnail can also be stored in a directory, this directory
130  will be created by PHP. If PHP is in safe mode, this parameter
131  is ignored, you can not create directories.
132
133  If you do not want to store thumbnails in a directory, set this
134  to false or empty string '';
135*/
136$IMConfig['thumbnail_dir'] = 't';
137
138/**
139* Resized prefix
140*
141* The prefix for resized files, something like .resized will do.  The
142* resized files will be named <prefix>_<width>x<height>_<original>
143* resized files are created when one changes the dimensions of an image
144* in the image manager selection dialog - the image is scaled when the
145* user clicks the ok button.
146*/
147
148$IMConfig['resized_prefix'] = '.resized';
149
150// -------------------------------------------------------------------------
151
152/**
153* Resized Directory
154*
155* Resized images may also be stored in a directory, except in safe mode.
156*/
157
158$IMConfig['resized_dir'] = '';
159
160/*
161  Possible values: true, false
162
163 TRUE -  Allow the user to create new sub-directories in the
164         $IMConfig['base_dir'].
165
166 FALSE - No directory creation.
167
168 NOTE: If $IMConfig['safe_mode'] = true, this parameter
169       is ignored, you can not create directories
170*/
171$IMConfig['allow_new_dir'] = true;
172
173
174/*
175  Possible values: true, false
176
177 TRUE -  Allow the user to edit image by image editor.
178
179 FALSE - No edit icon will be displayed.
180
181 NOTE: If $IMConfig['img_library'] = false, this parameter
182       is ignored, you can not edit images.
183*/
184$IMConfig['allow_edit_image'] = true;
185
186/*
187  Possible values: true, false
188
189 TRUE -  Allow the user to rename files.
190
191 FALSE - No rename icon will be displayed.
192
193*/
194$IMConfig['allow_rename'] = true;
195
196/*
197  Possible values: true, false
198
199  TRUE - Display color pickers for image background / border colors
200
201  FALSE - Don't display color pickers
202*/
203$IMConfig['use_color_pickers'] = true;
204
205/*
206  Possible values: true, false
207
208  TRUE - Allow the user to upload files.
209
210  FALSE - No uploading allowed.
211*/
212$IMConfig['allow_upload'] = true;
213
214/* Maximum upload file size in Kilobytes */
215$IMConfig['max_filesize_kb_image'] = 2000;
216
217$IMConfig['max_filesize_kb_link'] = 5000;
218
219/* Maximum upload folder size in Megabytes. Use 0 to disable limit */
220$IMConfig['max_foldersize_mb'] = 0;
221
222/*
223Allowed extensions that can be shown and allowed to upload.
224Available icons are for "doc,fla,gif,gz,html,jpg,js,mov,pdf,php,png,ppt,rar,txt,xls,zip"
225-Changed by AFRU.
226*/
227
228$IMConfig['allowed_image_extensions'] = array("jpg","gif","png","bmp");
229$IMConfig['allowed_link_extensions'] = array("jpg","gif","js","php","pdf","zip","txt","psd","png","html","swf","xml","xls");
230
231
232/*
233 The default thumbnail and list view icon in case thumbnails are not created and the files are of unknown.
234*/
235$IMConfig['default_thumbnail'] = 'icons/def.gif';
236$IMConfig['default_listicon'] = 'icons/def_small.gif';
237
238
239/*
240Only files with these extensions will be shown as thumbnails. All other files will be shown as icons.
241*/
242$IMConfig['thumbnail_extensions'] = array("jpg", "gif", "png", "bmp");
243
244/*
245  Thumbnail dimensions.
246*/
247$IMConfig['thumbnail_width'] = 84;
248$IMConfig['thumbnail_height'] = 84;
249
250/*
251  Image Editor temporary filename prefix.
252*/
253$IMConfig['tmp_prefix'] = '.editor_';
254
255
256// If config specified from front end, merge it
257if(isset($_REQUEST['backend_config']))
258{
259  if(get_magic_quotes_gpc()) {
260    $_REQUEST['backend_config'] = stripslashes($_REQUEST['backend_config']);
261  }
262
263  // Config specified from front end, check that it's valid
264  session_start();
265  if (!array_key_exists($_REQUEST['backend_config_secret_key_location'], $_SESSION))
266    die("Backend security error.");
267
268  $secret = $_SESSION[$_REQUEST['backend_config_secret_key_location']];
269
270  if($_REQUEST['backend_config_hash'] !== sha1($_REQUEST['backend_config'] . $secret))
271  {
272    die("Backend security error.");
273  }
274
275  $to_merge = unserialize($_REQUEST['backend_config']);
276  if(!is_array($to_merge))
277  {
278    die("Backend config syntax error.");
279  }
280
281  $IMConfig = array_merge($IMConfig, $to_merge);
282
283   // changed config settings keys in relation to ImageManager
284  $IMConfig['backend_url'] .= "backend_config=" . rawurlencode($_REQUEST['backend_config']) . '&';
285  $IMConfig['backend_url'] .= "backend_config_hash=" . rawurlencode($_REQUEST['backend_config_hash']) . '&';
286  $IMConfig['backend_url'] .= "backend_config_secret_key_location=" . rawurlencode($_REQUEST['backend_config_secret_key_location']) . '&';
287
288}
289
290// END
291
292?>
Note: See TracBrowser for help on using the repository browser.