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

Last change on this file since 586 was 579, checked in by ray, 13 years ago

ExtendedFileManager? updates:

*to complete cofigurability through js directories can now be set for images and files individually (optional & backwards compatible)

  • relocated button from the end of toolbar next to createlink
  • insert image/link with double click
  • preview img didn't have src when no image selected, which showed a "image not found icon" in IE
  • slight modifications and updates in Readme.txt (kicked out afru's website. The domain isn't even registered anymore)
File size: 10.4 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//You may set a different directory for the link mode; if you don't, the above setting will be used for both modes
63//$IMConfig['files_dir'] = 'demo_files';
64
65/*
66 The URL to the above path, the web browser needs to be able to see it.
67 It can be protected via .htaccess on apache or directory permissions on IIS,
68 check you web server documentation for futher information on directory protection
69 If this directory needs to be publicly accessiable, remove scripting capabilities
70 for this directory (i.e. disable PHP, Perl, CGI). We only want to store assets
71 in this directory and its subdirectories.
72*/
73$IMConfig['images_url'] = str_replace( "backend.php", "", $_SERVER["PHP_SELF"] ) . "demo_images";
74//$IMConfig['files_url'] = 'url/to/files_dir';
75
76/*
77  Possible values: true, false
78
79  TRUE - If PHP on the web server is in safe mode, set this to true.
80         SAFE MODE restrictions: directory creation will not be possible,
81                 only the GD library can be used, other libraries require
82                 Safe Mode to be off.
83
84  FALSE - Set to false if PHP on the web server is not in safe mode.
85*/
86$IMConfig['safe_mode'] = false;
87
88/*
89This 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.
90FALSE - Thumbnails will be resized by browser ignoring image libraries.
91*/
92$IMConfig['img_library'] = true;
93
94
95/*
96View type when the File manager is in insert image mode.
97Valid values are "thumbview" and "listview".
98*/
99
100   
101if ($insertMode == 'image')
102        $IMConfig['view_type'] = "thumbview";
103       
104else if($insertMode == "link")
105        $IMConfig['view_type'] = "listview";
106
107$IMConfig['insert_mode'] = $insertMode;
108
109/*
110 Possible values: 'GD', 'IM', or 'NetPBM'
111
112 The image manipulation library to use, either GD or ImageMagick or NetPBM.
113 If you have safe mode ON, or don't have the binaries to other packages,
114 your choice is 'GD' only. Other packages require Safe Mode to be off.
115*/
116define('IMAGE_CLASS', 'GD');
117
118
119/*
120 After defining which library to use, if it is NetPBM or IM, you need to
121 specify where the binary for the selected library are. And of course
122 your server and PHP must be able to execute them (i.e. safe mode is OFF).
123 GD does not require the following definition.
124*/
125define('IMAGE_TRANSFORM_LIB_PATH', 'C:/"Program Files"/ImageMagick-5.5.7-Q16/');
126
127
128/*
129  The prefix for thumbnail files, something like .thumb will do. The
130  thumbnails files will be named as "prefix_imagefile.ext", that is,
131  prefix + orginal filename.
132*/
133$IMConfig['thumbnail_prefix'] = 't_';
134
135
136/*
137  Thumbnail can also be stored in a directory, this directory
138  will be created by PHP. If PHP is in safe mode, this parameter
139  is ignored, you can not create directories.
140
141  If you do not want to store thumbnails in a directory, set this
142  to false or empty string '';
143*/
144$IMConfig['thumbnail_dir'] = 't';
145
146/**
147* Resized prefix
148*
149* The prefix for resized files, something like .resized will do.  The
150* resized files will be named <prefix>_<width>x<height>_<original>
151* resized files are created when one changes the dimensions of an image
152* in the image manager selection dialog - the image is scaled when the
153* user clicks the ok button.
154*/
155
156$IMConfig['resized_prefix'] = '.resized';
157
158// -------------------------------------------------------------------------
159
160/**
161* Resized Directory
162*
163* Resized images may also be stored in a directory, except in safe mode.
164*/
165
166$IMConfig['resized_dir'] = '';
167
168/*
169  Possible values: true, false
170
171 TRUE -  Allow the user to create new sub-directories in the
172         $IMConfig['base_dir'].
173
174 FALSE - No directory creation.
175
176 NOTE: If $IMConfig['safe_mode'] = true, this parameter
177       is ignored, you can not create directories
178*/
179$IMConfig['allow_new_dir'] = true;
180
181
182/*
183  Possible values: true, false
184
185 TRUE -  Allow the user to edit image by image editor.
186
187 FALSE - No edit icon will be displayed.
188
189 NOTE: If $IMConfig['img_library'] = false, this parameter
190       is ignored, you can not edit images.
191*/
192$IMConfig['allow_edit_image'] = true;
193
194/*
195  Possible values: true, false
196
197 TRUE -  Allow the user to rename files.
198
199 FALSE - No rename icon will be displayed.
200
201*/
202$IMConfig['allow_rename'] = true;
203
204/*
205  Possible values: true, false
206
207  TRUE - Display color pickers for image background / border colors
208
209  FALSE - Don't display color pickers
210*/
211$IMConfig['use_color_pickers'] = true;
212
213/*
214  Possible values: true, false
215
216 TRUE -  Allow the user to set alt (alternative text) attribute.
217
218 FALSE - No input field for alt attribute will be displayed.
219
220 NOTE: The alt attribute is _obligatory_ for images, so <img alt="" /> will be inserted
221      if 'images_enable_alt' is set to false
222*/
223$IMConfig['images_enable_alt'] = true;
224
225/*
226  Possible values: true, false
227
228 TRUE -  Allow the user to set title attribute (usually displayed when mouse is over element).
229
230 FALSE - No input field for title attribute will be displayed.
231
232*/
233$IMConfig['images_enable_title'] = false;
234
235/*
236  Possible values: true, false
237
238 TRUE -  Allow the user to set align attribute.
239
240 FALSE - No selection box for align attribute will be displayed.
241
242*/
243$IMConfig['images_enable_align'] = true;
244
245/*
246  Possible values: true, false
247
248 TRUE -  Allow the user to set margin, padding, and border styles for the image
249
250 FALSE - No styling input fields will be displayed.
251
252*/
253$IMConfig['images_enable_styling'] = true;
254
255/*
256  Possible values: true, false
257
258 TRUE -   Allow the user to set target attribute for link (the window in which the link will be opened).
259
260 FALSE - No selection box for target attribute will be displayed.
261
262*/
263$IMConfig['link_enable_target'] = true;
264/*
265  Possible values: true, false
266
267  TRUE - Allow the user to upload files.
268
269  FALSE - No uploading allowed.
270*/
271$IMConfig['allow_upload'] = true;
272
273/* Maximum upload file size in Kilobytes */
274$IMConfig['max_filesize_kb_image'] = 2000;
275
276$IMConfig['max_filesize_kb_link'] = 5000;
277
278/* Maximum upload folder size in Megabytes. Use 0 to disable limit */
279$IMConfig['max_foldersize_mb'] = 0;
280
281/*
282Allowed extensions that can be shown and allowed to upload.
283Available icons are for "doc,fla,gif,gz,html,jpg,js,mov,pdf,php,png,ppt,rar,txt,xls,zip"
284-Changed by AFRU.
285*/
286
287$IMConfig['allowed_image_extensions'] = array("jpg","gif","png","bmp");
288$IMConfig['allowed_link_extensions'] = array("jpg","gif","js","php","pdf","zip","txt","psd","png","html","swf","xml","xls");
289
290
291/*
292 The default thumbnail and list view icon in case thumbnails are not created and the files are of unknown.
293*/
294$IMConfig['default_thumbnail'] = 'icons/def.gif';
295$IMConfig['default_listicon'] = 'icons/def_small.gif';
296
297
298/*
299Only files with these extensions will be shown as thumbnails. All other files will be shown as icons.
300*/
301$IMConfig['thumbnail_extensions'] = array("jpg", "gif", "png", "bmp");
302
303/*
304  Thumbnail dimensions.
305*/
306$IMConfig['thumbnail_width'] = 84;
307$IMConfig['thumbnail_height'] = 84;
308
309/*
310  Image Editor temporary filename prefix.
311*/
312$IMConfig['tmp_prefix'] = '.editor_';
313
314
315// Standard PHP Backend Data Passing
316//  if data was passed using xinha_pass_to_php_backend() we merge the items
317//  provided into the Config
318require_once(realpath(dirname(__FILE__) . '/../../contrib/php-xinha.php'));
319if($passed_data = xinha_read_passed_data())
320{
321  $IMConfig = array_merge($IMConfig, $passed_data);
322  $IMConfig['backend_url'] .= xinha_passed_data_querystring() . '&';
323}
324// Deprecated config passing, don't use this way any more!
325elseif(isset($_REQUEST['backend_config']))
326{
327  if(get_magic_quotes_gpc()) {
328    $_REQUEST['backend_config'] = stripslashes($_REQUEST['backend_config']);
329  }
330
331  // Config specified from front end, check that it's valid
332  session_start();
333  if (!array_key_exists($_REQUEST['backend_config_secret_key_location'], $_SESSION))
334    die("Backend security error.");
335
336  $secret = $_SESSION[$_REQUEST['backend_config_secret_key_location']];
337
338  if($_REQUEST['backend_config_hash'] !== sha1($_REQUEST['backend_config'] . $secret))
339  {
340    die("Backend security error.");
341  }
342
343  $to_merge = unserialize($_REQUEST['backend_config']);
344  if(!is_array($to_merge))
345  {
346    die("Backend config syntax error.");
347  }
348
349  $IMConfig = array_merge($IMConfig, $to_merge);
350
351   // changed config settings keys in relation to ImageManager
352  $IMConfig['backend_url'] .= "backend_config=" . rawurlencode($_REQUEST['backend_config']) . '&';
353  $IMConfig['backend_url'] .= "backend_config_hash=" . rawurlencode($_REQUEST['backend_config_hash']) . '&';
354  $IMConfig['backend_url'] .= "backend_config_secret_key_location=" . rawurlencode($_REQUEST['backend_config_secret_key_location']) . '&';
355
356}
357
358// END
359
360?>
Note: See TracBrowser for help on using the repository browser.