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

Last change on this file since 570 was 570, checked in by ray, 8 years ago

For the example config to work there need to be different settings for $IMConfigimages_url?

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