source: trunk/plugins/MootoolsFileManager/config.php @ 1297

Last change on this file since 1297 was 1297, checked in by gogo, 8 years ago

See ticket #1502

Update to enhance reliability and functionality of MootoolsFileManager?.

  1. A couple of race type conditions caused various issues with loading the MFM.
  2. Add preselection of current image
  3. Add documentation for HSpace/VSpace in config.php

Also snuck in a couple of other bugfixes/additions:

  1. add support for having attribute "onxinhaready" on a textarea
  2. add a Xinha._posturlcontent as an analog to _geturlcontent, synchronouse post
  3. some PHP deprecation issues in the old ExtendedFileManager? and ImageManager?
  4. add a skin.xml to blue-look skin

Note: This is an older version of MFM, I am about to create a branch to work on bringing in a large update to MFM in a couple of stages.

File size: 6.1 KB
Line 
1<?php
2  /**
3    = MootoolsFileManager Configuration File =
4       
5    Configure either by directly editing the config.php file (not recommended) or
6    as follows...
7
8    1. You need to be able to put PHP in your XinhaConfig.js, so
9      you may want to call it XinhaConfig.php instead, or whatever other
10      method you choose (eg put the config as an inline script in your
11      main php page).
12     
13    2. In step 3 of your XinhaConfig write something like...
14      {{{
15        with (xinha_config.MootoolsFileManager)
16        {
17          <?php
18            require_once('/path/to/xinha/contrib/php-xinha.php');
19            xinha_pass_to_php_backend
20            (       
21              array
22              (
23                'images_dir' => '/home/your/directory',
24                'images_url' => '/directory',
25                'allow_images_upload' => true,
26              )
27            )
28          ?>
29        }
30      }}}
31
32    This will work provided you are using normal file-based PHP sessions
33    (most likely), if not, you may need to modify the php-xinha.php
34    file to suit your setup.
35 
36  * @author $Author$
37  * @version $Id$
38  * @package MootoolsFileManager
39  *
40  */
41
42
43  /**   
44    == File Paths REQUIRED ==
45   
46    This plugin operates (optionally) in two modes.
47   
48    1. As a File Manager where people are inserting a link to a file
49      (eg a doc or pdf commonly), we call this "files" mode.
50    2. As an Image Manager where people are inserting an inline image,
51      we call this "images" mode.
52   
53    You may provide one of, or both of, files_dir and images_dir.  If you do not
54    provide one, that mode of MootoolsFileManager will be disabled.
55   
56    # `files_dir` -- Directory path to the location where ordinary files are stored
57                      (eg /home/you/public_html/downloads/ )                   
58    # `files_url` -- The URL path to the files_dir
59                      (eg /downloads/) 
60    # `images_dir` -- Directory path to the location where inline images are stored
61                      (eg /home/you/public_html/images/)
62    # `images_url` -- The URL path to the images_dir
63
64    === Security Caution ===
65
66    You should ensure that the paths you specify are protected against having PHP and
67    other scripts from being executed.  The following .htaccess file is a good idea
68
69    {{{
70      <IfModule mod_php.c>
71        php_flag engine off
72      </IfModule>
73      AddType text/html .html .htm .shtml .php .php3 .php4 .php5 .php6 .php7 .php8 .phtml .phtm .pl .py .cgi
74      RemoveHandler .php
75      RemoveHandler .php8
76      RemoveHandler .php7
77      RemoveHandler .php6
78      RemoveHandler .php5
79      RemoveHandler .php4
80      RemoveHandler .php3
81    }}}
82   
83  */
84
85  $IMConfig['files_dir']  = FALSE; // No trailing slash
86  $IMConfig['files_url']  = FALSE; // No trailing slash
87
88  $IMConfig['images_dir'] = FALSE; // No trailing slash
89  $IMConfig['images_url'] = FALSE; // No trailing slash
90
91  /**
92    == Turning On Uploads ==
93    We have two sets of settings for turning on uploads, one controls the files mode
94    of the plugin, the other is for images mode.
95
96    Note that allowing upload also permits the user to create subdirectories to better
97    organise the files.
98   
99    === Maximum File Sizes ===
100
101    Each mode can have a different maximum file size that can be uploaded, this
102    size is a number followed by one of M, KB or B.
103
104    === Suggested Image Dimensions ===
105
106    Each mode can have a different "suggested maximum image dimension", when the
107    user uses the Mootools File Manager to upload a file, they are able to choose
108    to "resize large images" on upload.  This defines what "large" means.
109 
110  */
111
112  $IMConfig['allow_files_upload']     = false;
113  $IMConfig['allow_files_delete']     = false;
114  $IMConfig['max_files_upload_size']  = '3M';
115  $IMConfig['suggested_files_image_dimension']  = array('width' => 2048, 'height' => 1536);
116
117  $IMConfig['allow_images_upload']     = false;
118  $IMConfig['allow_images_delete']     = false;
119  $IMConfig['max_images_upload_size']  = '3M';
120  $IMConfig['suggested_images_image_dimension']  = array('width' => 1024, 'height' => 768);
121
122
123// -------------------------------------------------------------------------
124//                OPTIONAL SETTINGS
125// -------------------------------------------------------------------------
126
127/**
128
129== Plugin Path ==
130 
131 For most people the defaults will work fine, but if you have trouble, you can set
132 `base_dir` to be the directory path to xinha/plugins/MootoolsFileManager
133 `base_url` to be the url path to xinha/plugins/MootoolsFileManager
134*/
135
136$IMConfig['base_dir'] = getcwd();
137$IMConfig['base_url'] = preg_replace('/\/backend\.php.*/', '', $_SERVER['REQUEST_URI']);
138
139/**
140
141== HTML Compatability ==
142
143 For most people the default of using CSS will be fine, but if the HTML you are editing
144 in Xinha is destined for an email you will probably want to use hspace and vspace
145 instead of CSS margins because of poor Email support for CSS.
146 
147*/
148
149$IMConfig['UseHSpaceVSpace'] = TRUE;
150
151 /**
152  // Future use, not yet required.
153 
154  == ImageMagick Path ==
155 
156  Certain operations require that ImageMagick is available on your server,
157  mogrify, convert and identify executables are required.
158   
159  If these executables are not in your executable path, you'll want to
160  set the path to them here, for Linux/Unix etc this will be something like
161 
162  {{{
163    /usr/bin
164  }}}
165 
166  for Windows servers, something like
167 
168  {{{
169    C:/"Program Files"/ImageMagick-5.5.7-Q16/
170  }}}
171   
172 
173
174  $IMConfig['IMAGE_TRANSFORM_LIB_PATH'] = '';
175*/
176
177////////////////////////////////////////////////////////////////////////////////
178//       ================== END OF CONFIGURATION =======================      //
179////////////////////////////////////////////////////////////////////////////////
180
181
182// Standard PHP Backend Data Passing
183//  if data was passed using xinha_pass_to_php_backend() we merge the items
184//  provided into the Config
185require_once(realpath(dirname(__FILE__) . '/../../contrib/php-xinha.php'));
186
187if($passed_data = xinha_read_passed_data())
188{
189  $IMConfig = array_merge($IMConfig, $passed_data);
190}
191@session_write_close(); // Close session now so we don't lock.
192
193?>
Note: See TracBrowser for help on using the repository browser.