@@ -1,45 +1,45 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /** This file is part of KCFinder project |
4 | - * |
|
5 | - * @desc Abstract image driver class |
|
6 | - * @package KCFinder |
|
7 | - * @version 2.54 |
|
8 | - * @author Pavel Tzonkov <[email protected]> |
|
9 | - * @copyright 2010-2014 KCFinder Project |
|
10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | - * @link http://kcfinder.sunhater.com |
|
13 | - */ |
|
4 | + * |
|
5 | + * @desc Abstract image driver class |
|
6 | + * @package KCFinder |
|
7 | + * @version 2.54 |
|
8 | + * @author Pavel Tzonkov <[email protected]> |
|
9 | + * @copyright 2010-2014 KCFinder Project |
|
10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | + * @link http://kcfinder.sunhater.com |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | abstract class image { |
16 | 16 | const DEFAULT_JPEG_QUALITY = 75; |
17 | 17 | |
18 | 18 | /** Image resource or object |
19 | - * @var mixed */ |
|
19 | + * @var mixed */ |
|
20 | 20 | protected $image; |
21 | 21 | |
22 | 22 | /** Image width in pixels |
23 | - * @var integer */ |
|
23 | + * @var integer */ |
|
24 | 24 | protected $width; |
25 | 25 | |
26 | 26 | /** Image height in pixels |
27 | - * @var integer */ |
|
27 | + * @var integer */ |
|
28 | 28 | protected $height; |
29 | 29 | |
30 | 30 | /** Init error |
31 | - * @var bool */ |
|
31 | + * @var bool */ |
|
32 | 32 | protected $initError = false; |
33 | 33 | |
34 | 34 | /** Driver specific options |
35 | - * @var array */ |
|
35 | + * @var array */ |
|
36 | 36 | protected $options = array(); |
37 | 37 | |
38 | 38 | |
39 | 39 | /** Magic method which allows read-only access to all protected or private |
40 | - * class properties |
|
41 | - * @param string $property |
|
42 | - * @return mixed */ |
|
40 | + * class properties |
|
41 | + * @param string $property |
|
42 | + * @return mixed */ |
|
43 | 43 | |
44 | 44 | final public function __get($property) { |
45 | 45 | return property_exists($this, $property) ? $this->$property : null; |
@@ -47,15 +47,15 @@ discard block |
||
47 | 47 | |
48 | 48 | |
49 | 49 | /** Constructor. Parameter $image should be: |
50 | - * 1. An instance of image driver class (copy instance). |
|
51 | - * 2. An image represented by the type of the $image property |
|
52 | - * (resource or object). |
|
53 | - * 3. An array with two elements. First - width, second - height. |
|
54 | - * Creates a blank image. |
|
55 | - * 4. A filename string. Get image form file. |
|
56 | - * Second parameter is used by pass some specific image driver options |
|
57 | - * @param mixed $image |
|
58 | - * @param array $options */ |
|
50 | + * 1. An instance of image driver class (copy instance). |
|
51 | + * 2. An image represented by the type of the $image property |
|
52 | + * (resource or object). |
|
53 | + * 3. An array with two elements. First - width, second - height. |
|
54 | + * Creates a blank image. |
|
55 | + * 4. A filename string. Get image form file. |
|
56 | + * Second parameter is used by pass some specific image driver options |
|
57 | + * @param mixed $image |
|
58 | + * @param array $options */ |
|
59 | 59 | |
60 | 60 | public function __construct($image, array $options=array()) { |
61 | 61 | $this->image = $this->width = $this->height = null; |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | |
71 | 71 | |
72 | 72 | /** Factory pattern to load selected driver. $image and $options are passed |
73 | - * to the constructor of the image driver |
|
74 | - * @param string $driver |
|
75 | - * @param mixed $image |
|
76 | - * @return object */ |
|
73 | + * to the constructor of the image driver |
|
74 | + * @param string $driver |
|
75 | + * @param mixed $image |
|
76 | + * @return object */ |
|
77 | 77 | |
78 | 78 | final static function factory($driver, $image, array $options=array()) { |
79 | 79 | $class = "image_$driver"; |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | |
83 | 83 | |
84 | 84 | /** Checks if the drivers in the array parameter could be used. Returns first |
85 | - * found one |
|
86 | - * @param array $drivers |
|
87 | - * @return string */ |
|
85 | + * found one |
|
86 | + * @param array $drivers |
|
87 | + * @return string */ |
|
88 | 88 | |
89 | 89 | final static function getDriver(array $drivers=array('gd')) { |
90 | 90 | foreach ($drivers as $driver) { |
@@ -101,9 +101,9 @@ discard block |
||
101 | 101 | |
102 | 102 | |
103 | 103 | /** Returns an array. Element 0 - image resource. Element 1 - width. Element 2 - height. |
104 | - * Returns FALSE on failure. |
|
105 | - * @param mixed $image |
|
106 | - * @return array */ |
|
104 | + * Returns FALSE on failure. |
|
105 | + * @param mixed $image |
|
106 | + * @return array */ |
|
107 | 107 | |
108 | 108 | final protected function buildImage($image) { |
109 | 109 | $class = get_class($this); |
@@ -126,8 +126,8 @@ discard block |
||
126 | 126 | |
127 | 127 | |
128 | 128 | /** Returns calculated proportional width from the given height |
129 | - * @param integer $resizedHeight |
|
130 | - * @return integer */ |
|
129 | + * @param integer $resizedHeight |
|
130 | + * @return integer */ |
|
131 | 131 | |
132 | 132 | final public function getPropWidth($resizedHeight) { |
133 | 133 | $width = round(($this->width * $resizedHeight) / $this->height); |
@@ -137,8 +137,8 @@ discard block |
||
137 | 137 | |
138 | 138 | |
139 | 139 | /** Returns calculated proportional height from the given width |
140 | - * @param integer $resizedWidth |
|
141 | - * @return integer */ |
|
140 | + * @param integer $resizedWidth |
|
141 | + * @return integer */ |
|
142 | 142 | |
143 | 143 | final public function getPropHeight($resizedWidth) { |
144 | 144 | $height = round(($this->height * $resizedWidth) / $this->width); |
@@ -148,45 +148,45 @@ discard block |
||
148 | 148 | |
149 | 149 | |
150 | 150 | /** Checks if PHP needs some extra extensions to use the image driver. This |
151 | - * static method should be implemented into driver classes like abstract |
|
152 | - * methods |
|
153 | - * @return bool */ |
|
151 | + * static method should be implemented into driver classes like abstract |
|
152 | + * methods |
|
153 | + * @return bool */ |
|
154 | 154 | static function available() { return false; } |
155 | 155 | |
156 | 156 | /** Checks if file is an image. This static method should be implemented into |
157 | - * driver classes like abstract methods |
|
158 | - * @param string $file |
|
159 | - * @return bool */ |
|
157 | + * driver classes like abstract methods |
|
158 | + * @param string $file |
|
159 | + * @return bool */ |
|
160 | 160 | static function checkImage($file) { return false; } |
161 | 161 | |
162 | 162 | /** Resize image. Should return TRUE on success or FALSE on failure |
163 | - * @param integer $width |
|
164 | - * @param integer $height |
|
165 | - * @return bool */ |
|
163 | + * @param integer $width |
|
164 | + * @param integer $height |
|
165 | + * @return bool */ |
|
166 | 166 | abstract public function resize($width, $height); |
167 | 167 | |
168 | 168 | /** Resize image to fit in given resolution. Should returns TRUE on success |
169 | - * or FALSE on failure. If $background is set, the image size will be |
|
170 | - * $width x $height and the empty spaces (if any) will be filled with defined |
|
171 | - * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) |
|
172 | - * @param integer $width |
|
173 | - * @param integer $height |
|
174 | - * @param mixed $background |
|
175 | - * @return bool */ |
|
169 | + * or FALSE on failure. If $background is set, the image size will be |
|
170 | + * $width x $height and the empty spaces (if any) will be filled with defined |
|
171 | + * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) |
|
172 | + * @param integer $width |
|
173 | + * @param integer $height |
|
174 | + * @param mixed $background |
|
175 | + * @return bool */ |
|
176 | 176 | abstract public function resizeFit($width, $height, $background=false); |
177 | 177 | |
178 | 178 | /** Resize and crop the image to fit in given resolution. Returns TRUE on |
179 | - * success or FALSE on failure |
|
180 | - * @param mixed $src |
|
181 | - * @param integer $offset |
|
182 | - * @return bool */ |
|
179 | + * success or FALSE on failure |
|
180 | + * @param mixed $src |
|
181 | + * @param integer $offset |
|
182 | + * @return bool */ |
|
183 | 183 | abstract public function resizeCrop($width, $height, $offset=false); |
184 | 184 | |
185 | 185 | |
186 | 186 | /** Rotate image |
187 | - * @param integer $angle |
|
188 | - * @param string $background |
|
189 | - * @return bool */ |
|
187 | + * @param integer $angle |
|
188 | + * @param string $background |
|
189 | + * @return bool */ |
|
190 | 190 | abstract public function rotate($angle, $background="#000000"); |
191 | 191 | |
192 | 192 | abstract public function flipHorizontal(); |
@@ -194,44 +194,44 @@ discard block |
||
194 | 194 | abstract public function flipVertical(); |
195 | 195 | |
196 | 196 | /** Apply a PNG or GIF watermark to the image. $top and $left parameters sets |
197 | - * the offset of the watermark in pixels. Boolean and NULL values are possible |
|
198 | - * too. In default case (FALSE, FALSE) the watermark should be applyed to |
|
199 | - * the bottom right corner. NULL values means center aligning. If the |
|
200 | - * watermark is bigger than the image or it's partialy or fully outside the |
|
201 | - * image, it shoudn't be applied |
|
202 | - * @param string $file |
|
203 | - * @param mixed $top |
|
204 | - * @param mixed $left |
|
205 | - * @return bool */ |
|
197 | + * the offset of the watermark in pixels. Boolean and NULL values are possible |
|
198 | + * too. In default case (FALSE, FALSE) the watermark should be applyed to |
|
199 | + * the bottom right corner. NULL values means center aligning. If the |
|
200 | + * watermark is bigger than the image or it's partialy or fully outside the |
|
201 | + * image, it shoudn't be applied |
|
202 | + * @param string $file |
|
203 | + * @param mixed $top |
|
204 | + * @param mixed $left |
|
205 | + * @return bool */ |
|
206 | 206 | abstract public function watermark($file, $left=false, $top=false); |
207 | 207 | |
208 | 208 | /** Should output the image. Second parameter is used to pass some options like |
209 | - * 'file' - if is set, the output will be written to a file |
|
210 | - * 'quality' - compression quality |
|
211 | - * It's possible to use extra specific options required by image type ($type) |
|
212 | - * @param string $type |
|
213 | - * @param array $options |
|
214 | - * @return bool */ |
|
209 | + * 'file' - if is set, the output will be written to a file |
|
210 | + * 'quality' - compression quality |
|
211 | + * It's possible to use extra specific options required by image type ($type) |
|
212 | + * @param string $type |
|
213 | + * @param array $options |
|
214 | + * @return bool */ |
|
215 | 215 | abstract public function output($type='jpeg', array $options=array()); |
216 | 216 | |
217 | 217 | /** This method should create a blank image with selected size. Should returns |
218 | - * resource or object related to the created image, which will be passed to |
|
219 | - * $image property |
|
220 | - * @param integer $width |
|
221 | - * @param integer $height |
|
222 | - * @return mixed */ |
|
218 | + * resource or object related to the created image, which will be passed to |
|
219 | + * $image property |
|
220 | + * @param integer $width |
|
221 | + * @param integer $height |
|
222 | + * @return mixed */ |
|
223 | 223 | abstract protected function getBlankImage($width, $height); |
224 | 224 | |
225 | 225 | /** This method should create an image from source image. Only first parameter |
226 | - * ($image) is input. Its type should be filename string or a type of the |
|
227 | - * $image property. See the constructor reference for details. The |
|
228 | - * parametters $width and $height are output only. Should returns resource or |
|
229 | - * object related to the created image, which will be passed to $image |
|
230 | - * property |
|
231 | - * @param mixed $image |
|
232 | - * @param integer $width |
|
233 | - * @param integer $height |
|
234 | - * @return mixed */ |
|
226 | + * ($image) is input. Its type should be filename string or a type of the |
|
227 | + * $image property. See the constructor reference for details. The |
|
228 | + * parametters $width and $height are output only. Should returns resource or |
|
229 | + * object related to the created image, which will be passed to $image |
|
230 | + * property |
|
231 | + * @param mixed $image |
|
232 | + * @param integer $width |
|
233 | + * @param integer $height |
|
234 | + * @return mixed */ |
|
235 | 235 | abstract protected function getImage($image, &$width, &$height); |
236 | 236 | |
237 | 237 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | $load_script = file_get_contents(__DIR__.'/datepicker.tpl'); |
10 | 10 | if(!isset($modx->config['lang_code'])) $modx->config['lang_code'] = $this->getLangCode(); |
11 | - $modx->config['datetime_format_lc'] = isset($modx->config['datetime_format']) ? strtolower($modx->config['datetime_format']) : 'dd-mm-yyyy'; |
|
11 | + $modx->config['datetime_format_lc'] = isset($modx->config['datetime_format']) ? strtolower($modx->config['datetime_format']) : 'dd-mm-yyyy'; |
|
12 | 12 | return $modx->mergeSettingsContent($load_script); |
13 | 13 | } |
14 | 14 |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | class DATEPICKER { |
4 | - function __construct() { |
|
5 | - } |
|
4 | + function __construct() { |
|
5 | + } |
|
6 | 6 | |
7 | - function getDP() { |
|
8 | - $modx = evolutionCMS(); global $_lang; |
|
7 | + function getDP() { |
|
8 | + $modx = evolutionCMS(); global $_lang; |
|
9 | 9 | |
10 | - $tpl = file_get_contents(__DIR__ . '/datepicker.tpl'); |
|
11 | - return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
12 | - } |
|
10 | + $tpl = file_get_contents(__DIR__ . '/datepicker.tpl'); |
|
11 | + return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
12 | + } |
|
13 | 13 | } |
@@ -238,66 +238,66 @@ discard block |
||
238 | 238 | $addnew = 0; |
239 | 239 | $run = 0; |
240 | 240 | switch($action) { |
241 | - case '3': |
|
242 | - case '4': |
|
243 | - case '27': |
|
244 | - case '72': |
|
245 | - if($modx->hasPermission('new_document')) { |
|
246 | - $addnew = 1; |
|
247 | - } |
|
248 | - break; |
|
249 | - case '16': |
|
250 | - case '19': |
|
251 | - if($modx->hasPermission('new_template')) { |
|
252 | - $addnew = 1; |
|
253 | - } |
|
254 | - break; |
|
255 | - case '300': |
|
256 | - case '301': |
|
257 | - if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) { |
|
258 | - $addnew = 1; |
|
259 | - } |
|
260 | - break; |
|
261 | - case '77': |
|
262 | - case '78': |
|
263 | - if($modx->hasPermission('new_chunk')) { |
|
264 | - $addnew = 1; |
|
265 | - } |
|
266 | - break; |
|
267 | - case '22': |
|
268 | - case '23': |
|
269 | - if($modx->hasPermission('new_snippet')) { |
|
270 | - $addnew = 1; |
|
271 | - } |
|
272 | - break; |
|
273 | - case '101': |
|
274 | - case '102': |
|
275 | - if($modx->hasPermission('new_plugin')) { |
|
276 | - $addnew = 1; |
|
277 | - } |
|
278 | - break; |
|
279 | - case '106': |
|
280 | - case '107': |
|
281 | - case '108': |
|
282 | - if($modx->hasPermission('new_module')) { |
|
283 | - $addnew = 1; |
|
284 | - } |
|
285 | - if($modx->hasPermission('exec_module')) { |
|
286 | - $run = 1; |
|
287 | - } |
|
288 | - break; |
|
289 | - case '88': |
|
290 | - if($modx->hasPermission('new_web_user')) { |
|
291 | - $addnew = 1; |
|
292 | - } |
|
293 | - break; |
|
241 | + case '3': |
|
242 | + case '4': |
|
243 | + case '27': |
|
244 | + case '72': |
|
245 | + if($modx->hasPermission('new_document')) { |
|
246 | + $addnew = 1; |
|
247 | + } |
|
248 | + break; |
|
249 | + case '16': |
|
250 | + case '19': |
|
251 | + if($modx->hasPermission('new_template')) { |
|
252 | + $addnew = 1; |
|
253 | + } |
|
254 | + break; |
|
255 | + case '300': |
|
256 | + case '301': |
|
257 | + if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) { |
|
258 | + $addnew = 1; |
|
259 | + } |
|
260 | + break; |
|
261 | + case '77': |
|
262 | + case '78': |
|
263 | + if($modx->hasPermission('new_chunk')) { |
|
264 | + $addnew = 1; |
|
265 | + } |
|
266 | + break; |
|
267 | + case '22': |
|
268 | + case '23': |
|
269 | + if($modx->hasPermission('new_snippet')) { |
|
270 | + $addnew = 1; |
|
271 | + } |
|
272 | + break; |
|
273 | + case '101': |
|
274 | + case '102': |
|
275 | + if($modx->hasPermission('new_plugin')) { |
|
276 | + $addnew = 1; |
|
277 | + } |
|
278 | + break; |
|
279 | + case '106': |
|
280 | + case '107': |
|
281 | + case '108': |
|
282 | + if($modx->hasPermission('new_module')) { |
|
283 | + $addnew = 1; |
|
284 | + } |
|
285 | + if($modx->hasPermission('exec_module')) { |
|
286 | + $run = 1; |
|
287 | + } |
|
288 | + break; |
|
289 | + case '88': |
|
290 | + if($modx->hasPermission('new_web_user')) { |
|
291 | + $addnew = 1; |
|
292 | + } |
|
293 | + break; |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | $disabled = ($action == '19' || $action == '300' || $action == '77' || $action == '23' || $action == '101' || $action == '4' || $action == '72' || $action == '87' || $action == '11' || $action == '107' || $action == '38') ? ' disabled' : ''; |
297 | 297 | |
298 | 298 | $_style['actionbuttons'] = array( |
299 | - 'dynamic' => array( |
|
300 | - 'document' => '<div id="actions"> |
|
299 | + 'dynamic' => array( |
|
300 | + 'document' => '<div id="actions"> |
|
301 | 301 | <div class="btn-group"> |
302 | 302 | <div class="btn-group"> |
303 | 303 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option> |
313 | 313 | </select> |
314 | 314 | </div>' . |
315 | - ($addnew ? ' |
|
315 | + ($addnew ? ' |
|
316 | 316 | <a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();"> |
317 | 317 | <i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span> |
318 | 318 | </a> |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | </a> |
329 | 329 | </div> |
330 | 330 | </div>', |
331 | - 'user' => '<div id="actions"> |
|
331 | + 'user' => '<div id="actions"> |
|
332 | 332 | <div class="btn-group"> |
333 | 333 | <div class="btn-group"> |
334 | 334 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | </a> |
352 | 352 | </div> |
353 | 353 | </div>', |
354 | - 'element' => '<div id="actions"> |
|
354 | + 'element' => '<div id="actions"> |
|
355 | 355 | <div class="btn-group"> |
356 | 356 | <div class="btn-group"> |
357 | 357 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
@@ -384,21 +384,21 @@ discard block |
||
384 | 384 | ' : '') . ' |
385 | 385 | </div> |
386 | 386 | </div>', |
387 | - 'newmodule' => ($addnew ? '<div id="actions"> |
|
387 | + 'newmodule' => ($addnew ? '<div id="actions"> |
|
388 | 388 | <div class="btn-group"> |
389 | 389 | <a id="newModule" class="btn btn-secondary" href="javascript:;" onclick="actions.new();"> |
390 | 390 | <i class="fa fa-plus-circle"></i><span>' . $_lang['new_module'] . '</span> |
391 | 391 | </a> |
392 | 392 | </div> |
393 | 393 | </div>' : ''), |
394 | - 'close' => '<div id="actions"> |
|
394 | + 'close' => '<div id="actions"> |
|
395 | 395 | <div class="btn-group"> |
396 | 396 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.close();"> |
397 | 397 | <i class="' . $_style["actions_close"] . '"></i><span>' . $_lang['close'] . '</span> |
398 | 398 | </a> |
399 | 399 | </div> |
400 | 400 | </div>', |
401 | - 'save' => '<div id="actions"> |
|
401 | + 'save' => '<div id="actions"> |
|
402 | 402 | <div class="btn-group"> |
403 | 403 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
404 | 404 | <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | </a> |
409 | 409 | </div> |
410 | 410 | </div>', |
411 | - 'savedelete' => '<div id="actions"> |
|
411 | + 'savedelete' => '<div id="actions"> |
|
412 | 412 | <div class="btn-group"> |
413 | 413 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
414 | 414 | <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
@@ -421,14 +421,14 @@ discard block |
||
421 | 421 | </a> |
422 | 422 | </div> |
423 | 423 | </div>', |
424 | - 'cancel' => '<div id="actions"> |
|
424 | + 'cancel' => '<div id="actions"> |
|
425 | 425 | <div class="btn-group"> |
426 | 426 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
427 | 427 | <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
428 | 428 | </a> |
429 | 429 | </div> |
430 | 430 | </div>', |
431 | - 'canceldelete' => '<div id="actions"> |
|
431 | + 'canceldelete' => '<div id="actions"> |
|
432 | 432 | <div class="btn-group"> |
433 | 433 | <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
434 | 434 | <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
@@ -438,11 +438,11 @@ discard block |
||
438 | 438 | </a> |
439 | 439 | </div> |
440 | 440 | </div>', |
441 | - ), |
|
442 | - 'static' => array( |
|
443 | - 'document' => '<div id="actions"> |
|
441 | + ), |
|
442 | + 'static' => array( |
|
443 | + 'document' => '<div id="actions"> |
|
444 | 444 | <div class="btn-group">' . |
445 | - ($addnew ? ' |
|
445 | + ($addnew ? ' |
|
446 | 446 | <a class="btn btn-secondary" href="javascript:;" onclick="actions.new();"> |
447 | 447 | <i class="' . $_style["icons_new_document"] . '"></i><span>' . $_lang['create_resource_here'] . '</span> |
448 | 448 | </a> |
@@ -467,12 +467,12 @@ discard block |
||
467 | 467 | </a> |
468 | 468 | </div> |
469 | 469 | </div>', |
470 | - 'cancel' => '<div id="actions"> |
|
470 | + 'cancel' => '<div id="actions"> |
|
471 | 471 | <div class="btn-group"> |
472 | 472 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
473 | 473 | <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
474 | 474 | </a> |
475 | 475 | </div> |
476 | 476 | </div>', |
477 | - ) |
|
477 | + ) |
|
478 | 478 | ); |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /** This file is part of KCFinder project |
4 | - * |
|
5 | - * @desc Base configuration file |
|
6 | - * @package KCFinder |
|
7 | - * @version 2.54 |
|
8 | - * @author Pavel Tzonkov <[email protected]> |
|
9 | - * @copyright 2010-2014 KCFinder Project |
|
10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | - * @link http://kcfinder.sunhater.com |
|
13 | - */ |
|
4 | + * |
|
5 | + * @desc Base configuration file |
|
6 | + * @package KCFinder |
|
7 | + * @version 2.54 |
|
8 | + * @author Pavel Tzonkov <[email protected]> |
|
9 | + * @copyright 2010-2014 KCFinder Project |
|
10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | + * @link http://kcfinder.sunhater.com |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | // IMPORTANT!!! Do not remove uncommented settings in this file even if |
16 | 16 | // you are using session configuration. |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | 'dirnameChangeChars' => array( |
67 | 67 | ' ' => "_", |
68 | 68 | ':' => "." |
69 | - ), |
|
69 | + ), |
|
70 | 70 | 'mime_magic' => "", |
71 | 71 | |
72 | 72 | 'maxImageWidth' => $modx->config['maxImageWidth'], |
73 | 73 | 'maxImageHeight' => $modx->config['maxImageHeight'], |
74 | 74 | 'clientResize' => $modx->config['clientResize'] && $modx->config['maxImageWidth'] && $modx->config['maxImageHeight'] ? array('maxWidth' => $modx->config['maxImageWidth'], |
75 | - 'maxHeight' => $modx->config['maxImageHeight'], |
|
76 | - 'quality' => $modx->config['jpegQuality'] / 100 |
|
75 | + 'maxHeight' => $modx->config['maxImageHeight'], |
|
76 | + 'quality' => $modx->config['jpegQuality'] / 100 |
|
77 | 77 | ) : array(), |
78 | 78 | |
79 | 79 | 'thumbWidth' => $modx->config['thumbWidth'], |
@@ -1,24 +1,24 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /** This file is part of KCFinder project |
4 | - * |
|
5 | - * @desc This file is included first, before each other |
|
6 | - * @package KCFinder |
|
7 | - * @version 2.54 |
|
8 | - * @author Pavel Tzonkov <[email protected]> |
|
9 | - * @copyright 2010-2014 KCFinder Project |
|
10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | - * @link http://kcfinder.sunhater.com |
|
13 | - * |
|
14 | - * This file is the place you can put any code (at the end of the file), |
|
15 | - * which will be executed before any other. Suitable for: |
|
16 | - * 1. Set PHP ini settings using ini_set() |
|
17 | - * 2. Custom session save handler with session_set_save_handler() |
|
18 | - * 3. Any custom integration code. If you use any global variables |
|
19 | - * here, they can be accessed in config.php via $GLOBALS array. |
|
20 | - * It's recommended to use constants instead. |
|
21 | - */ |
|
4 | + * |
|
5 | + * @desc This file is included first, before each other |
|
6 | + * @package KCFinder |
|
7 | + * @version 2.54 |
|
8 | + * @author Pavel Tzonkov <[email protected]> |
|
9 | + * @copyright 2010-2014 KCFinder Project |
|
10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | + * @link http://kcfinder.sunhater.com |
|
13 | + * |
|
14 | + * This file is the place you can put any code (at the end of the file), |
|
15 | + * which will be executed before any other. Suitable for: |
|
16 | + * 1. Set PHP ini settings using ini_set() |
|
17 | + * 2. Custom session save handler with session_set_save_handler() |
|
18 | + * 3. Any custom integration code. If you use any global variables |
|
19 | + * here, they can be accessed in config.php via $GLOBALS array. |
|
20 | + * It's recommended to use constants instead. |
|
21 | + */ |
|
22 | 22 | define('IN_MANAGER_MODE', true); |
23 | 23 | define('MODX_API_MODE', true); |
24 | 24 | include_once(__DIR__."/../../../../../index.php"); |
@@ -5,14 +5,14 @@ discard block |
||
5 | 5 | |
6 | 6 | // PROCESSOR FIRST |
7 | 7 | if($_SESSION['mgrRole'] == 1) { |
8 | - if(!empty($_REQUEST['b']) && $_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) { |
|
9 | - $current = $modx->getManagerApi()->getSystemChecksum($modx->config['check_files_onlogin']); |
|
10 | - if(!empty($current)) { |
|
11 | - $modx->getManagerApi()->setSystemChecksum($current); |
|
12 | - $modx->clearCache('full'); |
|
13 | - $modx->config['sys_files_checksum'] = $current; |
|
14 | - }; |
|
15 | - } |
|
8 | + if(!empty($_REQUEST['b']) && $_REQUEST['b'] == 'resetSysfilesChecksum' && $modx->hasPermission('settings')) { |
|
9 | + $current = $modx->getManagerApi()->getSystemChecksum($modx->config['check_files_onlogin']); |
|
10 | + if(!empty($current)) { |
|
11 | + $modx->getManagerApi()->setSystemChecksum($current); |
|
12 | + $modx->clearCache('full'); |
|
13 | + $modx->config['sys_files_checksum'] = $current; |
|
14 | + }; |
|
15 | + } |
|
16 | 16 | } |
17 | 17 | |
18 | 18 | // NOW CHECK CONFIG |
@@ -20,15 +20,15 @@ discard block |
||
20 | 20 | |
21 | 21 | $sysfiles_check = $modx->getManagerApi()->checkSystemChecksum(); |
22 | 22 | if ($sysfiles_check!=='0'){ |
23 | - $warningspresent = 1; |
|
24 | - $warnings[] = array($_lang['configcheck_sysfiles_mod']); |
|
23 | + $warningspresent = 1; |
|
24 | + $warnings[] = array($_lang['configcheck_sysfiles_mod']); |
|
25 | 25 | } |
26 | 26 | |
27 | 27 | if (is_writable("includes/config.inc.php")){ |
28 | 28 | // Warn if world writable |
29 | 29 | if(@fileperms('includes/config.inc.php') & 0x0002) { |
30 | - $warningspresent = 1; |
|
31 | - $warnings[] = array($_lang['configcheck_configinc']); |
|
30 | + $warningspresent = 1; |
|
31 | + $warnings[] = array($_lang['configcheck_configinc']); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 | |
@@ -182,10 +182,10 @@ discard block |
||
182 | 182 | break; |
183 | 183 | case $_lang['configcheck_sysfiles_mod']: |
184 | 184 | $warnings[$i][1] = $_lang["configcheck_sysfiles_mod_msg"]; |
185 | - $warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>'; |
|
186 | - if($modx->hasPermission('settings')) { |
|
187 | - $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>'; |
|
188 | - } |
|
185 | + $warnings[$i][2] = '<ul><li>'. implode('</li><li>', $sysfiles_check) .'</li></ul>'; |
|
186 | + if($modx->hasPermission('settings')) { |
|
187 | + $warnings[$i][2] .= '<ul class="actionButtons" style="float:right"><li><a href="index.php?a=2&b=resetSysfilesChecksum" onclick="return confirm(\'' . $_lang["reset_sysfiles_checksum_alert"] . '\')">' . $_lang["reset_sysfiles_checksum_button"] . '</a></li></ul>'; |
|
188 | + } |
|
189 | 189 | if(empty($_SESSION["mgrConfigCheck"])) $modx->logEvent(0,3,$warnings[$i][1]." ".implode(', ',$sysfiles_check),$_lang['configcheck_sysfiles_mod']); |
190 | 190 | break; |
191 | 191 | case $_lang['configcheck_lang_difference'] : |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('delete_template')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id']) ? (int)$_GET['id'] : 0; |
10 | 10 | if($id == 0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | $forced = isset($_GET['force']) ? $_GET['force'] : 0; |
@@ -18,8 +18,8 @@ discard block |
||
18 | 18 | $siteTmlvarTemplates = EvolutionCMS\Models\SiteTmplvarContentvalue::with('resource')->where('tmplvarid', '=', $id)->get(); |
19 | 19 | $count = $siteTmlvarTemplates->count(); |
20 | 20 | if($count > 0) { |
21 | - include_once MODX_MANAGER_PATH . "includes/header.inc.php"; |
|
22 | - ?> |
|
21 | + include_once MODX_MANAGER_PATH . "includes/header.inc.php"; |
|
22 | + ?> |
|
23 | 23 | <script> |
24 | 24 | var actions = { |
25 | 25 | delete: function() { |
@@ -44,14 +44,14 @@ discard block |
||
44 | 44 | foreach ($siteTmlvarTemplates as $siteTmlvarTemplate) { |
45 | 45 | echo '<li><span style="width: 200px"><a href="index.php?id=' . $siteTmlvarTemplate->resource->id . '&a=27">' . $siteTmlvarTemplate->resource->pagetitle . '</a></span>' . ($siteTmlvarTemplate->resource->description != '' ? ' - ' . $siteTmlvarTemplate->resource->description : '') . '</li>'; |
46 | 46 | } |
47 | - ?> |
|
47 | + ?> |
|
48 | 48 | </ul> |
49 | 49 | </div> |
50 | 50 | </div> |
51 | 51 | <?php |
52 | - include_once MODX_MANAGER_PATH . "includes/footer.inc.php"; |
|
53 | - exit; |
|
54 | - } |
|
52 | + include_once MODX_MANAGER_PATH . "includes/footer.inc.php"; |
|
53 | + exit; |
|
54 | + } |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | // Set the item name for logger |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | |
61 | 61 | // invoke OnBeforeTVFormDelete event |
62 | 62 | $modx->invokeEvent("OnBeforeTVFormDelete", array( |
63 | - "id" => $id |
|
63 | + "id" => $id |
|
64 | 64 | )); |
65 | 65 | |
66 | 66 | // delete variable |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | |
69 | 69 | // invoke OnTVFormDelete event |
70 | 70 | $modx->invokeEvent("OnTVFormDelete", array( |
71 | - "id" => $id |
|
71 | + "id" => $id |
|
72 | 72 | )); |
73 | 73 | |
74 | 74 | // empty cache |
@@ -3,12 +3,12 @@ |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('edit_template')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
10 | 10 | if($id==0) { |
11 | - $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
11 | + $modx->webAlertAndQuit($_lang["error_no_id"]); |
|
12 | 12 | } |
13 | 13 | |
14 | 14 | // count duplicates |