@@ -200,7 +200,6 @@ |
||
| 200 | 200 | |
| 201 | 201 | /** Resize and crop the image to fit in given resolution. Returns TRUE on |
| 202 | 202 | * success or FALSE on failure |
| 203 | - * @param mixed $src |
|
| 204 | 203 | * @param integer $offset |
| 205 | 204 | * @return bool */ |
| 206 | 205 | abstract public function resizeCrop($width, $height, $offset=false); |
@@ -1,46 +1,46 @@ 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 | { |
| 17 | 17 | const DEFAULT_JPEG_QUALITY = 75; |
| 18 | 18 | |
| 19 | 19 | /** Image resource or object |
| 20 | - * @var mixed */ |
|
| 20 | + * @var mixed */ |
|
| 21 | 21 | protected $image; |
| 22 | 22 | |
| 23 | 23 | /** Image width in pixels |
| 24 | - * @var integer */ |
|
| 24 | + * @var integer */ |
|
| 25 | 25 | protected $width; |
| 26 | 26 | |
| 27 | 27 | /** Image height in pixels |
| 28 | - * @var integer */ |
|
| 28 | + * @var integer */ |
|
| 29 | 29 | protected $height; |
| 30 | 30 | |
| 31 | 31 | /** Init error |
| 32 | - * @var bool */ |
|
| 32 | + * @var bool */ |
|
| 33 | 33 | protected $initError = false; |
| 34 | 34 | |
| 35 | 35 | /** Driver specific options |
| 36 | - * @var array */ |
|
| 36 | + * @var array */ |
|
| 37 | 37 | protected $options = array(); |
| 38 | 38 | |
| 39 | 39 | |
| 40 | 40 | /** Magic method which allows read-only access to all protected or private |
| 41 | - * class properties |
|
| 42 | - * @param string $property |
|
| 43 | - * @return mixed */ |
|
| 41 | + * class properties |
|
| 42 | + * @param string $property |
|
| 43 | + * @return mixed */ |
|
| 44 | 44 | |
| 45 | 45 | final public function __get($property) |
| 46 | 46 | { |
@@ -49,15 +49,15 @@ discard block |
||
| 49 | 49 | |
| 50 | 50 | |
| 51 | 51 | /** Constructor. Parameter $image should be: |
| 52 | - * 1. An instance of image driver class (copy instance). |
|
| 53 | - * 2. An image represented by the type of the $image property |
|
| 54 | - * (resource or object). |
|
| 55 | - * 3. An array with two elements. First - width, second - height. |
|
| 56 | - * Creates a blank image. |
|
| 57 | - * 4. A filename string. Get image form file. |
|
| 58 | - * Second paramaeter is used by pass some specific image driver options |
|
| 59 | - * @param mixed $image |
|
| 60 | - * @param array $options */ |
|
| 52 | + * 1. An instance of image driver class (copy instance). |
|
| 53 | + * 2. An image represented by the type of the $image property |
|
| 54 | + * (resource or object). |
|
| 55 | + * 3. An array with two elements. First - width, second - height. |
|
| 56 | + * Creates a blank image. |
|
| 57 | + * 4. A filename string. Get image form file. |
|
| 58 | + * Second paramaeter is used by pass some specific image driver options |
|
| 59 | + * @param mixed $image |
|
| 60 | + * @param array $options */ |
|
| 61 | 61 | |
| 62 | 62 | public function __construct($image, array $options=array()) |
| 63 | 63 | { |
@@ -74,10 +74,10 @@ discard block |
||
| 74 | 74 | |
| 75 | 75 | |
| 76 | 76 | /** Factory pattern to load selected driver. $image and $options are passed |
| 77 | - * to the constructor of the image driver |
|
| 78 | - * @param string $driver |
|
| 79 | - * @param mixed $image |
|
| 80 | - * @return object */ |
|
| 77 | + * to the constructor of the image driver |
|
| 78 | + * @param string $driver |
|
| 79 | + * @param mixed $image |
|
| 80 | + * @return object */ |
|
| 81 | 81 | |
| 82 | 82 | final public static function factory($driver, $image, array $options=array()) |
| 83 | 83 | { |
@@ -87,9 +87,9 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | /** Checks if the drivers in the array parameter could be used. Returns first |
| 90 | - * found one |
|
| 91 | - * @param array $drivers |
|
| 92 | - * @return string */ |
|
| 90 | + * found one |
|
| 91 | + * @param array $drivers |
|
| 92 | + * @return string */ |
|
| 93 | 93 | |
| 94 | 94 | final public static function getDriver(array $drivers=array('gd')) |
| 95 | 95 | { |
@@ -110,9 +110,9 @@ discard block |
||
| 110 | 110 | |
| 111 | 111 | |
| 112 | 112 | /** Returns an array. Element 0 - image resource. Element 1 - width. Element 2 - height. |
| 113 | - * Returns FALSE on failure. |
|
| 114 | - * @param mixed $image |
|
| 115 | - * @return array */ |
|
| 113 | + * Returns FALSE on failure. |
|
| 114 | + * @param mixed $image |
|
| 115 | + * @return array */ |
|
| 116 | 116 | |
| 117 | 117 | final protected function buildImage($image) |
| 118 | 118 | { |
@@ -137,8 +137,8 @@ discard block |
||
| 137 | 137 | |
| 138 | 138 | |
| 139 | 139 | /** Returns calculated proportional width from the given height |
| 140 | - * @param integer $resizedHeight |
|
| 141 | - * @return integer */ |
|
| 140 | + * @param integer $resizedHeight |
|
| 141 | + * @return integer */ |
|
| 142 | 142 | |
| 143 | 143 | final public function getPropWidth($resizedHeight) |
| 144 | 144 | { |
@@ -151,8 +151,8 @@ discard block |
||
| 151 | 151 | |
| 152 | 152 | |
| 153 | 153 | /** Returns calculated proportional height from the given width |
| 154 | - * @param integer $resizedWidth |
|
| 155 | - * @return integer */ |
|
| 154 | + * @param integer $resizedWidth |
|
| 155 | + * @return integer */ |
|
| 156 | 156 | |
| 157 | 157 | final public function getPropHeight($resizedWidth) |
| 158 | 158 | { |
@@ -165,51 +165,51 @@ discard block |
||
| 165 | 165 | |
| 166 | 166 | |
| 167 | 167 | /** Checks if PHP needs some extra extensions to use the image driver. This |
| 168 | - * static method should be implemented into driver classes like abstract |
|
| 169 | - * methods |
|
| 170 | - * @return bool */ |
|
| 168 | + * static method should be implemented into driver classes like abstract |
|
| 169 | + * methods |
|
| 170 | + * @return bool */ |
|
| 171 | 171 | public static function available() |
| 172 | 172 | { |
| 173 | 173 | return false; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | 176 | /** Checks if file is an image. This static method should be implemented into |
| 177 | - * driver classes like abstract methods |
|
| 178 | - * @param string $file |
|
| 179 | - * @return bool */ |
|
| 177 | + * driver classes like abstract methods |
|
| 178 | + * @param string $file |
|
| 179 | + * @return bool */ |
|
| 180 | 180 | public static function checkImage($file) |
| 181 | 181 | { |
| 182 | 182 | return false; |
| 183 | 183 | } |
| 184 | 184 | |
| 185 | 185 | /** Resize image. Should return TRUE on success or FALSE on failure |
| 186 | - * @param integer $width |
|
| 187 | - * @param integer $height |
|
| 188 | - * @return bool */ |
|
| 186 | + * @param integer $width |
|
| 187 | + * @param integer $height |
|
| 188 | + * @return bool */ |
|
| 189 | 189 | abstract public function resize($width, $height); |
| 190 | 190 | |
| 191 | 191 | /** Resize image to fit in given resolution. Should returns TRUE on success |
| 192 | - * or FALSE on failure. If $background is set, the image size will be |
|
| 193 | - * $width x $height and the empty spaces (if any) will be filled with defined |
|
| 194 | - * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) |
|
| 195 | - * @param integer $width |
|
| 196 | - * @param integer $height |
|
| 197 | - * @param mixed $background |
|
| 198 | - * @return bool */ |
|
| 192 | + * or FALSE on failure. If $background is set, the image size will be |
|
| 193 | + * $width x $height and the empty spaces (if any) will be filled with defined |
|
| 194 | + * color. Background color examples: "#5f5", "#ff67ca", array(255, 255, 255) |
|
| 195 | + * @param integer $width |
|
| 196 | + * @param integer $height |
|
| 197 | + * @param mixed $background |
|
| 198 | + * @return bool */ |
|
| 199 | 199 | abstract public function resizeFit($width, $height, $background=false); |
| 200 | 200 | |
| 201 | 201 | /** Resize and crop the image to fit in given resolution. Returns TRUE on |
| 202 | - * success or FALSE on failure |
|
| 203 | - * @param mixed $src |
|
| 204 | - * @param integer $offset |
|
| 205 | - * @return bool */ |
|
| 202 | + * success or FALSE on failure |
|
| 203 | + * @param mixed $src |
|
| 204 | + * @param integer $offset |
|
| 205 | + * @return bool */ |
|
| 206 | 206 | abstract public function resizeCrop($width, $height, $offset=false); |
| 207 | 207 | |
| 208 | 208 | |
| 209 | 209 | /** Rotate image |
| 210 | - * @param integer $angle |
|
| 211 | - * @param string $background |
|
| 212 | - * @return bool */ |
|
| 210 | + * @param integer $angle |
|
| 211 | + * @param string $background |
|
| 212 | + * @return bool */ |
|
| 213 | 213 | abstract public function rotate($angle, $background="#000000"); |
| 214 | 214 | |
| 215 | 215 | abstract public function flipHorizontal(); |
@@ -217,43 +217,43 @@ discard block |
||
| 217 | 217 | abstract public function flipVertical(); |
| 218 | 218 | |
| 219 | 219 | /** Apply a PNG or GIF watermark to the image. $top and $left parameters sets |
| 220 | - * the offset of the watermark in pixels. Boolean and NULL values are possible |
|
| 221 | - * too. In default case (FALSE, FALSE) the watermark should be applyed to |
|
| 222 | - * the bottom right corner. NULL values means center aligning. If the |
|
| 223 | - * watermark is bigger than the image or it's partialy or fully outside the |
|
| 224 | - * image, it shoudn't be applied |
|
| 225 | - * @param string $file |
|
| 226 | - * @param mixed $top |
|
| 227 | - * @param mixed $left |
|
| 228 | - * @return bool */ |
|
| 220 | + * the offset of the watermark in pixels. Boolean and NULL values are possible |
|
| 221 | + * too. In default case (FALSE, FALSE) the watermark should be applyed to |
|
| 222 | + * the bottom right corner. NULL values means center aligning. If the |
|
| 223 | + * watermark is bigger than the image or it's partialy or fully outside the |
|
| 224 | + * image, it shoudn't be applied |
|
| 225 | + * @param string $file |
|
| 226 | + * @param mixed $top |
|
| 227 | + * @param mixed $left |
|
| 228 | + * @return bool */ |
|
| 229 | 229 | abstract public function watermark($file, $left=false, $top=false); |
| 230 | 230 | |
| 231 | 231 | /** Should output the image. Second parameter is used to pass some options like |
| 232 | - * 'file' - if is set, the output will be written to a file |
|
| 233 | - * 'quality' - compression quality |
|
| 234 | - * It's possible to use extra specific options required by image type ($type) |
|
| 235 | - * @param string $type |
|
| 236 | - * @param array $options |
|
| 237 | - * @return bool */ |
|
| 232 | + * 'file' - if is set, the output will be written to a file |
|
| 233 | + * 'quality' - compression quality |
|
| 234 | + * It's possible to use extra specific options required by image type ($type) |
|
| 235 | + * @param string $type |
|
| 236 | + * @param array $options |
|
| 237 | + * @return bool */ |
|
| 238 | 238 | abstract public function output($type='jpeg', array $options=array()); |
| 239 | 239 | |
| 240 | 240 | /** This method should create a blank image with selected size. Should returns |
| 241 | - * resource or object related to the created image, which will be passed to |
|
| 242 | - * $image property |
|
| 243 | - * @param integer $width |
|
| 244 | - * @param integer $height |
|
| 245 | - * @return mixed */ |
|
| 241 | + * resource or object related to the created image, which will be passed to |
|
| 242 | + * $image property |
|
| 243 | + * @param integer $width |
|
| 244 | + * @param integer $height |
|
| 245 | + * @return mixed */ |
|
| 246 | 246 | abstract protected function getBlankImage($width, $height); |
| 247 | 247 | |
| 248 | 248 | /** This method should create an image from source image. Only first parameter |
| 249 | - * ($image) is input. Its type should be filename string or a type of the |
|
| 250 | - * $image property. See the constructor reference for details. The |
|
| 251 | - * parametters $width and $height are output only. Should returns resource or |
|
| 252 | - * object related to the created image, which will be passed to $image |
|
| 253 | - * property |
|
| 254 | - * @param mixed $image |
|
| 255 | - * @param integer $width |
|
| 256 | - * @param integer $height |
|
| 257 | - * @return mixed */ |
|
| 249 | + * ($image) is input. Its type should be filename string or a type of the |
|
| 250 | + * $image property. See the constructor reference for details. The |
|
| 251 | + * parametters $width and $height are output only. Should returns resource or |
|
| 252 | + * object related to the created image, which will be passed to $image |
|
| 253 | + * property |
|
| 254 | + * @param mixed $image |
|
| 255 | + * @param integer $width |
|
| 256 | + * @param integer $height |
|
| 257 | + * @return mixed */ |
|
| 258 | 258 | abstract protected function getImage($image, &$width, &$height); |
| 259 | 259 | } |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | * @param mixed $image |
| 60 | 60 | * @param array $options */ |
| 61 | 61 | |
| 62 | - public function __construct($image, array $options=array()) |
|
| 62 | + public function __construct($image, array $options = array()) |
|
| 63 | 63 | { |
| 64 | 64 | $this->image = $this->width = $this->height = null; |
| 65 | 65 | $imageDetails = $this->buildImage($image); |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | * @param mixed $image |
| 80 | 80 | * @return object */ |
| 81 | 81 | |
| 82 | - final public static function factory($driver, $image, array $options=array()) |
|
| 82 | + final public static function factory($driver, $image, array $options = array()) |
|
| 83 | 83 | { |
| 84 | 84 | $class = "image_$driver"; |
| 85 | 85 | return new $class($image, $options); |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | * @param array $drivers |
| 92 | 92 | * @return string */ |
| 93 | 93 | |
| 94 | - final public static function getDriver(array $drivers=array('gd')) |
|
| 94 | + final public static function getDriver(array $drivers = array('gd')) |
|
| 95 | 95 | { |
| 96 | 96 | foreach ($drivers as $driver) { |
| 97 | 97 | if (!preg_match('/^[a-z0-9\_]+$/i', $driver)) { |
@@ -196,21 +196,21 @@ discard block |
||
| 196 | 196 | * @param integer $height |
| 197 | 197 | * @param mixed $background |
| 198 | 198 | * @return bool */ |
| 199 | - abstract public function resizeFit($width, $height, $background=false); |
|
| 199 | + abstract public function resizeFit($width, $height, $background = false); |
|
| 200 | 200 | |
| 201 | 201 | /** Resize and crop the image to fit in given resolution. Returns TRUE on |
| 202 | 202 | * success or FALSE on failure |
| 203 | 203 | * @param mixed $src |
| 204 | 204 | * @param integer $offset |
| 205 | 205 | * @return bool */ |
| 206 | - abstract public function resizeCrop($width, $height, $offset=false); |
|
| 206 | + abstract public function resizeCrop($width, $height, $offset = false); |
|
| 207 | 207 | |
| 208 | 208 | |
| 209 | 209 | /** Rotate image |
| 210 | 210 | * @param integer $angle |
| 211 | 211 | * @param string $background |
| 212 | 212 | * @return bool */ |
| 213 | - abstract public function rotate($angle, $background="#000000"); |
|
| 213 | + abstract public function rotate($angle, $background = "#000000"); |
|
| 214 | 214 | |
| 215 | 215 | abstract public function flipHorizontal(); |
| 216 | 216 | |
@@ -226,7 +226,7 @@ discard block |
||
| 226 | 226 | * @param mixed $top |
| 227 | 227 | * @param mixed $left |
| 228 | 228 | * @return bool */ |
| 229 | - abstract public function watermark($file, $left=false, $top=false); |
|
| 229 | + abstract public function watermark($file, $left = false, $top = false); |
|
| 230 | 230 | |
| 231 | 231 | /** Should output the image. Second parameter is used to pass some options like |
| 232 | 232 | * 'file' - if is set, the output will be written to a file |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | * @param string $type |
| 236 | 236 | * @param array $options |
| 237 | 237 | * @return bool */ |
| 238 | - abstract public function output($type='jpeg', array $options=array()); |
|
| 238 | + abstract public function output($type = 'jpeg', array $options = array()); |
|
| 239 | 239 | |
| 240 | 240 | /** This method should create a blank image with selected size. Should returns |
| 241 | 241 | * resource or object related to the created image, which will be passed to |
@@ -368,6 +368,11 @@ |
||
| 368 | 368 | return imagecolorallocate($this->image, $r, $g, $b); |
| 369 | 369 | } |
| 370 | 370 | |
| 371 | + /** |
|
| 372 | + * @param integer $x1 |
|
| 373 | + * @param integer $y1 |
|
| 374 | + * @param boolean $color |
|
| 375 | + */ |
|
| 371 | 376 | protected function imageFilledRectangle($x1, $y1, $x2, $y2, $color) |
| 372 | 377 | { |
| 373 | 378 | $color = $this->gdColor($color); |
@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc GD 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 GD 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 | class image_gd extends image |
| 16 | 16 | { |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | ); |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - public function resizeFit($width, $height, $background=false) |
|
| 38 | + public function resizeFit($width, $height, $background = false) |
|
| 39 | 39 | { |
| 40 | 40 | if ((!$width && !$height) || (($width == $this->width) && ($height == $this->height))) { |
| 41 | 41 | return true; |
@@ -79,7 +79,7 @@ discard block |
||
| 79 | 79 | } |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | - public function resizeCrop($width, $height, $offset=false) |
|
| 82 | + public function resizeCrop($width, $height, $offset = false) |
|
| 83 | 83 | { |
| 84 | 84 | if (($this->width / $this->height) > ($width / $height)) { |
| 85 | 85 | $h = $height; |
@@ -138,7 +138,7 @@ discard block |
||
| 138 | 138 | return $return; |
| 139 | 139 | } |
| 140 | 140 | |
| 141 | - public function rotate($angle, $background="#000000") |
|
| 141 | + public function rotate($angle, $background = "#000000") |
|
| 142 | 142 | { |
| 143 | 143 | $angle = -$angle; |
| 144 | 144 | $img = @imagerotate($this->image, $angle, $this->gdColor($background)); |
@@ -177,7 +177,7 @@ discard block |
||
| 177 | 177 | return true; |
| 178 | 178 | } |
| 179 | 179 | |
| 180 | - public function watermark($file, $left=false, $top=false) |
|
| 180 | + public function watermark($file, $left = false, $top = false) |
|
| 181 | 181 | { |
| 182 | 182 | $info = getimagesize($file); |
| 183 | 183 | list($w, $h, $t) = $info; |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | return true; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - public function output($type='jpeg', array $options=array()) |
|
| 222 | + public function output($type = 'jpeg', array $options = array()) |
|
| 223 | 223 | { |
| 224 | 224 | $method = "output_$type"; |
| 225 | 225 | if (!method_exists($this, $method)) { |
@@ -252,11 +252,11 @@ discard block |
||
| 252 | 252 | (false !== (list($width, $height, $t) = @getimagesize($image))) |
| 253 | 253 | ) { |
| 254 | 254 | $image = |
| 255 | - ($t == IMAGETYPE_GIF) ? @imagecreatefromgif($image) : ( |
|
| 255 | + ($t == IMAGETYPE_GIF) ? @imagecreatefromgif($image) : ( |
|
| 256 | 256 | ($t == IMAGETYPE_WBMP) ? @imagecreatefromwbmp($image) : ( |
| 257 | 257 | ($t == IMAGETYPE_JPEG) ? @imagecreatefromjpeg($image) : ( |
| 258 | - ($t == IMAGETYPE_PNG) ? @imagecreatefrompng($image) : ( |
|
| 259 | - ($t == IMAGETYPE_XBM) ? @imagecreatefromxbm($image) : false |
|
| 258 | + ($t == IMAGETYPE_PNG) ? @imagecreatefrompng($image) : ( |
|
| 259 | + ($t == IMAGETYPE_XBM) ? @imagecreatefromxbm($image) : false |
|
| 260 | 260 | )))); |
| 261 | 261 | |
| 262 | 262 | return $image; |
@@ -282,11 +282,11 @@ discard block |
||
| 282 | 282 | } |
| 283 | 283 | |
| 284 | 284 | $img = |
| 285 | - ($t == IMAGETYPE_GIF) ? @imagecreatefromgif($file) : ( |
|
| 285 | + ($t == IMAGETYPE_GIF) ? @imagecreatefromgif($file) : ( |
|
| 286 | 286 | ($t == IMAGETYPE_WBMP) ? @imagecreatefromwbmp($file) : ( |
| 287 | 287 | ($t == IMAGETYPE_JPEG) ? @imagecreatefromjpeg($file) : ( |
| 288 | - ($t == IMAGETYPE_PNG) ? @imagecreatefrompng($file) : ( |
|
| 289 | - ($t == IMAGETYPE_XBM) ? @imagecreatefromxbm($file) : false |
|
| 288 | + ($t == IMAGETYPE_PNG) ? @imagecreatefrompng($file) : ( |
|
| 289 | + ($t == IMAGETYPE_XBM) ? @imagecreatefromxbm($file) : false |
|
| 290 | 290 | )))); |
| 291 | 291 | |
| 292 | 292 | return ($img !== false); |
@@ -295,7 +295,7 @@ discard block |
||
| 295 | 295 | |
| 296 | 296 | // OWN METHODS |
| 297 | 297 | |
| 298 | - protected function output_png(array $options=array()) |
|
| 298 | + protected function output_png(array $options = array()) |
|
| 299 | 299 | { |
| 300 | 300 | $file = isset($options['file']) ? $options['file'] : null; |
| 301 | 301 | $quality = isset($options['quality']) ? $options['quality'] : null; |
@@ -307,7 +307,7 @@ discard block |
||
| 307 | 307 | return imagepng($this->image, $file, $quality, $filters); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - protected function output_jpeg(array $options=array()) |
|
| 310 | + protected function output_jpeg(array $options = array()) |
|
| 311 | 311 | { |
| 312 | 312 | $file = isset($options['file']) ? $options['file'] : null; |
| 313 | 313 | $quality = isset($options['quality']) |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | return imagejpeg($this->image, $file, $quality); |
| 320 | 320 | } |
| 321 | 321 | |
| 322 | - protected function output_gif(array $options=array()) |
|
| 322 | + protected function output_gif(array $options = array()) |
|
| 323 | 323 | { |
| 324 | 324 | $file = isset($options['file']) ? $options['file'] : null; |
| 325 | 325 | if (isset($options['file']) && !headers_sent()) { |
@@ -378,8 +378,8 @@ discard block |
||
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | protected function imageCopyResampled( |
| 381 | - $src, $dstX=0, $dstY=0, $srcX=0, $srcY=0, $dstW=null, $dstH=null, $srcW=null, $srcH=null |
|
| 382 | - ) { |
|
| 381 | + $src, $dstX = 0, $dstY = 0, $srcX = 0, $srcY = 0, $dstW = null, $dstH = null, $srcW = null, $srcH = null |
|
| 382 | + ){ |
|
| 383 | 383 | $imageDetails = $this->buildImage($src); |
| 384 | 384 | |
| 385 | 385 | if ($imageDetails === false) { |
@@ -19,6 +19,9 @@ discard block |
||
| 19 | 19 | protected $root; |
| 20 | 20 | protected $ignored; |
| 21 | 21 | |
| 22 | + /** |
|
| 23 | + * @param string $folder |
|
| 24 | + */ |
|
| 22 | 25 | public function __construct($file, $folder, $ignored=null) |
| 23 | 26 | { |
| 24 | 27 | $this->zip = new ZipArchive(); |
@@ -42,6 +45,9 @@ discard block |
||
| 42 | 45 | $this->zip->close(); |
| 43 | 46 | } |
| 44 | 47 | |
| 48 | + /** |
|
| 49 | + * @param string $folder |
|
| 50 | + */ |
|
| 45 | 51 | public function zip($folder, $parent=null) |
| 46 | 52 | { |
| 47 | 53 | $full_path = "{$this->root}$parent$folder"; |
@@ -1,17 +1,17 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project. The class are taken from |
| 4 | - * http://www.php.net/manual/en/function.ziparchive-addemptydir.php |
|
| 5 | - * |
|
| 6 | - * @desc Directory to ZIP file archivator |
|
| 7 | - * @package KCFinder |
|
| 8 | - * @version 2.54 |
|
| 9 | - * @author Pavel Tzonkov <[email protected]> |
|
| 10 | - * @copyright 2010-2014 KCFinder Project |
|
| 11 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 12 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 13 | - * @link http://kcfinder.sunhater.com |
|
| 14 | - */ |
|
| 4 | + * http://www.php.net/manual/en/function.ziparchive-addemptydir.php |
|
| 5 | + * |
|
| 6 | + * @desc Directory to ZIP file archivator |
|
| 7 | + * @package KCFinder |
|
| 8 | + * @version 2.54 |
|
| 9 | + * @author Pavel Tzonkov <[email protected]> |
|
| 10 | + * @copyright 2010-2014 KCFinder Project |
|
| 11 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
| 12 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
| 13 | + * @link http://kcfinder.sunhater.com |
|
| 14 | + */ |
|
| 15 | 15 | |
| 16 | 16 | class zipFolder |
| 17 | 17 | { |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | protected $root; |
| 20 | 20 | protected $ignored; |
| 21 | 21 | |
| 22 | - public function __construct($file, $folder, $ignored=null) |
|
| 22 | + public function __construct($file, $folder, $ignored = null) |
|
| 23 | 23 | { |
| 24 | 24 | $this->zip = new ZipArchive(); |
| 25 | 25 | |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | $this->zip->close(); |
| 43 | 43 | } |
| 44 | 44 | |
| 45 | - public function zip($folder, $parent=null) |
|
| 45 | + public function zip($folder, $parent = null) |
|
| 46 | 46 | { |
| 47 | 47 | $full_path = "{$this->root}$parent$folder"; |
| 48 | 48 | $zip_path = "$parent$folder"; |
@@ -102,7 +102,6 @@ discard block |
||
| 102 | 102 | |
| 103 | 103 | /** Checks if the given file is really writable. The standard PHP function |
| 104 | 104 | * is_writable() does not work properly on Windows servers. |
| 105 | - * @param string $dir |
|
| 106 | 105 | * @return bool */ |
| 107 | 106 | |
| 108 | 107 | public static function isWritable($filename) |
@@ -116,7 +115,6 @@ discard block |
||
| 116 | 115 | } |
| 117 | 116 | |
| 118 | 117 | /** Get the extension from filename |
| 119 | - * @param string $file |
|
| 120 | 118 | * @param bool $toLower |
| 121 | 119 | * @return string */ |
| 122 | 120 | |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc File helper 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 File helper 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 | class file |
| 16 | 16 | { |
@@ -101,9 +101,9 @@ discard block |
||
| 101 | 101 | ); |
| 102 | 102 | |
| 103 | 103 | /** Checks if the given file is really writable. The standard PHP function |
| 104 | - * is_writable() does not work properly on Windows servers. |
|
| 105 | - * @param string $dir |
|
| 106 | - * @return bool */ |
|
| 104 | + * is_writable() does not work properly on Windows servers. |
|
| 105 | + * @param string $dir |
|
| 106 | + * @return bool */ |
|
| 107 | 107 | |
| 108 | 108 | public static function isWritable($filename) |
| 109 | 109 | { |
@@ -116,9 +116,9 @@ discard block |
||
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | /** Get the extension from filename |
| 119 | - * @param string $file |
|
| 120 | - * @param bool $toLower |
|
| 121 | - * @return string */ |
|
| 119 | + * @param string $file |
|
| 120 | + * @param bool $toLower |
|
| 121 | + * @return string */ |
|
| 122 | 122 | |
| 123 | 123 | public static function getExtension($filename, $toLower=true) |
| 124 | 124 | { |
@@ -127,15 +127,15 @@ discard block |
||
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | /** Get MIME type of the given filename. If Fileinfo PHP extension is |
| 130 | - * available the MIME type will be fetched by the file's content. The |
|
| 131 | - * second parameter is optional and defines the magic file path. If you |
|
| 132 | - * skip it, the default one will be loaded. |
|
| 133 | - * If Fileinfo PHP extension is not available the MIME type will be fetched |
|
| 134 | - * by filename extension regarding $MIME property. If the file extension |
|
| 135 | - * does not exist there, returned type will be application/octet-stream |
|
| 136 | - * @param string $filename |
|
| 137 | - * @param string $magic |
|
| 138 | - * @return string */ |
|
| 130 | + * available the MIME type will be fetched by the file's content. The |
|
| 131 | + * second parameter is optional and defines the magic file path. If you |
|
| 132 | + * skip it, the default one will be loaded. |
|
| 133 | + * If Fileinfo PHP extension is not available the MIME type will be fetched |
|
| 134 | + * by filename extension regarding $MIME property. If the file extension |
|
| 135 | + * does not exist there, returned type will be application/octet-stream |
|
| 136 | + * @param string $filename |
|
| 137 | + * @param string $magic |
|
| 138 | + * @return string */ |
|
| 139 | 139 | |
| 140 | 140 | public static function getMimeType($filename, $magic=null) |
| 141 | 141 | { |
@@ -154,25 +154,25 @@ discard block |
||
| 154 | 154 | } |
| 155 | 155 | |
| 156 | 156 | /** Get inexistant filename based on the given filename. If you skip $dir |
| 157 | - * parameter the directory will be fetched from $filename and returned |
|
| 158 | - * value will be full filename path. The third parameter is optional and |
|
| 159 | - * defines the template, the filename will be renamed to. Default template |
|
| 160 | - * is {name}({sufix}){ext}. Examples: |
|
| 161 | - * |
|
| 162 | - * file::getInexistantFilename("/my/directory/myfile.txt"); |
|
| 163 | - * If myfile.txt does not exist - returns the same path to the file |
|
| 164 | - * otherwise returns "/my/directory/myfile(1).txt" |
|
| 165 | - * |
|
| 166 | - * file::getInexistantFilename("myfile.txt", "/my/directory"); |
|
| 167 | - * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... |
|
| 168 | - * |
|
| 169 | - * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); |
|
| 170 | - * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... |
|
| 171 | - * |
|
| 172 | - * @param string $filename |
|
| 173 | - * @param string $dir |
|
| 174 | - * @param string $tpl |
|
| 175 | - * @return string */ |
|
| 157 | + * parameter the directory will be fetched from $filename and returned |
|
| 158 | + * value will be full filename path. The third parameter is optional and |
|
| 159 | + * defines the template, the filename will be renamed to. Default template |
|
| 160 | + * is {name}({sufix}){ext}. Examples: |
|
| 161 | + * |
|
| 162 | + * file::getInexistantFilename("/my/directory/myfile.txt"); |
|
| 163 | + * If myfile.txt does not exist - returns the same path to the file |
|
| 164 | + * otherwise returns "/my/directory/myfile(1).txt" |
|
| 165 | + * |
|
| 166 | + * file::getInexistantFilename("myfile.txt", "/my/directory"); |
|
| 167 | + * returns "myfile.txt" or "myfile(1).txt" or "myfile(2).txt" etc... |
|
| 168 | + * |
|
| 169 | + * file::getInexistantFilename("myfile.txt", "/dir", "{name}[{sufix}]{ext}"); |
|
| 170 | + * returns "myfile.txt" or "myfile[1].txt" or "myfile[2].txt" etc... |
|
| 171 | + * |
|
| 172 | + * @param string $filename |
|
| 173 | + * @param string $dir |
|
| 174 | + * @param string $tpl |
|
| 175 | + * @return string */ |
|
| 176 | 176 | |
| 177 | 177 | public static function getInexistantFilename($filename, $dir=null, $tpl=null) |
| 178 | 178 | { |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | * @param bool $toLower |
| 121 | 121 | * @return string */ |
| 122 | 122 | |
| 123 | - public static function getExtension($filename, $toLower=true) |
|
| 123 | + public static function getExtension($filename, $toLower = true) |
|
| 124 | 124 | { |
| 125 | 125 | return preg_match('/^.*\.([^\.]*)$/s', $filename, $patt) |
| 126 | 126 | ? ($toLower ? strtolower($patt[1]) : $patt[1]) : ""; |
@@ -137,7 +137,7 @@ discard block |
||
| 137 | 137 | * @param string $magic |
| 138 | 138 | * @return string */ |
| 139 | 139 | |
| 140 | - public static function getMimeType($filename, $magic=null) |
|
| 140 | + public static function getMimeType($filename, $magic = null) |
|
| 141 | 141 | { |
| 142 | 142 | if (class_exists("finfo")) { |
| 143 | 143 | $finfo = ($magic === null) |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | * @param string $tpl |
| 175 | 175 | * @return string */ |
| 176 | 176 | |
| 177 | - public static function getInexistantFilename($filename, $dir=null, $tpl=null) |
|
| 177 | + public static function getInexistantFilename($filename, $dir = null, $tpl = null) |
|
| 178 | 178 | { |
| 179 | 179 | if ($tpl === null) { |
| 180 | 180 | $tpl = "{name}({sufix}){ext}"; |
@@ -196,13 +196,13 @@ discard block |
||
| 196 | 196 | $i = 1; |
| 197 | 197 | $file = "$dir/$filename"; |
| 198 | 198 | while (file_exists($file)) { |
| 199 | - $file = "$dir/" . str_replace('{sufix}', $i++, $tpl); |
|
| 199 | + $file = "$dir/".str_replace('{sufix}', $i++, $tpl); |
|
| 200 | 200 | } |
| 201 | 201 | |
| 202 | 202 | return $fullPath |
| 203 | 203 | ? $file |
| 204 | 204 | : (strlen($fdir) |
| 205 | - ? "$fdir/" . basename($file) |
|
| 205 | + ? "$fdir/".basename($file) |
|
| 206 | 206 | : basename($file)); |
| 207 | 207 | } |
| 208 | 208 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | * ----------------------------- |
| 46 | 46 | */ |
| 47 | 47 | |
| 48 | -$autoloader = __DIR__ . '/vendor/autoload.php'; |
|
| 48 | +$autoloader = __DIR__.'/vendor/autoload.php'; |
|
| 49 | 49 | if (file_exists($autoloader) && is_readable($autoloader)) { |
| 50 | 50 | include_once($autoloader); |
| 51 | 51 | } |
@@ -54,15 +54,15 @@ discard block |
||
| 54 | 54 | $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | -$base_path = str_replace('\\', '/', dirname(__FILE__)) . '/'; |
|
| 58 | -if (is_file($base_path . 'assets/cache/siteManager.php')) { |
|
| 59 | - include_once($base_path . 'assets/cache/siteManager.php'); |
|
| 57 | +$base_path = str_replace('\\', '/', dirname(__FILE__)).'/'; |
|
| 58 | +if (is_file($base_path.'assets/cache/siteManager.php')) { |
|
| 59 | + include_once($base_path.'assets/cache/siteManager.php'); |
|
| 60 | 60 | } |
| 61 | 61 | if (!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
| 62 | 62 | define('MGR_DIR', 'manager'); |
| 63 | 63 | } |
| 64 | -if (is_file($base_path . 'assets/cache/siteHostnames.php')) { |
|
| 65 | - include_once($base_path . 'assets/cache/siteHostnames.php'); |
|
| 64 | +if (is_file($base_path.'assets/cache/siteHostnames.php')) { |
|
| 65 | + include_once($base_path.'assets/cache/siteHostnames.php'); |
|
| 66 | 66 | } |
| 67 | 67 | if (!defined('MODX_SITE_HOSTNAMES')) { |
| 68 | 68 | define('MODX_SITE_HOSTNAMES', ''); |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | $mstart = memory_get_usage(); |
| 73 | 73 | |
| 74 | 74 | // harden it |
| 75 | -require_once(dirname(__FILE__) . '/' . MGR_DIR . '/includes/protect.inc.php'); |
|
| 75 | +require_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/protect.inc.php'); |
|
| 76 | 76 | |
| 77 | 77 | // set some settings, and address some IE issues |
| 78 | 78 | @ini_set('url_rewriter.tags', ''); |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | */ |
| 90 | 90 | |
| 91 | 91 | define('IN_PARSER_MODE', true); |
| 92 | -if (! defined('IN_MANAGER_MODE')) { |
|
| 92 | +if (!defined('IN_MANAGER_MODE')) { |
|
| 93 | 93 | define('IN_MANAGER_MODE', false); |
| 94 | 94 | } |
| 95 | 95 | if (!defined('MODX_API_MODE')) { |
@@ -97,8 +97,8 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | // get the required includes |
| 100 | -if (!isset($database_user) || $database_user=="") { |
|
| 101 | - $rt = @include_once(dirname(__FILE__) . '/' . MGR_DIR . '/includes/config.inc.php'); |
|
| 100 | +if (!isset($database_user) || $database_user == "") { |
|
| 101 | + $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php'); |
|
| 102 | 102 | // Be sure config.inc.php is there and that it contains some important values |
| 103 | 103 | if (!$rt || !$database_type || !$database_server || !$database_user || !$dbase) { |
| 104 | 104 | readfile('install/not_installed.tpl'); |
@@ -114,7 +114,7 @@ discard block |
||
| 114 | 114 | $modx = new $coreClass; |
| 115 | 115 | } |
| 116 | 116 | if (!isset($modx) || !($modx instanceof \DocumentParser)) { |
| 117 | - include_once(MODX_MANAGER_PATH . 'includes/document.parser.class.inc.php'); |
|
| 117 | + include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
| 118 | 118 | $modx = DocumentParser::getInstance(); |
| 119 | 119 | } |
| 120 | 120 | |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | * content |
| 49 | 49 | */ |
| 50 | 50 | |
| 51 | -$autoloader = realpath(__DIR__ . '/../vendor/autoload.php'); |
|
| 51 | +$autoloader = realpath(__DIR__.'/../vendor/autoload.php'); |
|
| 52 | 52 | if (file_exists($autoloader) && is_readable($autoloader)) { |
| 53 | 53 | include_once($autoloader); |
| 54 | 54 | } |
@@ -58,17 +58,17 @@ discard block |
||
| 58 | 58 | $mstart = memory_get_usage(); |
| 59 | 59 | $self = str_replace('\\', '/', __FILE__); |
| 60 | 60 | $self_dir = str_replace('/index.php', '', $self); |
| 61 | -$mgr_dir = substr($self_dir, strrpos($self_dir, '/')+1); |
|
| 62 | -$base_path = str_replace($mgr_dir . '/index.php', '', $self); |
|
| 63 | -$site_mgr_path = $base_path . 'assets/cache/siteManager.php'; |
|
| 61 | +$mgr_dir = substr($self_dir, strrpos($self_dir, '/') + 1); |
|
| 62 | +$base_path = str_replace($mgr_dir.'/index.php', '', $self); |
|
| 63 | +$site_mgr_path = $base_path.'assets/cache/siteManager.php'; |
|
| 64 | 64 | if (is_file($site_mgr_path)) { |
| 65 | 65 | include_once($site_mgr_path); |
| 66 | 66 | } |
| 67 | -$site_hostnames_path = $base_path . 'assets/cache/siteHostnames.php'; |
|
| 67 | +$site_hostnames_path = $base_path.'assets/cache/siteHostnames.php'; |
|
| 68 | 68 | if (is_file($site_hostnames_path)) { |
| 69 | 69 | include_once($site_hostnames_path); |
| 70 | 70 | } |
| 71 | -if (!defined('MGR_DIR') || MGR_DIR!==$mgr_dir) { |
|
| 71 | +if (!defined('MGR_DIR') || MGR_DIR !== $mgr_dir) { |
|
| 72 | 72 | $src = "<?php\n"; |
| 73 | 73 | $src .= "define('MGR_DIR', '{$mgr_dir}');\n"; |
| 74 | 74 | $rs = file_put_contents($site_mgr_path, $src); |
@@ -77,13 +77,13 @@ discard block |
||
| 77 | 77 | exit; |
| 78 | 78 | } |
| 79 | 79 | sleep(1); |
| 80 | - header('Location:' . $_SERVER['REQUEST_URI']); |
|
| 80 | + header('Location:'.$_SERVER['REQUEST_URI']); |
|
| 81 | 81 | exit; |
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | // we use this to make sure files are accessed through |
| 85 | 85 | // the manager instead of seperately. |
| 86 | -if (! defined('IN_MANAGER_MODE')) { |
|
| 86 | +if (!defined('IN_MANAGER_MODE')) { |
|
| 87 | 87 | define('IN_MANAGER_MODE', true); |
| 88 | 88 | } |
| 89 | 89 | |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | |
| 93 | 93 | // send anti caching headers |
| 94 | 94 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); |
| 95 | -header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
| 95 | +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); |
|
| 96 | 96 | header("Cache-Control: no-store, no-cache, must-revalidate"); |
| 97 | 97 | header("Cache-Control: post-check=0, pre-check=0", false); |
| 98 | 98 | header("Pragma: no-cache"); |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | include_once "includes/lang/english.inc.php"; |
| 105 | 105 | |
| 106 | 106 | // check PHP version. EVO is compatible with php 5 (5.0.0+) |
| 107 | -$php_ver_comp = version_compare(phpversion(), "5.0.0"); |
|
| 107 | +$php_ver_comp = version_compare(phpversion(), "5.0.0"); |
|
| 108 | 108 | // -1 if left is less, 0 if equal, +1 if left is higher |
| 109 | 109 | if ($php_ver_comp < 0) { |
| 110 | 110 | echo sprintf($_lang['php_version_check'], phpversion()); |
@@ -118,8 +118,8 @@ discard block |
||
| 118 | 118 | } |
| 119 | 119 | |
| 120 | 120 | // set some runtime options |
| 121 | -$incPath = str_replace("\\", "/", dirname(__FILE__) . "/includes/"); // Mod by Raymond |
|
| 122 | -set_include_path(get_include_path() . PATH_SEPARATOR . $incPath); |
|
| 121 | +$incPath = str_replace("\\", "/", dirname(__FILE__)."/includes/"); // Mod by Raymond |
|
| 122 | +set_include_path(get_include_path().PATH_SEPARATOR.$incPath); |
|
| 123 | 123 | |
| 124 | 124 | if (!defined('ENT_COMPAT')) { |
| 125 | 125 | define('ENT_COMPAT', 2); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | |
| 134 | 134 | // set the document_root :| |
| 135 | 135 | if (!isset($_SERVER['DOCUMENT_ROOT']) || empty($_SERVER['DOCUMENT_ROOT'])) { |
| 136 | - $_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['PATH_INFO'], "", preg_replace("/\\\\/", "/", $_SERVER['PATH_TRANSLATED'])) . "/"; |
|
| 136 | + $_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['PATH_INFO'], "", preg_replace("/\\\\/", "/", $_SERVER['PATH_TRANSLATED']))."/"; |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | // include_once config file |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | $modx = new $coreClass; |
| 153 | 153 | } |
| 154 | 154 | if (!isset($modx) || !($modx instanceof DocumentParser)) { |
| 155 | - include_once(MODX_MANAGER_PATH . 'includes/document.parser.class.inc.php'); |
|
| 155 | + include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
| 156 | 156 | $modx = evolutionCMS(); |
| 157 | 157 | } |
| 158 | 158 | |
@@ -171,35 +171,35 @@ discard block |
||
| 171 | 171 | // Now that session is given get user settings and merge into $modx->config |
| 172 | 172 | $usersettings = $modx->getUserSettings(); |
| 173 | 173 | |
| 174 | -$settings =& $modx->config; |
|
| 174 | +$settings = & $modx->config; |
|
| 175 | 175 | extract($modx->config, EXTR_OVERWRITE); |
| 176 | 176 | |
| 177 | 177 | // now include_once different language file as english |
| 178 | -if (!isset($manager_language) || !file_exists(MODX_MANAGER_PATH . "includes/lang/" . $manager_language . ".inc.php")) { |
|
| 178 | +if (!isset($manager_language) || !file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) { |
|
| 179 | 179 | $manager_language = "english"; // if not set, get the english language file. |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | // $length_eng_lang = count($_lang); // Not used for now, required for difference-check with other languages than english (i.e. inside installer) |
| 183 | 183 | |
| 184 | -if ($manager_language!="english" && file_exists(MODX_MANAGER_PATH . "includes/lang/" . $manager_language . ".inc.php")) { |
|
| 185 | - include_once "lang/" . $manager_language . ".inc.php"; |
|
| 184 | +if ($manager_language != "english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) { |
|
| 185 | + include_once "lang/".$manager_language.".inc.php"; |
|
| 186 | 186 | } |
| 187 | 187 | |
| 188 | 188 | // allow custom language overrides not altered by future EVO-updates |
| 189 | -if (file_exists(MODX_MANAGER_PATH . "includes/lang/override/" . $manager_language . ".inc.php")) { |
|
| 190 | - include_once "lang/override/" . $manager_language . ".inc.php"; |
|
| 189 | +if (file_exists(MODX_MANAGER_PATH."includes/lang/override/".$manager_language.".inc.php")) { |
|
| 190 | + include_once "lang/override/".$manager_language.".inc.php"; |
|
| 191 | 191 | } |
| 192 | 192 | |
| 193 | 193 | $s = array('[+MGR_DIR+]'); |
| 194 | 194 | $r = array(MGR_DIR); |
| 195 | 195 | foreach ($_lang as $k=>$v) { |
| 196 | - if (strpos($v, '[+')!==false) { |
|
| 196 | + if (strpos($v, '[+') !== false) { |
|
| 197 | 197 | $_lang[$k] = str_replace($s, $r, $v); |
| 198 | 198 | } |
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | // send the charset header |
| 202 | -header('Content-Type: text/html; charset=' . $modx_manager_charset); |
|
| 202 | +header('Content-Type: text/html; charset='.$modx_manager_charset); |
|
| 203 | 203 | |
| 204 | 204 | /* |
| 205 | 205 | * include_once "version.inc.php"; //include version info. Use $modx->getVersionData() |
@@ -217,11 +217,11 @@ discard block |
||
| 217 | 217 | // include_once the style variables file |
| 218 | 218 | if (isset($manager_theme) && !isset($_style)) { |
| 219 | 219 | $_style = array(); |
| 220 | - include_once "media/style/" . $manager_theme . "/style.php"; |
|
| 220 | + include_once "media/style/".$manager_theme."/style.php"; |
|
| 221 | 221 | } |
| 222 | 222 | |
| 223 | 223 | // check if user is allowed to access manager interface |
| 224 | -if (isset($allow_manager_access) && $allow_manager_access==0) { |
|
| 224 | +if (isset($allow_manager_access) && $allow_manager_access == 0) { |
|
| 225 | 225 | include_once "manager.lockout.inc.php"; |
| 226 | 226 | } |
| 227 | 227 | |
@@ -234,8 +234,8 @@ discard block |
||
| 234 | 234 | // first we check to see if this is a frameset request |
| 235 | 235 | if (!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) { |
| 236 | 236 | // this looks to be a top-level frameset request, so let's serve up a frameset |
| 237 | - if (is_file(MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/frames/1.php")) { |
|
| 238 | - include_once "media/style/" . $manager_theme . "/frames/1.php"; |
|
| 237 | + if (is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) { |
|
| 238 | + include_once "media/style/".$manager_theme."/frames/1.php"; |
|
| 239 | 239 | } else { |
| 240 | 240 | include_once "frames/1.php"; |
| 241 | 241 | } |
@@ -243,7 +243,7 @@ discard block |
||
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | // OK, let's retrieve the action directive from the request |
| 246 | -$option = array('min_range'=>1,'max_range'=>2000); |
|
| 246 | +$option = array('min_range'=>1, 'max_range'=>2000); |
|
| 247 | 247 | if (isset($_GET['a']) && isset($_POST['a'])) { |
| 248 | 248 | $modx->webAlertAndQuit($_lang['error_double_action']); |
| 249 | 249 | } elseif (isset($_GET['a'])) { |
@@ -262,12 +262,12 @@ discard block |
||
| 262 | 262 | $modx->manager->action = $action; |
| 263 | 263 | |
| 264 | 264 | // attempt to foil some simple types of CSRF attacks |
| 265 | -if (isset($modx->config['validate_referer']) && (int)$modx->config['validate_referer']) { |
|
| 265 | +if (isset($modx->config['validate_referer']) && (int) $modx->config['validate_referer']) { |
|
| 266 | 266 | if (isset($_SERVER['HTTP_REFERER'])) { |
| 267 | 267 | $referer = $_SERVER['HTTP_REFERER']; |
| 268 | 268 | |
| 269 | 269 | if (!empty($referer)) { |
| 270 | - if (!preg_match('/^' . preg_quote(MODX_SITE_URL, '/') . '/i', $referer)) { |
|
| 270 | + if (!preg_match('/^'.preg_quote(MODX_SITE_URL, '/').'/i', $referer)) { |
|
| 271 | 271 | $modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php"); |
| 272 | 272 | } |
| 273 | 273 | } else { |
@@ -285,8 +285,8 @@ discard block |
||
| 285 | 285 | function includeFileProcessor($filepath, $manager_theme) |
| 286 | 286 | { |
| 287 | 287 | $element = ""; |
| 288 | - if (is_file(MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/" . $filepath)) { |
|
| 289 | - $element = MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/" . $filepath; |
|
| 288 | + if (is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) { |
|
| 289 | + $element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath; |
|
| 290 | 290 | } else { |
| 291 | 291 | $element = $filepath; |
| 292 | 292 | } |
@@ -301,10 +301,10 @@ discard block |
||
| 301 | 301 | case 1: |
| 302 | 302 | // get the requested frame |
| 303 | 303 | $frame = preg_replace('/[^a-z0-9]/i', '', $_REQUEST['f']); |
| 304 | - if ($frame>9) { |
|
| 305 | - $enable_debug=false; // this is to stop the debug thingy being attached to the framesets |
|
| 304 | + if ($frame > 9) { |
|
| 305 | + $enable_debug = false; // this is to stop the debug thingy being attached to the framesets |
|
| 306 | 306 | } |
| 307 | - include_once(includeFileProcessor("frames/" . $frame . ".php", $manager_theme)); |
|
| 307 | + include_once(includeFileProcessor("frames/".$frame.".php", $manager_theme)); |
|
| 308 | 308 | break; |
| 309 | 309 | /********************************************************************/ |
| 310 | 310 | /* show the homepage */ |
@@ -992,9 +992,9 @@ discard block |
||
| 992 | 992 | // say that what was requested doesn't do anything yet |
| 993 | 993 | include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); |
| 994 | 994 | echo " |
| 995 | - <div class='sectionHeader'>" . $_lang['functionnotimpl'] . "</div> |
|
| 995 | + <div class='sectionHeader'>" . $_lang['functionnotimpl']."</div> |
|
| 996 | 996 | <div class='sectionBody'> |
| 997 | - <p>" . $_lang['functionnotimpl_message'] . "</p> |
|
| 997 | + <p>" . $_lang['functionnotimpl_message']."</p> |
|
| 998 | 998 | </div> |
| 999 | 999 | "; |
| 1000 | 1000 | include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); |
@@ -1002,7 +1002,7 @@ discard block |
||
| 1002 | 1002 | |
| 1003 | 1003 | /********************************************************************/ |
| 1004 | 1004 | // log action, unless it's a frame request |
| 1005 | -if ($action!=1 && $action!=7 && $action!=2) { |
|
| 1005 | +if ($action != 1 && $action != 7 && $action != 2) { |
|
| 1006 | 1006 | include_once "log.class.inc.php"; |
| 1007 | 1007 | $log = new logHandler; |
| 1008 | 1008 | $log->initAndWriteLog(); |
@@ -39,13 +39,13 @@ discard block |
||
| 39 | 39 | case 'publishedon': |
| 40 | 40 | case 'pub_date': |
| 41 | 41 | case 'unpub_date': |
| 42 | - $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.' . $_SESSION['tree_sortby'], 'sc.' . $_SESSION['tree_sortby']); |
|
| 42 | + $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.'.$_SESSION['tree_sortby'], 'sc.'.$_SESSION['tree_sortby']); |
|
| 43 | 43 | break; |
| 44 | 44 | default: |
| 45 | - $sortby = 'sc.' . $_SESSION['tree_sortby']; |
|
| 45 | + $sortby = 'sc.'.$_SESSION['tree_sortby']; |
|
| 46 | 46 | }; |
| 47 | 47 | |
| 48 | - $orderby = $modx->db->escape($sortby . ' ' . $_SESSION['tree_sortdir']); |
|
| 48 | + $orderby = $modx->db->escape($sortby.' '.$_SESSION['tree_sortdir']); |
|
| 49 | 49 | |
| 50 | 50 | // Folder sorting gets special setup ;) Add menuindex and pagetitle |
| 51 | 51 | if ($_SESSION['tree_sortby'] == 'isfolder') { |
@@ -59,11 +59,11 @@ discard block |
||
| 59 | 59 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
| 60 | 60 | $showProtected = false; |
| 61 | 61 | if (isset($modx->config['tree_show_protected'])) { |
| 62 | - $showProtected = (boolean)$modx->config['tree_show_protected']; |
|
| 62 | + $showProtected = (boolean) $modx->config['tree_show_protected']; |
|
| 63 | 63 | } |
| 64 | - $mgrRole = (isset($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
| 64 | + $mgrRole = (isset($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
| 65 | 65 | if ($showProtected == false) { |
| 66 | - $access = "AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
| 66 | + $access = "AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
| 67 | 67 | } else { |
| 68 | 68 | $access = ''; |
| 69 | 69 | } |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | } |
| 100 | 100 | |
| 101 | 101 | $weblinkDisplay = $row['type'] == 'reference' ? sprintf(' %s', $_style['tree_linkgo']) : ''; |
| 102 | - $pageIdDisplay = '<small>(' . ($modx_textdir ? '‏' : '') . $row['id'] . ')</small>'; |
|
| 102 | + $pageIdDisplay = '<small>('.($modx_textdir ? '‏' : '').$row['id'].')</small>'; |
|
| 103 | 103 | |
| 104 | 104 | // Prepare displaying user-locks |
| 105 | 105 | $lockedByUser = ''; |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | 'element_type' => $_lang["lock_element_type_7"], |
| 111 | 111 | 'lasthit_df' => $rowLock['lasthit_df'] |
| 112 | 112 | )); |
| 113 | - $lockedByUser = '<span title="' . $title . '" class="editResource">' . $_style['tree_preview_resource'] . '</span>'; |
|
| 113 | + $lockedByUser = '<span title="'.$title.'" class="editResource">'.$_style['tree_preview_resource'].'</span>'; |
|
| 114 | 114 | } else { |
| 115 | 115 | $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
| 116 | 116 | 'element_type' => $_lang["lock_element_type_7"], |
@@ -118,9 +118,9 @@ discard block |
||
| 118 | 118 | 'lasthit_df' => $rowLock['lasthit_df'] |
| 119 | 119 | )); |
| 120 | 120 | if ($modx->hasPermission('remove_locks')) { |
| 121 | - $lockedByUser = '<span onclick="modx.tree.unlockElement(7, ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>'; |
|
| 121 | + $lockedByUser = '<span onclick="modx.tree.unlockElement(7, '.$row['id'].', this);return false;" title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>'; |
|
| 122 | 122 | } else { |
| 123 | - $lockedByUser = '<span title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>'; |
|
| 123 | + $lockedByUser = '<span title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>'; |
|
| 124 | 124 | } |
| 125 | 125 | } |
| 126 | 126 | } |
@@ -129,22 +129,22 @@ discard block |
||
| 129 | 129 | |
| 130 | 130 | $title = ''; |
| 131 | 131 | if (isDateNode($nodeNameSource)) { |
| 132 | - $title = $_lang['pagetitle'] . ': ' . $row['pagetitle'] . '[+lf+]'; |
|
| 132 | + $title = $_lang['pagetitle'].': '.$row['pagetitle'].'[+lf+]'; |
|
| 133 | 133 | } |
| 134 | - $title .= $_lang['id'] . ': ' . $row['id']; |
|
| 135 | - $title .= '[+lf+]' . $_lang['resource_opt_menu_title'] . ': ' . $row['menutitle']; |
|
| 136 | - $title .= '[+lf+]' . $_lang['resource_opt_menu_index'] . ': ' . $row['menuindex']; |
|
| 137 | - $title .= '[+lf+]' . $_lang['alias'] . ': ' . (!empty($row['alias']) ? $row['alias'] : '-'); |
|
| 138 | - $title .= '[+lf+]' . $_lang['template'] . ': ' . $row['templatename']; |
|
| 139 | - $title .= '[+lf+]' . $_lang['publish_date'] . ': ' . $modx->toDateFormat($row['pub_date']); |
|
| 140 | - $title .= '[+lf+]' . $_lang['unpublish_date'] . ': ' . $modx->toDateFormat($row['unpub_date']); |
|
| 141 | - $title .= '[+lf+]' . $_lang['page_data_web_access'] . ': ' . ($row['privateweb'] ? $_lang['private'] : $_lang['public']); |
|
| 142 | - $title .= '[+lf+]' . $_lang['page_data_mgr_access'] . ': ' . ($row['privatemgr'] ? $_lang['private'] : $_lang['public']); |
|
| 143 | - $title .= '[+lf+]' . $_lang['resource_opt_richtext'] . ': ' . ($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
| 144 | - $title .= '[+lf+]' . $_lang['page_data_searchable'] . ': ' . ($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
| 145 | - $title .= '[+lf+]' . $_lang['page_data_cacheable'] . ': ' . ($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
| 134 | + $title .= $_lang['id'].': '.$row['id']; |
|
| 135 | + $title .= '[+lf+]'.$_lang['resource_opt_menu_title'].': '.$row['menutitle']; |
|
| 136 | + $title .= '[+lf+]'.$_lang['resource_opt_menu_index'].': '.$row['menuindex']; |
|
| 137 | + $title .= '[+lf+]'.$_lang['alias'].': '.(!empty($row['alias']) ? $row['alias'] : '-'); |
|
| 138 | + $title .= '[+lf+]'.$_lang['template'].': '.$row['templatename']; |
|
| 139 | + $title .= '[+lf+]'.$_lang['publish_date'].': '.$modx->toDateFormat($row['pub_date']); |
|
| 140 | + $title .= '[+lf+]'.$_lang['unpublish_date'].': '.$modx->toDateFormat($row['unpub_date']); |
|
| 141 | + $title .= '[+lf+]'.$_lang['page_data_web_access'].': '.($row['privateweb'] ? $_lang['private'] : $_lang['public']); |
|
| 142 | + $title .= '[+lf+]'.$_lang['page_data_mgr_access'].': '.($row['privatemgr'] ? $_lang['private'] : $_lang['public']); |
|
| 143 | + $title .= '[+lf+]'.$_lang['resource_opt_richtext'].': '.($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
| 144 | + $title .= '[+lf+]'.$_lang['page_data_searchable'].': '.($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
| 145 | + $title .= '[+lf+]'.$_lang['page_data_cacheable'].': '.($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
| 146 | 146 | $title = $modx->htmlspecialchars($title); |
| 147 | - $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back |
|
| 147 | + $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back |
|
| 148 | 148 | |
| 149 | 149 | $data = array( |
| 150 | 150 | 'id' => $row['id'], |
@@ -228,7 +228,7 @@ discard block |
||
| 228 | 228 | } |
| 229 | 229 | |
| 230 | 230 | if ($ph['contextmenu']) { |
| 231 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
| 231 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
| 232 | 232 | } |
| 233 | 233 | |
| 234 | 234 | if ($_SESSION['tree_show_only_folders']) { |
@@ -285,7 +285,7 @@ discard block |
||
| 285 | 285 | } |
| 286 | 286 | |
| 287 | 287 | if ($ph['contextmenu']) { |
| 288 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
| 288 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | $node .= $modx->parseText($tpl, $ph); |
@@ -323,7 +323,7 @@ discard block |
||
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | if ($ph['contextmenu']) { |
| 326 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
| 326 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
| 327 | 327 | } |
| 328 | 328 | |
| 329 | 329 | $node .= $modx->parseText($tpl, $ph); |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | } |
| 375 | 375 | |
| 376 | 376 | if ($ph['contextmenu']) { |
| 377 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
| 377 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
| 378 | 378 | } |
| 379 | 379 | |
| 380 | 380 | $node .= $modx->parseText($tpl, $ph); |
@@ -416,7 +416,7 @@ discard block |
||
| 416 | 416 | } |
| 417 | 417 | |
| 418 | 418 | if ($ph['contextmenu']) { |
| 419 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
| 419 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
| 420 | 420 | } |
| 421 | 421 | |
| 422 | 422 | $node .= $modx->parseText($tpl, $ph); |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | $nodetitle .= $modx->config['friendly_url_suffix']; |
| 494 | 494 | } |
| 495 | 495 | } |
| 496 | - $nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle; |
|
| 496 | + $nodetitle = $modx->config['friendly_url_prefix'].$nodetitle; |
|
| 497 | 497 | break; |
| 498 | 498 | case 'pagetitle': |
| 499 | 499 | $nodetitle = $row['pagetitle']; |
@@ -553,7 +553,7 @@ discard block |
||
| 553 | 553 | { |
| 554 | 554 | $modx = evolutionCMS(); |
| 555 | 555 | |
| 556 | - return (int)$modx->db->getValue($modx->db->query('SELECT count(*) FROM ' . $modx->getFullTableName('site_content') . ' WHERE parent=' . $parent . ' AND isfolder=' . $isfolder . ' ')); |
|
| 556 | + return (int) $modx->db->getValue($modx->db->query('SELECT count(*) FROM '.$modx->getFullTableName('site_content').' WHERE parent='.$parent.' AND isfolder='.$isfolder.' ')); |
|
| 557 | 557 | } |
| 558 | 558 | |
| 559 | 559 | /** |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 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 | |
@@ -36,19 +36,19 @@ discard block |
||
| 36 | 36 | |
| 37 | 37 | <?php if ($use_browser && $modx->hasPermission('assets_images')) {
|
| 38 | 38 | ?> |
| 39 | - <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a> |
|
| 39 | + <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a> |
|
| 40 | 40 | <?php |
| 41 | 41 | } ?> |
| 42 | 42 | |
| 43 | 43 | <?php if ($use_browser && $modx->hasPermission('assets_files')) {
|
| 44 | 44 | ?> |
| 45 | - <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a> |
|
| 45 | + <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a> |
|
| 46 | 46 | <?php |
| 47 | 47 | } ?> |
| 48 | 48 | |
| 49 | 49 | <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) {
|
| 50 | 50 | ?> |
| 51 | - <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a> |
|
| 51 | + <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a> |
|
| 52 | 52 | <?php |
| 53 | 53 | } ?> |
| 54 | 54 | |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 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 | |
| 6 | 6 | // invoke OnManagerTreeInit event |
| 7 | 7 | $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST);
|
| 8 | -if (is_array($evtOut)) {
|
|
| 8 | +if (is_array($evtOut)) { |
|
| 9 | 9 | echo implode("\n", $evtOut);
|
| 10 | 10 | } |
| 11 | 11 | ?> |
@@ -17,7 +17,7 @@ discard block |
||
| 17 | 17 | |
| 18 | 18 | <a class="treeButton" id="treeMenu_collapsetree" onclick="modx.tree.collapseTree();" title="<?php echo $_lang['collapse_tree']; ?>"><?php echo $_style['collapse_tree']; ?></a> |
| 19 | 19 | |
| 20 | - <?php if ($modx->hasPermission('new_document')) {
|
|
| 20 | + <?php if ($modx->hasPermission('new_document')) { |
|
| 21 | 21 | ?> |
| 22 | 22 | <a class="treeButton" id="treeMenu_addresource" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=4', title: '<?php echo $_lang['add_resource']; ?>'});" title="<?php echo $_lang['add_resource']; ?>"><?php echo $_style['add_doc_tree']; ?></a>
|
| 23 | 23 | <a class="treeButton" id="treeMenu_addweblink" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=72', title: '<?php echo $_lang['add_weblink']; ?>'});" title="<?php echo $_lang['add_weblink']; ?>"><?php echo $_style['add_weblink_tree']; ?></a>
|
@@ -28,31 +28,31 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | <a class="treeButton" id="treeMenu_sortingtree" onclick="modx.tree.showSorter(event);" title="<?php echo $_lang['sort_tree']; ?>"><?php echo $_style['sort_tree']; ?></a> |
| 30 | 30 | |
| 31 | - <?php if ($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
|
|
| 31 | + <?php if ($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
|
| 32 | 32 | ?> |
| 33 | 33 | <a class="treeButton" id="treeMenu_sortingindex" onclick="modx.tabs({url: '<?= MODX_MANAGER_URL ?>?a=56&id=0', title: '<?php echo $_lang['sort_menuindex']; ?>'});" title="<?php echo $_lang['sort_menuindex']; ?>"><?php echo $_style['sort_menuindex']; ?></a>
|
| 34 | 34 | <?php |
| 35 | 35 | } ?> |
| 36 | 36 | |
| 37 | - <?php if ($use_browser && $modx->hasPermission('assets_images')) {
|
|
| 37 | + <?php if ($use_browser && $modx->hasPermission('assets_images')) { |
|
| 38 | 38 | ?> |
| 39 | 39 | <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a> |
| 40 | 40 | <?php |
| 41 | 41 | } ?> |
| 42 | 42 | |
| 43 | - <?php if ($use_browser && $modx->hasPermission('assets_files')) {
|
|
| 43 | + <?php if ($use_browser && $modx->hasPermission('assets_files')) { |
|
| 44 | 44 | ?> |
| 45 | 45 | <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a> |
| 46 | 46 | <?php |
| 47 | 47 | } ?> |
| 48 | 48 | |
| 49 | - <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) {
|
|
| 49 | + <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { |
|
| 50 | 50 | ?> |
| 51 | 51 | <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a> |
| 52 | 52 | <?php |
| 53 | 53 | } ?> |
| 54 | 54 | |
| 55 | - <?php if ($modx->hasPermission('empty_trash')) {
|
|
| 55 | + <?php if ($modx->hasPermission('empty_trash')) { |
|
| 56 | 56 | ?> |
| 57 | 57 | <a class="treeButton treeButtonDisabled" id="treeMenu_emptytrash" title="<?php echo $_lang['empty_recycle_bin_empty']; ?>"><?php echo $_style['empty_recycle_bin_empty']; ?></a> |
| 58 | 58 | <?php |
@@ -66,7 +66,7 @@ discard block |
||
| 66 | 66 | <?php |
| 67 | 67 | // invoke OnManagerTreePrerender event |
| 68 | 68 | $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->db->escape($_REQUEST));
|
| 69 | - if (is_array($evtOut)) {
|
|
| 69 | + if (is_array($evtOut)) { |
|
| 70 | 70 | echo implode("\n", $evtOut);
|
| 71 | 71 | } |
| 72 | 72 | ?> |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | <?php |
| 79 | 79 | // invoke OnManagerTreeRender event |
| 80 | 80 | $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->db->escape($_REQUEST));
|
| 81 | - if (is_array($evtOut)) {
|
|
| 81 | + if (is_array($evtOut)) { |
|
| 82 | 82 | echo implode("\n", $evtOut);
|
| 83 | 83 | } |
| 84 | 84 | ?> |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | $sitemenu['site'] = array( |
| 22 | 22 | 'site', |
| 23 | 23 | 'main', |
| 24 | - '<i class="fa fa-tachometer"></i><span class="menu-item-text">' . $_lang['home'] . '</span>', |
|
| 24 | + '<i class="fa fa-tachometer"></i><span class="menu-item-text">'.$_lang['home'].'</span>', |
|
| 25 | 25 | 'index.php?a=2', |
| 26 | 26 | $_lang['home'], |
| 27 | 27 | '', |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | $sitemenu['elements'] = array( |
| 37 | 37 | 'elements', |
| 38 | 38 | 'main', |
| 39 | - '<i class="fa fa-th"></i><span class="menu-item-text">' . $_lang['elements'] . '</span>', |
|
| 39 | + '<i class="fa fa-th"></i><span class="menu-item-text">'.$_lang['elements'].'</span>', |
|
| 40 | 40 | 'javascript:;', |
| 41 | 41 | $_lang['elements'], |
| 42 | 42 | ' return false;', |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | $sitemenu['modules'] = array( |
| 53 | 53 | 'modules', |
| 54 | 54 | 'main', |
| 55 | - '<i class="' . $_style['icons_modules'] . '"></i><span class="menu-item-text">' . $_lang['modules'] . '</span>', |
|
| 55 | + '<i class="'.$_style['icons_modules'].'"></i><span class="menu-item-text">'.$_lang['modules'].'</span>', |
|
| 56 | 56 | 'javascript:;', |
| 57 | 57 | $_lang['modules'], |
| 58 | 58 | ' return false;', |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | $sitemenu['users'] = array( |
| 69 | 69 | 'users', |
| 70 | 70 | 'main', |
| 71 | - '<i class="fa fa-users"></i><span class="menu-item-text">' . $_lang['users'] . '</span>', |
|
| 71 | + '<i class="fa fa-users"></i><span class="menu-item-text">'.$_lang['users'].'</span>', |
|
| 72 | 72 | 'javascript:;', |
| 73 | 73 | $_lang['users'], |
| 74 | 74 | ' return false;', |
@@ -84,7 +84,7 @@ discard block |
||
| 84 | 84 | $sitemenu['tools'] = array( |
| 85 | 85 | 'tools', |
| 86 | 86 | 'main', |
| 87 | - '<i class="fa fa-wrench"></i><span class="menu-item-text">' . $_lang['tools'] . '</span>', |
|
| 87 | + '<i class="fa fa-wrench"></i><span class="menu-item-text">'.$_lang['tools'].'</span>', |
|
| 88 | 88 | 'javascript:;', |
| 89 | 89 | $_lang['tools'], |
| 90 | 90 | ' return false;', |
@@ -101,8 +101,8 @@ discard block |
||
| 101 | 101 | $sitemenu['element_templates'] = array( |
| 102 | 102 | 'element_templates', |
| 103 | 103 | 'elements', |
| 104 | - '<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>', |
|
| 105 | - 'index.php?a=76&tab=' . $tab++, |
|
| 104 | + '<i class="fa fa-newspaper-o"></i>'.$_lang['manage_templates'].'<i class="fa fa-angle-right toggle"></i>', |
|
| 105 | + 'index.php?a=76&tab='.$tab++, |
|
| 106 | 106 | $_lang['manage_templates'], |
| 107 | 107 | '', |
| 108 | 108 | 'new_template,edit_template', |
@@ -116,8 +116,8 @@ discard block |
||
| 116 | 116 | $sitemenu['element_tplvars'] = array( |
| 117 | 117 | 'element_tplvars', |
| 118 | 118 | 'elements', |
| 119 | - '<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>', |
|
| 120 | - 'index.php?a=76&tab=' . $tab++, |
|
| 119 | + '<i class="fa fa-list-alt"></i>'.$_lang['tmplvars'].'<i class="fa fa-angle-right toggle"></i>', |
|
| 120 | + 'index.php?a=76&tab='.$tab++, |
|
| 121 | 121 | $_lang['tmplvars'], |
| 122 | 122 | '', |
| 123 | 123 | 'new_template,edit_template', |
@@ -131,8 +131,8 @@ discard block |
||
| 131 | 131 | $sitemenu['element_htmlsnippets'] = array( |
| 132 | 132 | 'element_htmlsnippets', |
| 133 | 133 | 'elements', |
| 134 | - '<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
| 135 | - 'index.php?a=76&tab=' . $tab++, |
|
| 134 | + '<i class="fa fa-th-large"></i>'.$_lang['manage_htmlsnippets'].'<i class="fa fa-angle-right toggle"></i>', |
|
| 135 | + 'index.php?a=76&tab='.$tab++, |
|
| 136 | 136 | $_lang['manage_htmlsnippets'], |
| 137 | 137 | '', |
| 138 | 138 | 'new_chunk,edit_chunk', |
@@ -146,8 +146,8 @@ discard block |
||
| 146 | 146 | $sitemenu['element_snippets'] = array( |
| 147 | 147 | 'element_snippets', |
| 148 | 148 | 'elements', |
| 149 | - '<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
| 150 | - 'index.php?a=76&tab=' . $tab++, |
|
| 149 | + '<i class="fa fa-code"></i>'.$_lang['manage_snippets'].'<i class="fa fa-angle-right toggle"></i>', |
|
| 150 | + 'index.php?a=76&tab='.$tab++, |
|
| 151 | 151 | $_lang['manage_snippets'], |
| 152 | 152 | '', |
| 153 | 153 | 'new_snippet,edit_snippet', |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | $sitemenu['element_plugins'] = array( |
| 162 | 162 | 'element_plugins', |
| 163 | 163 | 'elements', |
| 164 | - '<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>', |
|
| 165 | - 'index.php?a=76&tab=' . $tab++, |
|
| 164 | + '<i class="fa fa-plug"></i>'.$_lang['manage_plugins'].'<i class="fa fa-angle-right toggle"></i>', |
|
| 165 | + 'index.php?a=76&tab='.$tab++, |
|
| 166 | 166 | $_lang['manage_plugins'], |
| 167 | 167 | '', |
| 168 | 168 | 'new_plugin,edit_plugin', |
@@ -178,7 +178,7 @@ discard block |
||
| 178 | 178 | $sitemenu['manage_files'] = array( |
| 179 | 179 | 'manage_files', |
| 180 | 180 | 'elements', |
| 181 | - '<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'], |
|
| 181 | + '<i class="fa fa-folder-open-o"></i>'.$_lang['manage_files'], |
|
| 182 | 182 | 'index.php?a=31', |
| 183 | 183 | $_lang['manage_files'], |
| 184 | 184 | '', |
@@ -193,7 +193,7 @@ discard block |
||
| 193 | 193 | $sitemenu['manage_categories'] = array( |
| 194 | 194 | 'manage_categories', |
| 195 | 195 | 'elements', |
| 196 | - '<i class="fa fa-object-group"></i>' . $_lang['manage_categories'], |
|
| 196 | + '<i class="fa fa-object-group"></i>'.$_lang['manage_categories'], |
|
| 197 | 197 | 'index.php?a=120', |
| 198 | 198 | $_lang['manage_categories'], |
| 199 | 199 | '', |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | $sitemenu['new_module'] = array( |
| 211 | 211 | 'new_module', |
| 212 | 212 | 'modules', |
| 213 | - '<i class="' . $_style['icons_modules'] . '"></i>' . $_lang['module_management'], |
|
| 213 | + '<i class="'.$_style['icons_modules'].'"></i>'.$_lang['module_management'], |
|
| 214 | 214 | 'index.php?a=106', |
| 215 | 215 | $_lang['module_management'], |
| 216 | 216 | '', |
@@ -225,21 +225,21 @@ discard block |
||
| 225 | 225 | if ($modx->hasPermission('exec_module')) {
|
| 226 | 226 | if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
|
| 227 | 227 | $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member
|
| 228 | - FROM ' . $modx->getFullTableName('site_modules') . ' AS sm
|
|
| 229 | - LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id
|
|
| 230 | - LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group
|
|
| 231 | - WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
|
| 228 | + FROM ' . $modx->getFullTableName('site_modules').' AS sm
|
|
| 229 | + LEFT JOIN ' . $modx->getFullTableName('site_module_access').' AS sma ON sma.module = sm.id
|
|
| 230 | + LEFT JOIN ' . $modx->getFullTableName('member_groups').' AS mg ON sma.usergroup = mg.user_group
|
|
| 231 | + WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID().') AND sm.disabled != 1 AND sm.locked != 1 |
|
| 232 | 232 | ORDER BY sm.name'); |
| 233 | 233 | } else {
|
| 234 | 234 | $rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name');
|
| 235 | 235 | } |
| 236 | 236 | if ($modx->db->getRecordCount($rs)) {
|
| 237 | 237 | while ($row = $modx->db->getRow($rs)) {
|
| 238 | - $sitemenu['module' . $row['id']] = array( |
|
| 239 | - 'module' . $row['id'], |
|
| 238 | + $sitemenu['module'.$row['id']] = array( |
|
| 239 | + 'module'.$row['id'], |
|
| 240 | 240 | 'modules', |
| 241 | - ($row['icon'] != '' ? '<i class="' . $row['icon'] . '"></i>' : '<i class="' . $_style['icons_module'] . '"></i>') . $row['name'], |
|
| 242 | - 'index.php?a=112&id=' . $row['id'], |
|
| 241 | + ($row['icon'] != '' ? '<i class="'.$row['icon'].'"></i>' : '<i class="'.$_style['icons_module'].'"></i>').$row['name'], |
|
| 242 | + 'index.php?a=112&id='.$row['id'], |
|
| 243 | 243 | $row['name'], |
| 244 | 244 | '', |
| 245 | 245 | '', |
@@ -258,7 +258,7 @@ discard block |
||
| 258 | 258 | $sitemenu['user_management_title'] = array( |
| 259 | 259 | 'user_management_title', |
| 260 | 260 | 'users', |
| 261 | - '<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
| 261 | + '<i class="fa fa fa-user"></i>'.$_lang['user_management_title'].'<i class="fa fa-angle-right toggle"></i>', |
|
| 262 | 262 | 'index.php?a=75', |
| 263 | 263 | $_lang['user_management_title'], |
| 264 | 264 | '', |
@@ -274,7 +274,7 @@ discard block |
||
| 274 | 274 | $sitemenu['web_user_management_title'] = array( |
| 275 | 275 | 'web_user_management_title', |
| 276 | 276 | 'users', |
| 277 | - '<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
| 277 | + '<i class="fa fa-users"></i>'.$_lang['web_user_management_title'].'<i class="fa fa-angle-right toggle"></i>', |
|
| 278 | 278 | 'index.php?a=99', |
| 279 | 279 | $_lang['web_user_management_title'], |
| 280 | 280 | '', |
@@ -290,7 +290,7 @@ discard block |
||
| 290 | 290 | $sitemenu['role_management_title'] = array( |
| 291 | 291 | 'role_management_title', |
| 292 | 292 | 'users', |
| 293 | - '<i class="fa fa-legal"></i>' . $_lang['role_management_title'], |
|
| 293 | + '<i class="fa fa-legal"></i>'.$_lang['role_management_title'], |
|
| 294 | 294 | 'index.php?a=86', |
| 295 | 295 | $_lang['role_management_title'], |
| 296 | 296 | '', |
@@ -306,7 +306,7 @@ discard block |
||
| 306 | 306 | $sitemenu['manager_permissions'] = array( |
| 307 | 307 | 'manager_permissions', |
| 308 | 308 | 'users', |
| 309 | - '<i class="fa fa-male"></i>' . $_lang['manager_permissions'], |
|
| 309 | + '<i class="fa fa-male"></i>'.$_lang['manager_permissions'], |
|
| 310 | 310 | 'index.php?a=40', |
| 311 | 311 | $_lang['manager_permissions'], |
| 312 | 312 | '', |
@@ -322,7 +322,7 @@ discard block |
||
| 322 | 322 | $sitemenu['web_permissions'] = array( |
| 323 | 323 | 'web_permissions', |
| 324 | 324 | 'users', |
| 325 | - '<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'], |
|
| 325 | + '<i class="fa fa-universal-access"></i>'.$_lang['web_permissions'], |
|
| 326 | 326 | 'index.php?a=91', |
| 327 | 327 | $_lang['web_permissions'], |
| 328 | 328 | '', |
@@ -339,7 +339,7 @@ discard block |
||
| 339 | 339 | $sitemenu['refresh_site'] = array( |
| 340 | 340 | 'refresh_site', |
| 341 | 341 | 'tools', |
| 342 | - '<i class="fa fa-recycle"></i>' . $_lang['refresh_site'], |
|
| 342 | + '<i class="fa fa-recycle"></i>'.$_lang['refresh_site'], |
|
| 343 | 343 | 'index.php?a=26', |
| 344 | 344 | $_lang['refresh_site'], |
| 345 | 345 | '', |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | 'a', // tag |
| 354 | 354 | 'javascript:;', // href |
| 355 | 355 | 'btn btn-secondary', // class or btn-success |
| 356 | - 'modx.popup({url:\'index.php?a=26\', title:\'' . $_lang['refresh_site'] . '\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', // onclick
|
|
| 356 | + 'modx.popup({url:\'index.php?a=26\', title:\''.$_lang['refresh_site'].'\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', // onclick
|
|
| 357 | 357 | $_lang['refresh_site'], // title |
| 358 | 358 | '<i class="fa fa-recycle"></i>' // innerHTML |
| 359 | 359 | ) |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | $sitemenu['search'] = array( |
| 364 | 364 | 'search', |
| 365 | 365 | 'tools', |
| 366 | - '<i class="fa fa-search"></i>' . $_lang['search'], |
|
| 366 | + '<i class="fa fa-search"></i>'.$_lang['search'], |
|
| 367 | 367 | 'index.php?a=71', |
| 368 | 368 | $_lang['search'], |
| 369 | 369 | '', |
@@ -378,7 +378,7 @@ discard block |
||
| 378 | 378 | $sitemenu['bk_manager'] = array( |
| 379 | 379 | 'bk_manager', |
| 380 | 380 | 'tools', |
| 381 | - '<i class="fa fa-database"></i>' . $_lang['bk_manager'], |
|
| 381 | + '<i class="fa fa-database"></i>'.$_lang['bk_manager'], |
|
| 382 | 382 | 'index.php?a=93', |
| 383 | 383 | $_lang['bk_manager'], |
| 384 | 384 | '', |
@@ -394,7 +394,7 @@ discard block |
||
| 394 | 394 | $sitemenu['remove_locks'] = array( |
| 395 | 395 | 'remove_locks', |
| 396 | 396 | 'tools', |
| 397 | - '<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'], |
|
| 397 | + '<i class="fa fa-hourglass"></i>'.$_lang['remove_locks'], |
|
| 398 | 398 | 'javascript:modx.removeLocks();', |
| 399 | 399 | $_lang['remove_locks'], |
| 400 | 400 | '', |
@@ -410,7 +410,7 @@ discard block |
||
| 410 | 410 | $sitemenu['import_site'] = array( |
| 411 | 411 | 'import_site', |
| 412 | 412 | 'tools', |
| 413 | - '<i class="fa fa-upload"></i>' . $_lang['import_site'], |
|
| 413 | + '<i class="fa fa-upload"></i>'.$_lang['import_site'], |
|
| 414 | 414 | 'index.php?a=95', |
| 415 | 415 | $_lang['import_site'], |
| 416 | 416 | '', |
@@ -426,7 +426,7 @@ discard block |
||
| 426 | 426 | $sitemenu['export_site'] = array( |
| 427 | 427 | 'export_site', |
| 428 | 428 | 'tools', |
| 429 | - '<i class="fa fa-download"></i>' . $_lang['export_site'], |
|
| 429 | + '<i class="fa fa-download"></i>'.$_lang['export_site'], |
|
| 430 | 430 | 'index.php?a=83', |
| 431 | 431 | $_lang['export_site'], |
| 432 | 432 | '', |
@@ -446,15 +446,15 @@ discard block |
||
| 446 | 446 | $newmenu = array_merge($newmenu, unserialize($item)); |
| 447 | 447 | } |
| 448 | 448 | } |
| 449 | - if (count($newmenu)> 0) {
|
|
| 449 | + if (count($newmenu) > 0) {
|
|
| 450 | 450 | $sitemenu = $newmenu; |
| 451 | 451 | } |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | -if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) {
|
|
| 455 | - include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
|
| 454 | +if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/includes/menu.class.inc.php')) {
|
|
| 455 | + include_once(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/includes/menu.class.inc.php'); |
|
| 456 | 456 | } else {
|
| 457 | - include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
|
| 457 | + include_once(MODX_MANAGER_PATH.'includes/menu.class.inc.php'); |
|
| 458 | 458 | } |
| 459 | 459 | $menu = new EVOmenu(); |
| 460 | 460 | $menu->Build($sitemenu, array( |
@@ -32,7 +32,7 @@ discard block |
||
| 32 | 32 | 'active' |
| 33 | 33 | ); |
| 34 | 34 | |
| 35 | -if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) {
|
|
| 35 | +if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
| 36 | 36 | $sitemenu['elements'] = array( |
| 37 | 37 | 'elements', |
| 38 | 38 | 'main', |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | ); |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | -if ($modx->hasPermission('exec_module')) {
|
|
| 51 | +if ($modx->hasPermission('exec_module')) { |
|
| 52 | 52 | $sitemenu['modules'] = array( |
| 53 | 53 | 'modules', |
| 54 | 54 | 'main', |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | ); |
| 65 | 65 | } |
| 66 | 66 | |
| 67 | -if ($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) {
|
|
| 67 | +if ($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
| 68 | 68 | $sitemenu['users'] = array( |
| 69 | 69 | 'users', |
| 70 | 70 | 'main', |
@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | ); |
| 81 | 81 | } |
| 82 | 82 | |
| 83 | -if ($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) {
|
|
| 83 | +if ($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
| 84 | 84 | $sitemenu['tools'] = array( |
| 85 | 85 | 'tools', |
| 86 | 86 | 'main', |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | } |
| 98 | 98 | |
| 99 | 99 | $tab = 0; |
| 100 | -if ($modx->hasPermission('edit_template')) {
|
|
| 100 | +if ($modx->hasPermission('edit_template')) { |
|
| 101 | 101 | $sitemenu['element_templates'] = array( |
| 102 | 102 | 'element_templates', |
| 103 | 103 | 'elements', |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | 'dropdown-toggle' |
| 113 | 113 | ); |
| 114 | 114 | } |
| 115 | -if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
|
|
| 115 | +if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
| 116 | 116 | $sitemenu['element_tplvars'] = array( |
| 117 | 117 | 'element_tplvars', |
| 118 | 118 | 'elements', |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | 'dropdown-toggle' |
| 128 | 128 | ); |
| 129 | 129 | } |
| 130 | -if ($modx->hasPermission('edit_chunk')) {
|
|
| 130 | +if ($modx->hasPermission('edit_chunk')) { |
|
| 131 | 131 | $sitemenu['element_htmlsnippets'] = array( |
| 132 | 132 | 'element_htmlsnippets', |
| 133 | 133 | 'elements', |
@@ -142,7 +142,7 @@ discard block |
||
| 142 | 142 | 'dropdown-toggle' |
| 143 | 143 | ); |
| 144 | 144 | } |
| 145 | -if ($modx->hasPermission('edit_snippet')) {
|
|
| 145 | +if ($modx->hasPermission('edit_snippet')) { |
|
| 146 | 146 | $sitemenu['element_snippets'] = array( |
| 147 | 147 | 'element_snippets', |
| 148 | 148 | 'elements', |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | 'dropdown-toggle' |
| 158 | 158 | ); |
| 159 | 159 | } |
| 160 | -if ($modx->hasPermission('edit_plugin')) {
|
|
| 160 | +if ($modx->hasPermission('edit_plugin')) { |
|
| 161 | 161 | $sitemenu['element_plugins'] = array( |
| 162 | 162 | 'element_plugins', |
| 163 | 163 | 'elements', |
@@ -174,7 +174,7 @@ discard block |
||
| 174 | 174 | } |
| 175 | 175 | //$sitemenu['element_categories'] = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,'');
|
| 176 | 176 | |
| 177 | -if ($modx->hasPermission('file_manager')) {
|
|
| 177 | +if ($modx->hasPermission('file_manager')) { |
|
| 178 | 178 | $sitemenu['manage_files'] = array( |
| 179 | 179 | 'manage_files', |
| 180 | 180 | 'elements', |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | '' |
| 190 | 190 | ); |
| 191 | 191 | } |
| 192 | -if ($modx->hasPermission('category_manager')) {
|
|
| 192 | +if ($modx->hasPermission('category_manager')) { |
|
| 193 | 193 | $sitemenu['manage_categories'] = array( |
| 194 | 194 | 'manage_categories', |
| 195 | 195 | 'elements', |
@@ -206,7 +206,7 @@ discard block |
||
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | // Modules Menu Items |
| 209 | -if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) {
|
|
| 209 | +if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
| 210 | 210 | $sitemenu['new_module'] = array( |
| 211 | 211 | 'new_module', |
| 212 | 212 | 'modules', |
@@ -222,19 +222,19 @@ discard block |
||
| 222 | 222 | ); |
| 223 | 223 | } |
| 224 | 224 | |
| 225 | -if ($modx->hasPermission('exec_module')) {
|
|
| 226 | - if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
|
|
| 225 | +if ($modx->hasPermission('exec_module')) { |
|
| 226 | + if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
| 227 | 227 | $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member
|
| 228 | 228 | FROM ' . $modx->getFullTableName('site_modules') . ' AS sm
|
| 229 | 229 | LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id
|
| 230 | 230 | LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group
|
| 231 | 231 | WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
| 232 | 232 | ORDER BY sm.name'); |
| 233 | - } else {
|
|
| 233 | + } else { |
|
| 234 | 234 | $rs = $modx->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name');
|
| 235 | 235 | } |
| 236 | - if ($modx->db->getRecordCount($rs)) {
|
|
| 237 | - while ($row = $modx->db->getRow($rs)) {
|
|
| 236 | + if ($modx->db->getRecordCount($rs)) { |
|
| 237 | + while ($row = $modx->db->getRow($rs)) { |
|
| 238 | 238 | $sitemenu['module' . $row['id']] = array( |
| 239 | 239 | 'module' . $row['id'], |
| 240 | 240 | 'modules', |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | |
| 255 | 255 | // security menu items (users) |
| 256 | 256 | |
| 257 | -if ($modx->hasPermission('edit_user')) {
|
|
| 257 | +if ($modx->hasPermission('edit_user')) { |
|
| 258 | 258 | $sitemenu['user_management_title'] = array( |
| 259 | 259 | 'user_management_title', |
| 260 | 260 | 'users', |
@@ -270,7 +270,7 @@ discard block |
||
| 270 | 270 | ); |
| 271 | 271 | } |
| 272 | 272 | |
| 273 | -if ($modx->hasPermission('edit_web_user')) {
|
|
| 273 | +if ($modx->hasPermission('edit_web_user')) { |
|
| 274 | 274 | $sitemenu['web_user_management_title'] = array( |
| 275 | 275 | 'web_user_management_title', |
| 276 | 276 | 'users', |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | ); |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | -if ($modx->hasPermission('edit_role')) {
|
|
| 289 | +if ($modx->hasPermission('edit_role')) { |
|
| 290 | 290 | $sitemenu['role_management_title'] = array( |
| 291 | 291 | 'role_management_title', |
| 292 | 292 | 'users', |
@@ -302,7 +302,7 @@ discard block |
||
| 302 | 302 | ); |
| 303 | 303 | } |
| 304 | 304 | |
| 305 | -if ($modx->hasPermission('access_permissions')) {
|
|
| 305 | +if ($modx->hasPermission('access_permissions')) { |
|
| 306 | 306 | $sitemenu['manager_permissions'] = array( |
| 307 | 307 | 'manager_permissions', |
| 308 | 308 | 'users', |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | ); |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | -if ($modx->hasPermission('web_access_permissions')) {
|
|
| 321 | +if ($modx->hasPermission('web_access_permissions')) { |
|
| 322 | 322 | $sitemenu['web_permissions'] = array( |
| 323 | 323 | 'web_permissions', |
| 324 | 324 | 'users', |
@@ -374,7 +374,7 @@ discard block |
||
| 374 | 374 | '' |
| 375 | 375 | ); |
| 376 | 376 | |
| 377 | -if ($modx->hasPermission('bk_manager')) {
|
|
| 377 | +if ($modx->hasPermission('bk_manager')) { |
|
| 378 | 378 | $sitemenu['bk_manager'] = array( |
| 379 | 379 | 'bk_manager', |
| 380 | 380 | 'tools', |
@@ -390,7 +390,7 @@ discard block |
||
| 390 | 390 | ); |
| 391 | 391 | } |
| 392 | 392 | |
| 393 | -if ($modx->hasPermission('remove_locks')) {
|
|
| 393 | +if ($modx->hasPermission('remove_locks')) { |
|
| 394 | 394 | $sitemenu['remove_locks'] = array( |
| 395 | 395 | 'remove_locks', |
| 396 | 396 | 'tools', |
@@ -406,7 +406,7 @@ discard block |
||
| 406 | 406 | ); |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | -if ($modx->hasPermission('import_static')) {
|
|
| 409 | +if ($modx->hasPermission('import_static')) { |
|
| 410 | 410 | $sitemenu['import_site'] = array( |
| 411 | 411 | 'import_site', |
| 412 | 412 | 'tools', |
@@ -422,7 +422,7 @@ discard block |
||
| 422 | 422 | ); |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | -if ($modx->hasPermission('export_static')) {
|
|
| 425 | +if ($modx->hasPermission('export_static')) { |
|
| 426 | 426 | $sitemenu['export_site'] = array( |
| 427 | 427 | 'export_site', |
| 428 | 428 | 'tools', |
@@ -439,21 +439,21 @@ discard block |
||
| 439 | 439 | } |
| 440 | 440 | |
| 441 | 441 | $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu));
|
| 442 | -if (is_array($menu)) {
|
|
| 442 | +if (is_array($menu)) { |
|
| 443 | 443 | $newmenu = array(); |
| 444 | - foreach ($menu as $item) {
|
|
| 445 | - if (is_array(unserialize($item))) {
|
|
| 444 | + foreach ($menu as $item) { |
|
| 445 | + if (is_array(unserialize($item))) { |
|
| 446 | 446 | $newmenu = array_merge($newmenu, unserialize($item)); |
| 447 | 447 | } |
| 448 | 448 | } |
| 449 | - if (count($newmenu)> 0) {
|
|
| 449 | + if (count($newmenu)> 0) { |
|
| 450 | 450 | $sitemenu = $newmenu; |
| 451 | 451 | } |
| 452 | 452 | } |
| 453 | 453 | |
| 454 | -if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) {
|
|
| 454 | +if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
| 455 | 455 | include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
| 456 | -} else {
|
|
| 456 | +} else { |
|
| 457 | 457 | include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
| 458 | 458 | } |
| 459 | 459 | $menu = new EVOmenu(); |