@@ -598,7 +598,7 @@ discard block |
||
598 | 598 | else $opt = true; |
599 | 599 | } |
600 | 600 | elseif(isset($modx->config['mce_element_format'])&&$modx->config['mce_element_format']==='html') |
601 | - $opt = false; |
|
601 | + $opt = false; |
|
602 | 602 | else $opt = true; |
603 | 603 | return nl2br($value,$opt); |
604 | 604 | case 'ltrim': |
@@ -1022,7 +1022,7 @@ discard block |
||
1022 | 1022 | { |
1023 | 1023 | $bt = $content; |
1024 | 1024 | if(strpos($content,'[*')!==false && $modx->documentIdentifier) |
1025 | - $content = $modx->mergeDocumentContent($content); |
|
1025 | + $content = $modx->mergeDocumentContent($content); |
|
1026 | 1026 | if(strpos($content,'[(')!==false) $content = $modx->mergeSettingsContent($content); |
1027 | 1027 | if(strpos($content,'{{')!==false) $content = $modx->mergeChunkContent($content); |
1028 | 1028 | if(strpos($content,'[!')!==false) $content = str_replace(array('[!','!]'),array('[[',']]'),$content); |
@@ -248,9 +248,9 @@ |
||
248 | 248 | echo '<span class="notok">' . $_lang['failed'] . '</span></b>' . $_lang['table_prefix_not_exist'] . '</p>'; |
249 | 249 | $errors++; |
250 | 250 | echo '<p>' . $_lang['table_prefix_not_exist_note'] . '</p>'; |
251 | - } else { |
|
251 | + } else { |
|
252 | 252 | echo '<span class="ok">' . $_lang['ok'] . '</span></p>'; |
253 | - } |
|
253 | + } |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | // check mysql version |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | // load template |
24 | 24 | if(!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { |
25 | - $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; |
|
25 | + $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | $target = $modx->config['manager_lockout_tpl']; |
@@ -30,40 +30,40 @@ discard block |
||
30 | 30 | $target = $modx->mergeSettingsContent($target); |
31 | 31 | |
32 | 32 | if(substr($target,0,1)==='@') { |
33 | - if(substr($target,0,6)==='@CHUNK') { |
|
34 | - $target = trim(substr($target,7)); |
|
35 | - $lockout_tpl = $modx->getChunk($target); |
|
36 | - } |
|
37 | - elseif(substr($target,0,5)==='@FILE') { |
|
38 | - $target = trim(substr($target,6)); |
|
39 | - $lockout_tpl = file_get_contents($target); |
|
40 | - } |
|
41 | - } else { |
|
42 | - $chunk = $modx->getChunk($target); |
|
43 | - if($chunk!==false && !empty($chunk)) { |
|
44 | - $lockout_tpl = $chunk; |
|
45 | - } |
|
46 | - elseif(is_file(MODX_BASE_PATH . $target)) { |
|
47 | - $target = MODX_BASE_PATH . $target; |
|
48 | - $lockout_tpl = file_get_contents($target); |
|
49 | - } |
|
50 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { |
|
51 | - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; |
|
52 | - $lockout_tpl = file_get_contents($target); |
|
53 | - } |
|
54 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { |
|
55 | - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; |
|
56 | - $login_tpl = file_get_contents($target); |
|
57 | - } |
|
58 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible |
|
59 | - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; |
|
60 | - $lockout_tpl = file_get_contents($target); |
|
61 | - } |
|
62 | - else { |
|
63 | - $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; |
|
64 | - $lockout_tpl = file_get_contents($target); |
|
65 | - } |
|
66 | - } |
|
33 | + if(substr($target,0,6)==='@CHUNK') { |
|
34 | + $target = trim(substr($target,7)); |
|
35 | + $lockout_tpl = $modx->getChunk($target); |
|
36 | + } |
|
37 | + elseif(substr($target,0,5)==='@FILE') { |
|
38 | + $target = trim(substr($target,6)); |
|
39 | + $lockout_tpl = file_get_contents($target); |
|
40 | + } |
|
41 | + } else { |
|
42 | + $chunk = $modx->getChunk($target); |
|
43 | + if($chunk!==false && !empty($chunk)) { |
|
44 | + $lockout_tpl = $chunk; |
|
45 | + } |
|
46 | + elseif(is_file(MODX_BASE_PATH . $target)) { |
|
47 | + $target = MODX_BASE_PATH . $target; |
|
48 | + $lockout_tpl = file_get_contents($target); |
|
49 | + } |
|
50 | + elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { |
|
51 | + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; |
|
52 | + $lockout_tpl = file_get_contents($target); |
|
53 | + } |
|
54 | + elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { |
|
55 | + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; |
|
56 | + $login_tpl = file_get_contents($target); |
|
57 | + } |
|
58 | + elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible |
|
59 | + $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; |
|
60 | + $lockout_tpl = file_get_contents($target); |
|
61 | + } |
|
62 | + else { |
|
63 | + $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; |
|
64 | + $lockout_tpl = file_get_contents($target); |
|
65 | + } |
|
66 | + } |
|
67 | 67 | |
68 | 68 | // merge placeholders |
69 | 69 | $lockout_tpl = $modx->mergePlaceholderContent($lockout_tpl); |
@@ -94,13 +94,13 @@ discard block |
||
94 | 94 | } |
95 | 95 | |
96 | 96 | if ($filesize = filesize($cache_file) ) { |
97 | - $data = fread( $fp, filesize($cache_file) ); |
|
98 | - $rss = $this->unserialize( $data ); |
|
97 | + $data = fread( $fp, filesize($cache_file) ); |
|
98 | + $rss = $this->unserialize( $data ); |
|
99 | 99 | |
100 | - return $rss; |
|
101 | - } |
|
100 | + return $rss; |
|
101 | + } |
|
102 | 102 | |
103 | - return 0; |
|
103 | + return 0; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /*=======================================================================*\ |
@@ -134,17 +134,17 @@ discard block |
||
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | - function cache_age( $cache_key ) { |
|
138 | - $filename = $this->file_name( $url ); |
|
139 | - if ( file_exists( $filename ) ) { |
|
140 | - $mtime = filemtime( $filename ); |
|
137 | + function cache_age( $cache_key ) { |
|
138 | + $filename = $this->file_name( $url ); |
|
139 | + if ( file_exists( $filename ) ) { |
|
140 | + $mtime = filemtime( $filename ); |
|
141 | 141 | $age = time() - $mtime; |
142 | - return $age; |
|
143 | - } |
|
144 | - else { |
|
145 | - return -1; |
|
146 | - } |
|
147 | - } |
|
142 | + return $age; |
|
143 | + } |
|
144 | + else { |
|
145 | + return -1; |
|
146 | + } |
|
147 | + } |
|
148 | 148 | |
149 | 149 | /*=======================================================================*\ |
150 | 150 | Function: serialize |
@@ -1,44 +1,44 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /** This file is part of KCFinder project |
4 | - * |
|
5 | - * @desc GD extension class |
|
6 | - * @package KCFinder |
|
7 | - * @version 2.51 |
|
8 | - * @author Pavel Tzonkov <[email protected]> |
|
9 | - * @copyright 2010, 2011 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 GD extension class |
|
6 | + * @package KCFinder |
|
7 | + * @version 2.51 |
|
8 | + * @author Pavel Tzonkov <[email protected]> |
|
9 | + * @copyright 2010, 2011 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 | class gd { |
16 | 16 | |
17 | - /** GD resource |
|
18 | - * @var resource */ |
|
17 | + /** GD resource |
|
18 | + * @var resource */ |
|
19 | 19 | protected $image; |
20 | 20 | |
21 | - /** Image width |
|
22 | - * @var integer */ |
|
21 | + /** Image width |
|
22 | + * @var integer */ |
|
23 | 23 | protected $width; |
24 | 24 | |
25 | - /** Image height |
|
26 | - * @var integer */ |
|
25 | + /** Image height |
|
26 | + * @var integer */ |
|
27 | 27 | protected $height; |
28 | 28 | |
29 | - /** Init error |
|
30 | - * @var bool */ |
|
29 | + /** Init error |
|
30 | + * @var bool */ |
|
31 | 31 | public $init_error = false; |
32 | 32 | |
33 | - /** Last builded image type constant (IMAGETYPE_XXX) |
|
34 | - * @var integer */ |
|
33 | + /** Last builded image type constant (IMAGETYPE_XXX) |
|
34 | + * @var integer */ |
|
35 | 35 | public $type; |
36 | 36 | |
37 | - /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. |
|
38 | - * Returns FALSE on failure. The only one parameter $image can be an instance of this class, |
|
39 | - * a GD resource, an array(width, height) or path to image file. |
|
40 | - * @param mixed $image |
|
41 | - * @return array */ |
|
37 | + /** Returns an array. Element 0 - GD resource. Element 1 - width. Element 2 - height. |
|
38 | + * Returns FALSE on failure. The only one parameter $image can be an instance of this class, |
|
39 | + * a GD resource, an array(width, height) or path to image file. |
|
40 | + * @param mixed $image |
|
41 | + * @return array */ |
|
42 | 42 | |
43 | 43 | protected function build_image($image) { |
44 | 44 | |
@@ -87,16 +87,16 @@ discard block |
||
87 | 87 | return $return; |
88 | 88 | } |
89 | 89 | |
90 | - /** Parameter $image can be: |
|
91 | - * 1. An instance of this class (copy instance). |
|
92 | - * 2. A GD resource. |
|
93 | - * 3. An array with two elements. First - width, second - height. Create a blank image. |
|
94 | - * 4. A filename string. Get image form file. |
|
95 | - * The non-required parameter $bigger_size is the bigger dimension (width or height) the image |
|
96 | - * will be resized to. The other dimension (height or width) will be calculated autamaticaly |
|
97 | - * @param mixed $image |
|
98 | - * @param integer $bigger_size |
|
99 | - * @return gd */ |
|
90 | + /** Parameter $image can be: |
|
91 | + * 1. An instance of this class (copy instance). |
|
92 | + * 2. A GD resource. |
|
93 | + * 3. An array with two elements. First - width, second - height. Create a blank image. |
|
94 | + * 4. A filename string. Get image form file. |
|
95 | + * The non-required parameter $bigger_size is the bigger dimension (width or height) the image |
|
96 | + * will be resized to. The other dimension (height or width) will be calculated autamaticaly |
|
97 | + * @param mixed $image |
|
98 | + * @param integer $bigger_size |
|
99 | + * @return gd */ |
|
100 | 100 | |
101 | 101 | public function __construct($image, $bigger_size=null) { |
102 | 102 | $this->image = $this->width = $this->height = null; |
@@ -123,30 +123,30 @@ discard block |
||
123 | 123 | } |
124 | 124 | } |
125 | 125 | |
126 | - /** Returns the GD resource |
|
127 | - * @return resource */ |
|
126 | + /** Returns the GD resource |
|
127 | + * @return resource */ |
|
128 | 128 | |
129 | 129 | public function get_image() { |
130 | 130 | return $this->image; |
131 | 131 | } |
132 | 132 | |
133 | - /** Returns the image width |
|
134 | - * @return integer */ |
|
133 | + /** Returns the image width |
|
134 | + * @return integer */ |
|
135 | 135 | |
136 | 136 | public function get_width() { |
137 | 137 | return $this->width; |
138 | 138 | } |
139 | 139 | |
140 | - /** Returns the image height |
|
141 | - * @return integer */ |
|
140 | + /** Returns the image height |
|
141 | + * @return integer */ |
|
142 | 142 | |
143 | 143 | public function get_height() { |
144 | 144 | return $this->height; |
145 | 145 | } |
146 | 146 | |
147 | - /** Returns calculated proportional width from the given height |
|
148 | - * @param integer $resized_height |
|
149 | - * @return integer */ |
|
147 | + /** Returns calculated proportional width from the given height |
|
148 | + * @param integer $resized_height |
|
149 | + * @return integer */ |
|
150 | 150 | |
151 | 151 | public function get_prop_width($resized_height) { |
152 | 152 | $width = intval(($this->width * $resized_height) / $this->height); |
@@ -154,9 +154,9 @@ discard block |
||
154 | 154 | return $width; |
155 | 155 | } |
156 | 156 | |
157 | - /** Returns calculated proportional height from the given width |
|
158 | - * @param integer $resized_width |
|
159 | - * @return integer */ |
|
157 | + /** Returns calculated proportional height from the given width |
|
158 | + * @param integer $resized_width |
|
159 | + * @return integer */ |
|
160 | 160 | |
161 | 161 | public function get_prop_height($resized_width) { |
162 | 162 | $height = intval(($this->height * $resized_width) / $this->width); |
@@ -164,11 +164,11 @@ discard block |
||
164 | 164 | return $height; |
165 | 165 | } |
166 | 166 | |
167 | - /** Returns an array with calculated proportional width & height. |
|
168 | - * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. |
|
169 | - * The other dimension (height or width) will be calculated autamaticaly |
|
170 | - * @param integer $bigger_size |
|
171 | - * @return array */ |
|
167 | + /** Returns an array with calculated proportional width & height. |
|
168 | + * The parameter $bigger_size is the bigger dimension (width or height) of calculated sizes. |
|
169 | + * The other dimension (height or width) will be calculated autamaticaly |
|
170 | + * @param integer $bigger_size |
|
171 | + * @return array */ |
|
172 | 172 | |
173 | 173 | public function get_prop_size($bigger_size) { |
174 | 174 | |
@@ -186,10 +186,10 @@ discard block |
||
186 | 186 | return array($width, $height); |
187 | 187 | } |
188 | 188 | |
189 | - /** Resize image. Returns TRUE on success or FALSE on failure |
|
190 | - * @param integer $width |
|
191 | - * @param integer $height |
|
192 | - * @return bool */ |
|
189 | + /** Resize image. Returns TRUE on success or FALSE on failure |
|
190 | + * @param integer $width |
|
191 | + * @param integer $height |
|
192 | + * @return bool */ |
|
193 | 193 | |
194 | 194 | public function resize($width, $height) { |
195 | 195 | if (!$width) $width = 1; |
@@ -203,10 +203,10 @@ discard block |
||
203 | 203 | ); |
204 | 204 | } |
205 | 205 | |
206 | - /** Resize the given image source (GD, gd object or image file path) to fit in the own image. |
|
207 | - * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure |
|
208 | - * @param mixed $src |
|
209 | - * @return bool */ |
|
206 | + /** Resize the given image source (GD, gd object or image file path) to fit in the own image. |
|
207 | + * The outside ares will be cropped out. Returns TRUE on success or FALSE on failure |
|
208 | + * @param mixed $src |
|
209 | + * @return bool */ |
|
210 | 210 | |
211 | 211 | public function resize_crop($src) { |
212 | 212 | $image_details = $this->build_image($src); |
@@ -233,10 +233,10 @@ discard block |
||
233 | 233 | return false; |
234 | 234 | } |
235 | 235 | |
236 | - /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure |
|
237 | - * @param integer $width |
|
238 | - * @param integer $height |
|
239 | - * @return bool */ |
|
236 | + /** Resize image to fit in given resolution. Returns TRUE on success or FALSE on failure |
|
237 | + * @param integer $width |
|
238 | + * @param integer $height |
|
239 | + * @return bool */ |
|
240 | 240 | |
241 | 241 | public function resize_fit($width, $height) { |
242 | 242 | if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) |
@@ -250,12 +250,12 @@ discard block |
||
250 | 250 | return $this->resize($width, $height); |
251 | 251 | } |
252 | 252 | |
253 | - /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. |
|
254 | - * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, |
|
255 | - * no samo po edno (x ili y) izmerenie |
|
256 | - * @param integer $width |
|
257 | - * @param integer $height |
|
258 | - * @return bool */ |
|
253 | + /** Neka si predstavim vyobrazhaem pravoygylnik s razmeri $width i $height. |
|
254 | + * Izobrazhenieto shte se preorazmeri taka che to shte izliza ot tozi pravoygylnik, |
|
255 | + * no samo po edno (x ili y) izmerenie |
|
256 | + * @param integer $width |
|
257 | + * @param integer $height |
|
258 | + * @return bool */ |
|
259 | 259 | |
260 | 260 | public function resize_overflow($width, $height) { |
261 | 261 | |
@@ -368,30 +368,30 @@ discard block |
||
368 | 368 | |
369 | 369 | |
370 | 370 | |
371 | - /*** gif transparent fix - 1.10.2013 ***/ |
|
371 | + /*** gif transparent fix - 1.10.2013 ***/ |
|
372 | 372 | |
373 | - $transindex = imagecolortransparent($src); |
|
374 | - $palletsize = imagecolorstotal($src); |
|
375 | - if($transindex >= 0 && $transindex < $palletsize) { |
|
376 | - $transcol = imagecolorsforindex($src, $transindex); |
|
373 | + $transindex = imagecolortransparent($src); |
|
374 | + $palletsize = imagecolorstotal($src); |
|
375 | + if($transindex >= 0 && $transindex < $palletsize) { |
|
376 | + $transcol = imagecolorsforindex($src, $transindex); |
|
377 | 377 | |
378 | - /*** end gif transparent fix ***/ |
|
378 | + /*** end gif transparent fix ***/ |
|
379 | 379 | |
380 | - $transindex = imagecolorallocatealpha($this->image, $transcol['red'], $transcol['green'], $transcol['blue'], 127); |
|
381 | - imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex); |
|
382 | - imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); |
|
383 | - imagecolortransparent($this->image, $transindex); |
|
384 | - for($y=0; $y<$dst_h; ++$y) |
|
385 | - for($x=0; $x<$dst_w; ++$x) |
|
386 | - if(((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) imagesetpixel($this->image, $x, $y, $transindex); |
|
387 | - imagetruecolortopalette($this->image, true, 255); |
|
388 | - } |
|
389 | - else { |
|
390 | - $transparent = imagecolorallocatealpha($this->image, 255, 255, 255, 127); |
|
391 | - imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transparent); |
|
392 | - imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); |
|
393 | - } |
|
394 | - return $this->image; |
|
380 | + $transindex = imagecolorallocatealpha($this->image, $transcol['red'], $transcol['green'], $transcol['blue'], 127); |
|
381 | + imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transindex); |
|
382 | + imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); |
|
383 | + imagecolortransparent($this->image, $transindex); |
|
384 | + for($y=0; $y<$dst_h; ++$y) |
|
385 | + for($x=0; $x<$dst_w; ++$x) |
|
386 | + if(((imagecolorat($this->image, $x, $y)>>24) & 0x7F) >= 100) imagesetpixel($this->image, $x, $y, $transindex); |
|
387 | + imagetruecolortopalette($this->image, true, 255); |
|
388 | + } |
|
389 | + else { |
|
390 | + $transparent = imagecolorallocatealpha($this->image, 255, 255, 255, 127); |
|
391 | + imagefilledrectangle($this->image, 0, 0, $dst_w, $dst_h, $transparent); |
|
392 | + imagecopyresampled($this->image, $src, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h); |
|
393 | + } |
|
394 | + return $this->image; |
|
395 | 395 | |
396 | 396 | } else |
397 | 397 | return false; |
@@ -419,7 +419,7 @@ discard block |
||
419 | 419 | public function imagegif($filename=null) { |
420 | 420 | if (is_null($filename) && !headers_sent()) |
421 | 421 | header("Content-Type: image/gif"); |
422 | - @imagesavealpha($this->image, true); |
|
422 | + @imagesavealpha($this->image, true); |
|
423 | 423 | return imagegif($this->image, $filename); |
424 | 424 | } |
425 | 425 | } |
@@ -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. |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | 'dirnameChangeChars' => array( |
71 | 71 | ' ' => "_", |
72 | 72 | ':' => "." |
73 | - ), |
|
73 | + ), |
|
74 | 74 | 'mime_magic' => "", |
75 | 75 | |
76 | 76 | 'maxImageWidth' => $modx->config['maxImageWidth'], |
@@ -16,35 +16,35 @@ discard block |
||
16 | 16 | $install_language = "english"; |
17 | 17 | |
18 | 18 | $_langFiles= array ( |
19 | - "en" => "english", |
|
20 | - "bg" => "bulgarian", |
|
21 | - "cs" => "czech", |
|
22 | - "da" => "danish", |
|
23 | - "fi" => "finnish-utf8", |
|
24 | - "fr" => "francais-utf8", |
|
25 | - "de" => "german", |
|
26 | - "he" => "hebrew", |
|
27 | - "it" => "italian", |
|
28 | - "ja" => "japanese-utf8", |
|
29 | - "nl" => "nederlands-utf8", |
|
30 | - "no" => "norwegian", |
|
31 | - "fa" => "persian", |
|
32 | - "pl" => "polish-utf8", |
|
33 | - "pt" => "portuguese-br-utf8", |
|
19 | + "en" => "english", |
|
20 | + "bg" => "bulgarian", |
|
21 | + "cs" => "czech", |
|
22 | + "da" => "danish", |
|
23 | + "fi" => "finnish-utf8", |
|
24 | + "fr" => "francais-utf8", |
|
25 | + "de" => "german", |
|
26 | + "he" => "hebrew", |
|
27 | + "it" => "italian", |
|
28 | + "ja" => "japanese-utf8", |
|
29 | + "nl" => "nederlands-utf8", |
|
30 | + "no" => "norwegian", |
|
31 | + "fa" => "persian", |
|
32 | + "pl" => "polish-utf8", |
|
33 | + "pt" => "portuguese-br-utf8", |
|
34 | 34 | // "pt" => "portuguese", |
35 | - "ru" => "russian-UTF8", |
|
36 | - "es" => "spanish-utf8", |
|
37 | - "sv" => "svenska" |
|
35 | + "ru" => "russian-UTF8", |
|
36 | + "es" => "spanish-utf8", |
|
37 | + "sv" => "svenska" |
|
38 | 38 | ); |
39 | 39 | $_langISO6391 = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"],0,2); |
40 | 40 | if (!empty($_langFiles[$_langISO6391])) $install_language = $_langFiles[$_langISO6391]; |
41 | 41 | |
42 | 42 | |
43 | 43 | if (isset($_POST['language']) && !stristr($_POST['language'],"..")) { |
44 | - $install_language = $_POST['language']; |
|
44 | + $install_language = $_POST['language']; |
|
45 | 45 | } else { |
46 | - if (isset($_GET['language']) && !stristr($_GET['language'],"..")) |
|
47 | - $install_language = $_GET['language']; |
|
46 | + if (isset($_GET['language']) && !stristr($_GET['language'],"..")) |
|
47 | + $install_language = $_GET['language']; |
|
48 | 48 | } |
49 | 49 | # load language file |
50 | 50 | require_once("lang/english.inc.php"); // As fallback |
@@ -53,14 +53,14 @@ discard block |
||
53 | 53 | $manager_language = $install_language; |
54 | 54 | |
55 | 55 | if (isset($_POST['managerlanguage']) && !stristr($_POST['managerlanguage'],"..")) { |
56 | - $manager_language = $_POST['managerlanguage']; |
|
56 | + $manager_language = $_POST['managerlanguage']; |
|
57 | 57 | } else { |
58 | - if (isset($_GET['managerlanguage']) && !stristr($_GET['managerlanguage'],"..")) |
|
59 | - $manager_language = $_GET['managerlanguage']; |
|
58 | + if (isset($_GET['managerlanguage']) && !stristr($_GET['managerlanguage'],"..")) |
|
59 | + $manager_language = $_GET['managerlanguage']; |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | foreach($_lang as $k=>$v) |
63 | 63 | { |
64 | - if(strpos($v,'[+MGR_DIR+]')!==false) |
|
65 | - $_lang[$k] = str_replace('[+MGR_DIR+]', MGR_DIR, $v); |
|
64 | + if(strpos($v,'[+MGR_DIR+]')!==false) |
|
65 | + $_lang[$k] = str_replace('[+MGR_DIR+]', MGR_DIR, $v); |
|
66 | 66 | } |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | $autoloader = __DIR__.'/vendor/autoload.php'; |
49 | 49 | if (file_exists($autoloader) && is_readable($autoloader)) { |
50 | - include_once($autoloader); |
|
50 | + include_once($autoloader); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | if(is_file($base_path . 'assets/cache/siteManager.php')) |
57 | 57 | include_once($base_path . 'assets/cache/siteManager.php'); |
58 | 58 | if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) |
59 | - define('MGR_DIR', 'manager'); |
|
59 | + define('MGR_DIR', 'manager'); |
|
60 | 60 | if(is_file($base_path . 'assets/cache/siteHostnames.php')) |
61 | 61 | include_once($base_path . 'assets/cache/siteHostnames.php'); |
62 | 62 | if(!defined('MODX_SITE_HOSTNAMES')) |
63 | - define('MODX_SITE_HOSTNAMES', ''); |
|
63 | + define('MODX_SITE_HOSTNAMES', ''); |
|
64 | 64 | |
65 | 65 | // get start time |
66 | 66 | $mstart = memory_get_usage(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | define('IN_PARSER_MODE', true); |
86 | 86 | if ( ! defined('IN_MANAGER_MODE')) { |
87 | - define('IN_MANAGER_MODE', false); |
|
87 | + define('IN_MANAGER_MODE', false); |
|
88 | 88 | } |
89 | 89 | if (!defined('MODX_API_MODE')) { |
90 | 90 | define('MODX_API_MODE', false); |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | |
93 | 93 | // get the required includes |
94 | 94 | if(!isset($database_user) || $database_user=="") { |
95 | - $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php'); |
|
96 | - // Be sure config.inc.php is there and that it contains some important values |
|
97 | - if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) { |
|
98 | - readfile('install/not_installed.tpl'); |
|
99 | - exit; |
|
100 | - } |
|
95 | + $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php'); |
|
96 | + // Be sure config.inc.php is there and that it contains some important values |
|
97 | + if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) { |
|
98 | + readfile('install/not_installed.tpl'); |
|
99 | + exit; |
|
100 | + } |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | // start session |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | |
106 | 106 | // initiate a new document parser |
107 | 107 | if (isset($coreClass) && class_exists($coreClass)) { |
108 | - $modx = new $coreClass; |
|
108 | + $modx = new $coreClass; |
|
109 | 109 | } |
110 | 110 | if (!isset($modx) || !($modx instanceof \DocumentParser)) { |
111 | - include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
112 | - $modx = new \DocumentParser; |
|
111 | + include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
112 | + $modx = new \DocumentParser; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | // set some parser options |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | echo "<span class=\"notok\" style='color:#707070'>".$_lang['setup_database_selection_failed']."</span>".$_lang['setup_database_selection_failed_note']."</p>"; |
86 | 86 | $create = true; |
87 | 87 | } else { |
88 | - if (function_exists('mysqli_set_charset')) mysqli_set_charset($conn, $database_charset); |
|
88 | + if (function_exists('mysqli_set_charset')) mysqli_set_charset($conn, $database_charset); |
|
89 | 89 | mysqli_query($conn, "{$database_connection_method} {$database_connection_charset}"); |
90 | 90 | echo '<span class="ok">'.$_lang['ok']."</span></p>"; |
91 | 91 | } |
@@ -280,23 +280,23 @@ discard block |
||
280 | 280 | |
281 | 281 | // Reset database for installation of demo-site |
282 | 282 | if ($installData && $moduleSQLDataFile && $moduleSQLResetFile) { |
283 | - echo "<p>" . $_lang['resetting_database']; |
|
284 | - $sqlParser->process($moduleSQLResetFile); |
|
285 | - // display database results |
|
286 | - if ($sqlParser->installFailed == true) { |
|
287 | - $errors += 1; |
|
288 | - echo "<span class=\"notok\"><b>" . $_lang['database_alerts'] . "</span></p>"; |
|
289 | - echo "<p>" . $_lang['setup_couldnt_install'] . "</p>"; |
|
290 | - echo "<p>" . $_lang['installation_error_occured'] . "<br /><br />"; |
|
291 | - for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) { |
|
292 | - echo "<em>" . $sqlParser->mysqlErrors[$i]["error"] . "</em>" . $_lang['during_execution_of_sql'] . "<span class='mono'>" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . "</span>.<hr />"; |
|
293 | - } |
|
294 | - echo "</p>"; |
|
295 | - echo "<p>" . $_lang['some_tables_not_updated'] . "</p>"; |
|
296 | - return; |
|
297 | - } else { |
|
298 | - echo '<span class="ok">'.$_lang['ok']."</span></p>"; |
|
299 | - } |
|
283 | + echo "<p>" . $_lang['resetting_database']; |
|
284 | + $sqlParser->process($moduleSQLResetFile); |
|
285 | + // display database results |
|
286 | + if ($sqlParser->installFailed == true) { |
|
287 | + $errors += 1; |
|
288 | + echo "<span class=\"notok\"><b>" . $_lang['database_alerts'] . "</span></p>"; |
|
289 | + echo "<p>" . $_lang['setup_couldnt_install'] . "</p>"; |
|
290 | + echo "<p>" . $_lang['installation_error_occured'] . "<br /><br />"; |
|
291 | + for ($i = 0; $i < count($sqlParser->mysqlErrors); $i++) { |
|
292 | + echo "<em>" . $sqlParser->mysqlErrors[$i]["error"] . "</em>" . $_lang['during_execution_of_sql'] . "<span class='mono'>" . strip_tags($sqlParser->mysqlErrors[$i]["sql"]) . "</span>.<hr />"; |
|
293 | + } |
|
294 | + echo "</p>"; |
|
295 | + echo "<p>" . $_lang['some_tables_not_updated'] . "</p>"; |
|
296 | + return; |
|
297 | + } else { |
|
298 | + echo '<span class="ok">'.$_lang['ok']."</span></p>"; |
|
299 | + } |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | // Install Templates |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | $tRow = mysqli_fetch_assoc($ts); |
419 | 419 | $templateId = $tRow['id']; |
420 | 420 | mysqli_query($sqlParser->conn, "INSERT INTO $dbase.`" . $table_prefix . "site_tmplvar_templates` (tmplvarid, templateid) VALUES($id, $templateId)"); |
421 | - } |
|
421 | + } |
|
422 | 422 | } |
423 | 423 | } |
424 | 424 | } |
@@ -687,51 +687,51 @@ discard block |
||
687 | 687 | |
688 | 688 | // Install Dependencies |
689 | 689 | foreach ($moduleDependencies as $dependency) { |
690 | - $ds = mysqli_query($sqlParser->conn, 'SELECT id, guid FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_modules` WHERE name="' . $dependency['module'] . '"'); |
|
691 | - if (!$ds) { |
|
692 | - echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
693 | - return; |
|
694 | - } else { |
|
695 | - $row = mysqli_fetch_assoc($ds); |
|
696 | - $moduleId = $row["id"]; |
|
697 | - $moduleGuid = $row["guid"]; |
|
698 | - } |
|
699 | - // get extra id |
|
700 | - $ds = mysqli_query($sqlParser->conn, 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE ' . $dependency['column'] . '="' . $dependency['name'] . '"'); |
|
701 | - if (!$ds) { |
|
702 | - echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
703 | - return; |
|
704 | - } else { |
|
705 | - $row = mysqli_fetch_assoc($ds); |
|
706 | - $extraId = $row["id"]; |
|
707 | - } |
|
708 | - // setup extra as module dependency |
|
709 | - $ds = mysqli_query($sqlParser->conn, 'SELECT module FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type'] . ' LIMIT 1'); |
|
710 | - if (!$ds) { |
|
711 | - echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
712 | - return; |
|
713 | - } else { |
|
714 | - if (mysqli_num_rows($ds) === 0) { |
|
715 | - mysqli_query($sqlParser->conn, 'INSERT INTO ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` (module, resource, type) VALUES(' . $moduleId . ',' . $extraId . ',' . $dependency['type'] . ')'); |
|
716 | - echo '<p> ' . $dependency['module'] . ' Module: <span class="ok">' . $_lang['depedency_create'] . '</span></p>'; |
|
717 | - } else { |
|
718 | - mysqli_query($sqlParser->conn, 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` SET module = ' . $moduleId . ', resource = ' . $extraId . ', type = ' . $dependency['type'] . ' WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type']); |
|
719 | - echo '<p> ' . $dependency['module'] . ' Module: <span class="ok">' . $_lang['depedency_update'] . '</span></p>'; |
|
720 | - } |
|
721 | - if ($dependency['type'] == 30 || $dependency['type'] == 40) { |
|
722 | - // set extra guid for plugins and snippets |
|
723 | - $ds = mysqli_query($sqlParser->conn, 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE id=' . $extraId . ' LIMIT 1'); |
|
724 | - if (!$ds) { |
|
725 | - echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
726 | - return; |
|
727 | - } else { |
|
728 | - if (mysqli_num_rows($ds) != 0) { |
|
729 | - mysqli_query($sqlParser->conn, 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` SET moduleguid = ' . $moduleGuid . ' WHERE id=' . $extraId); |
|
730 | - echo '<p> ' . $dependency['name'] . ': <span class="ok">' . $_lang['guid_set'] . '</span></p>'; |
|
731 | - } |
|
732 | - } |
|
733 | - } |
|
734 | - } |
|
690 | + $ds = mysqli_query($sqlParser->conn, 'SELECT id, guid FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_modules` WHERE name="' . $dependency['module'] . '"'); |
|
691 | + if (!$ds) { |
|
692 | + echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
693 | + return; |
|
694 | + } else { |
|
695 | + $row = mysqli_fetch_assoc($ds); |
|
696 | + $moduleId = $row["id"]; |
|
697 | + $moduleGuid = $row["guid"]; |
|
698 | + } |
|
699 | + // get extra id |
|
700 | + $ds = mysqli_query($sqlParser->conn, 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE ' . $dependency['column'] . '="' . $dependency['name'] . '"'); |
|
701 | + if (!$ds) { |
|
702 | + echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
703 | + return; |
|
704 | + } else { |
|
705 | + $row = mysqli_fetch_assoc($ds); |
|
706 | + $extraId = $row["id"]; |
|
707 | + } |
|
708 | + // setup extra as module dependency |
|
709 | + $ds = mysqli_query($sqlParser->conn, 'SELECT module FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type'] . ' LIMIT 1'); |
|
710 | + if (!$ds) { |
|
711 | + echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
712 | + return; |
|
713 | + } else { |
|
714 | + if (mysqli_num_rows($ds) === 0) { |
|
715 | + mysqli_query($sqlParser->conn, 'INSERT INTO ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` (module, resource, type) VALUES(' . $moduleId . ',' . $extraId . ',' . $dependency['type'] . ')'); |
|
716 | + echo '<p> ' . $dependency['module'] . ' Module: <span class="ok">' . $_lang['depedency_create'] . '</span></p>'; |
|
717 | + } else { |
|
718 | + mysqli_query($sqlParser->conn, 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_module_depobj` SET module = ' . $moduleId . ', resource = ' . $extraId . ', type = ' . $dependency['type'] . ' WHERE module=' . $moduleId . ' AND resource=' . $extraId . ' AND type=' . $dependency['type']); |
|
719 | + echo '<p> ' . $dependency['module'] . ' Module: <span class="ok">' . $_lang['depedency_update'] . '</span></p>'; |
|
720 | + } |
|
721 | + if ($dependency['type'] == 30 || $dependency['type'] == 40) { |
|
722 | + // set extra guid for plugins and snippets |
|
723 | + $ds = mysqli_query($sqlParser->conn, 'SELECT id FROM ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` WHERE id=' . $extraId . ' LIMIT 1'); |
|
724 | + if (!$ds) { |
|
725 | + echo "<p>" . mysqli_error($sqlParser->conn) . "</p>"; |
|
726 | + return; |
|
727 | + } else { |
|
728 | + if (mysqli_num_rows($ds) != 0) { |
|
729 | + mysqli_query($sqlParser->conn, 'UPDATE ' . $dbase . '`' . $sqlParser->prefix . 'site_' . $dependency['table'] . '` SET moduleguid = ' . $moduleGuid . ' WHERE id=' . $extraId); |
|
730 | + echo '<p> ' . $dependency['name'] . ': <span class="ok">' . $_lang['guid_set'] . '</span></p>'; |
|
731 | + } |
|
732 | + } |
|
733 | + } |
|
734 | + } |
|
735 | 735 | } |
736 | 736 | |
737 | 737 | // call back function |