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

Last change on this file since 567 was 567, checked in by koto, 8 years ago

ExtendedFileManager update:

  • EFM now supports new way of passing configuration variables to backend introduced in changeset:565
  • updated Readme.txt to encourage the new way
  • added German translation (by sven schomacker)
  • added support for editing 'title' attributes for inserted images (new config options 'images_enable_alt' and 'images_enable_title')
File size: 9.0 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$IMConfig['images_enable_alt'] = false;
206$IMConfig['images_enable_title'] = true;
207
208/*
209  Possible values: true, false
210
211  TRUE - Allow the user to upload files.
212
213  FALSE - No uploading allowed.
214*/
215$IMConfig['allow_upload'] = true;
216
217/* Maximum upload file size in Kilobytes */
218$IMConfig['max_filesize_kb_image'] = 2000;
219
220$IMConfig['max_filesize_kb_link'] = 5000;
221
222/* Maximum upload folder size in Megabytes. Use 0 to disable limit */
223$IMConfig['max_foldersize_mb'] = 0;
224
225/*
226Allowed extensions that can be shown and allowed to upload.
227Available icons are for "doc,fla,gif,gz,html,jpg,js,mov,pdf,php,png,ppt,rar,txt,xls,zip"
228-Changed by AFRU.
229*/
230
231$IMConfig['allowed_image_extensions'] = array("jpg","gif","png","bmp");
232$IMConfig['allowed_link_extensions'] = array("jpg","gif","js","php","pdf","zip","txt","psd","png","html","swf","xml","xls");
233
234
235/*
236 The default thumbnail and list view icon in case thumbnails are not created and the files are of unknown.
237*/
238$IMConfig['default_thumbnail'] = 'icons/def.gif';
239$IMConfig['default_listicon'] = 'icons/def_small.gif';
240
241
242/*
243Only files with these extensions will be shown as thumbnails. All other files will be shown as icons.
244*/
245$IMConfig['thumbnail_extensions'] = array("jpg", "gif", "png", "bmp");
246
247/*
248  Thumbnail dimensions.
249*/
250$IMConfig['thumbnail_width'] = 84;
251$IMConfig['thumbnail_height'] = 84;
252
253/*
254  Image Editor temporary filename prefix.
255*/
256$IMConfig['tmp_prefix'] = '.editor_';
257
258
259// Standard PHP Backend Data Passing
260//  if data was passed using xinha_pass_to_php_backend() we merge the items
261//  provided into the Config
262require_once(realpath(dirname(__FILE__) . '/../../contrib/php-xinha.php'));
263if($passed_data = xinha_read_passed_data())
264{
265  $IMConfig = array_merge($IMConfig, $passed_data);
266  $IMConfig['backend_url'] .= xinha_passed_data_querystring() . '&';
267}
268// Deprecated config passing, don't use this way any more!
269elseif(isset($_REQUEST['backend_config']))
270{
271  if(get_magic_quotes_gpc()) {
272    $_REQUEST['backend_config'] = stripslashes($_REQUEST['backend_config']);
273  }
274
275  // Config specified from front end, check that it's valid
276  session_start();
277  if (!array_key_exists($_REQUEST['backend_config_secret_key_location'], $_SESSION))
278    die("Backend security error.");
279
280  $secret = $_SESSION[$_REQUEST['backend_config_secret_key_location']];
281
282  if($_REQUEST['backend_config_hash'] !== sha1($_REQUEST['backend_config'] . $secret))
283  {
284    die("Backend security error.");
285  }
286
287  $to_merge = unserialize($_REQUEST['backend_config']);
288  if(!is_array($to_merge))
289  {
290    die("Backend config syntax error.");
291  }
292
293  $IMConfig = array_merge($IMConfig, $to_merge);
294
295   // changed config settings keys in relation to ImageManager
296  $IMConfig['backend_url'] .= "backend_config=" . rawurlencode($_REQUEST['backend_config']) . '&';
297  $IMConfig['backend_url'] .= "backend_config_hash=" . rawurlencode($_REQUEST['backend_config_hash']) . '&';
298  $IMConfig['backend_url'] .= "backend_config_secret_key_location=" . rawurlencode($_REQUEST['backend_config_secret_key_location']) . '&';
299
300}
301
302// END
303
304?>
Note: See TracBrowser for help on using the repository browser.