@@ -12,7 +12,8 @@ discard block |
||
| 12 | 12 | * @link http://kcfinder.sunhater.com |
| 13 | 13 | */ |
| 14 | 14 | |
| 15 | -class image_gmagick extends image { |
|
| 15 | +class image_gmagick extends image |
|
| 16 | +{ |
|
| 16 | 17 | |
| 17 | 18 | static $MIMES = array( |
| 18 | 19 | //'tif' => "image/tiff" |
@@ -21,9 +22,15 @@ discard block |
||
| 21 | 22 | |
| 22 | 23 | // ABSTRACT PUBLIC METHODS |
| 23 | 24 | |
| 24 | - public function resize($width, $height) {// |
|
| 25 | - if (!$width) $width = 1; |
|
| 26 | - if (!$height) $height = 1; |
|
| 25 | + public function resize($width, $height) |
|
| 26 | + { |
|
| 27 | +// |
|
| 28 | + if (!$width) { |
|
| 29 | + $width = 1; |
|
| 30 | + } |
|
| 31 | + if (!$height) { |
|
| 32 | + $height = 1; |
|
| 33 | + } |
|
| 27 | 34 | try { |
| 28 | 35 | $this->image->scaleImage($width, $height); |
| 29 | 36 | } catch (Exception $e) { |
@@ -34,9 +41,15 @@ discard block |
||
| 34 | 41 | return true; |
| 35 | 42 | } |
| 36 | 43 | |
| 37 | - public function resizeFit($width, $height, $background=false) {// |
|
| 38 | - if (!$width) $width = 1; |
|
| 39 | - if (!$height) $height = 1; |
|
| 44 | + public function resizeFit($width, $height, $background=false) |
|
| 45 | + { |
|
| 46 | +// |
|
| 47 | + if (!$width) { |
|
| 48 | + $width = 1; |
|
| 49 | + } |
|
| 50 | + if (!$height) { |
|
| 51 | + $height = 1; |
|
| 52 | + } |
|
| 40 | 53 | |
| 41 | 54 | try { |
| 42 | 55 | $this->image->scaleImage($width, $height, true); |
@@ -69,43 +82,58 @@ discard block |
||
| 69 | 82 | } |
| 70 | 83 | } |
| 71 | 84 | |
| 72 | - public function resizeCrop($width, $height, $offset=false) { |
|
| 73 | - if (!$width) $width = 1; |
|
| 74 | - if (!$height) $height = 1; |
|
| 85 | + public function resizeCrop($width, $height, $offset=false) |
|
| 86 | + { |
|
| 87 | + if (!$width) { |
|
| 88 | + $width = 1; |
|
| 89 | + } |
|
| 90 | + if (!$height) { |
|
| 91 | + $height = 1; |
|
| 92 | + } |
|
| 75 | 93 | |
| 76 | 94 | if (($this->width / $this->height) > ($width / $height)) { |
| 77 | 95 | $h = $height; |
| 78 | 96 | $w = ($this->width * $h) / $this->height; |
| 79 | 97 | $y = 0; |
| 80 | 98 | if ($offset !== false) { |
| 81 | - if ($offset > 0) |
|
| 82 | - $offset = -$offset; |
|
| 83 | - if (($w + $offset) <= $width) |
|
| 84 | - $offset = $width - $w; |
|
| 99 | + if ($offset > 0) { |
|
| 100 | + $offset = -$offset; |
|
| 101 | + } |
|
| 102 | + if (($w + $offset) <= $width) { |
|
| 103 | + $offset = $width - $w; |
|
| 104 | + } |
|
| 85 | 105 | $x = $offset; |
| 86 | - } else |
|
| 87 | - $x = ($width - $w) / 2; |
|
| 106 | + } else { |
|
| 107 | + $x = ($width - $w) / 2; |
|
| 108 | + } |
|
| 88 | 109 | |
| 89 | 110 | } else { |
| 90 | 111 | $w = $width; |
| 91 | 112 | $h = ($this->height * $w) / $this->width; |
| 92 | 113 | $x = 0; |
| 93 | 114 | if ($offset !== false) { |
| 94 | - if ($offset > 0) |
|
| 95 | - $offset = -$offset; |
|
| 96 | - if (($h + $offset) <= $height) |
|
| 97 | - $offset = $height - $h; |
|
| 115 | + if ($offset > 0) { |
|
| 116 | + $offset = -$offset; |
|
| 117 | + } |
|
| 118 | + if (($h + $offset) <= $height) { |
|
| 119 | + $offset = $height - $h; |
|
| 120 | + } |
|
| 98 | 121 | $y = $offset; |
| 99 | - } else |
|
| 100 | - $y = ($height - $h) / 2; |
|
| 122 | + } else { |
|
| 123 | + $y = ($height - $h) / 2; |
|
| 124 | + } |
|
| 101 | 125 | } |
| 102 | 126 | |
| 103 | 127 | $x = round($x); |
| 104 | 128 | $y = round($y); |
| 105 | 129 | $w = round($w); |
| 106 | 130 | $h = round($h); |
| 107 | - if (!$w) $w = 1; |
|
| 108 | - if (!$h) $h = 1; |
|
| 131 | + if (!$w) { |
|
| 132 | + $w = 1; |
|
| 133 | + } |
|
| 134 | + if (!$h) { |
|
| 135 | + $h = 1; |
|
| 136 | + } |
|
| 109 | 137 | |
| 110 | 138 | try { |
| 111 | 139 | $this->image->scaleImage($w, $h); |
@@ -119,7 +147,8 @@ discard block |
||
| 119 | 147 | return true; |
| 120 | 148 | } |
| 121 | 149 | |
| 122 | - public function rotate($angle, $background="#000000") { |
|
| 150 | + public function rotate($angle, $background="#000000") |
|
| 151 | + { |
|
| 123 | 152 | try { |
| 124 | 153 | $this->image->rotateImage($background, $angle); |
| 125 | 154 | $w = $this->image->getImageWidth(); |
@@ -132,7 +161,8 @@ discard block |
||
| 132 | 161 | return true; |
| 133 | 162 | } |
| 134 | 163 | |
| 135 | - public function flipHorizontal() { |
|
| 164 | + public function flipHorizontal() |
|
| 165 | + { |
|
| 136 | 166 | try { |
| 137 | 167 | $this->image->flopImage(); |
| 138 | 168 | } catch (Exception $e) { |
@@ -141,7 +171,8 @@ discard block |
||
| 141 | 171 | return true; |
| 142 | 172 | } |
| 143 | 173 | |
| 144 | - public function flipVertical() { |
|
| 174 | + public function flipVertical() |
|
| 175 | + { |
|
| 145 | 176 | try { |
| 146 | 177 | $this->image->flipImage(); |
| 147 | 178 | } catch (Exception $e) { |
@@ -150,7 +181,8 @@ discard block |
||
| 150 | 181 | return true; |
| 151 | 182 | } |
| 152 | 183 | |
| 153 | - public function watermark($file, $left=false, $top=false) { |
|
| 184 | + public function watermark($file, $left=false, $top=false) |
|
| 185 | + { |
|
| 154 | 186 | try { |
| 155 | 187 | $wm = new Gmagick($file); |
| 156 | 188 | $w = $wm->getImageWidth(); |
@@ -171,8 +203,9 @@ discard block |
||
| 171 | 203 | if ((($x + $w) > $this->width) || |
| 172 | 204 | (($y + $h) > $this->height) || |
| 173 | 205 | ($x < 0) || ($y < 0) |
| 174 | - ) |
|
| 175 | - return false; |
|
| 206 | + ) { |
|
| 207 | + return false; |
|
| 208 | + } |
|
| 176 | 209 | |
| 177 | 210 | try { |
| 178 | 211 | $this->image->compositeImage($wm, 1, $x, $y); |
@@ -185,7 +218,8 @@ discard block |
||
| 185 | 218 | |
| 186 | 219 | // ABSTRACT PROTECTED METHODS |
| 187 | 220 | |
| 188 | - protected function getBlankImage($width, $height) { |
|
| 221 | + protected function getBlankImage($width, $height) |
|
| 222 | + { |
|
| 189 | 223 | try { |
| 190 | 224 | $img = new Gmagick(); |
| 191 | 225 | $img->newImage($width, $height, "none"); |
@@ -195,7 +229,8 @@ discard block |
||
| 195 | 229 | return $img; |
| 196 | 230 | } |
| 197 | 231 | |
| 198 | - protected function getImage($image, &$width, &$height) { |
|
| 232 | + protected function getImage($image, &$width, &$height) |
|
| 233 | + { |
|
| 199 | 234 | |
| 200 | 235 | if (is_object($image) && ($image instanceof image_gmagick)) { |
| 201 | 236 | $width = $image->width; |
@@ -225,18 +260,21 @@ discard block |
||
| 225 | 260 | $height = $h; |
| 226 | 261 | return $image; |
| 227 | 262 | |
| 228 | - } else |
|
| 229 | - return false; |
|
| 263 | + } else { |
|
| 264 | + return false; |
|
| 265 | + } |
|
| 230 | 266 | } |
| 231 | 267 | |
| 232 | 268 | |
| 233 | 269 | // PSEUDO-ABSTRACT STATIC METHODS |
| 234 | 270 | |
| 235 | - static function available() { |
|
| 271 | + static function available() |
|
| 272 | + { |
|
| 236 | 273 | return class_exists("Gmagick"); |
| 237 | 274 | } |
| 238 | 275 | |
| 239 | - static function checkImage($file) { |
|
| 276 | + static function checkImage($file) |
|
| 277 | + { |
|
| 240 | 278 | try { |
| 241 | 279 | new Gmagick($file); |
| 242 | 280 | } catch (Exception $e) { |
@@ -248,7 +286,8 @@ discard block |
||
| 248 | 286 | |
| 249 | 287 | // INHERIT METHODS |
| 250 | 288 | |
| 251 | - public function output($type="jpeg", array $options=array()) { |
|
| 289 | + public function output($type="jpeg", array $options=array()) |
|
| 290 | + { |
|
| 252 | 291 | $type = strtolower($type); |
| 253 | 292 | try { |
| 254 | 293 | $this->image->setImageFormat($type); |
@@ -256,8 +295,9 @@ discard block |
||
| 256 | 295 | return false; |
| 257 | 296 | } |
| 258 | 297 | $method = "optimize_$type"; |
| 259 | - if (method_exists($this, $method) && !$this->$method($options)) |
|
| 260 | - return false; |
|
| 298 | + if (method_exists($this, $method) && !$this->$method($options)) { |
|
| 299 | + return false; |
|
| 300 | + } |
|
| 261 | 301 | |
| 262 | 302 | if (!isset($options['file'])) { |
| 263 | 303 | if (!headers_sent()) { |
@@ -287,7 +327,8 @@ discard block |
||
| 287 | 327 | |
| 288 | 328 | // OWN METHODS |
| 289 | 329 | |
| 290 | - protected function optimize_jpeg(array $options=array()) { |
|
| 330 | + protected function optimize_jpeg(array $options=array()) |
|
| 331 | + { |
|
| 291 | 332 | $quality = isset($options['quality']) ? $options['quality'] : self::DEFAULT_JPEG_QUALITY; |
| 292 | 333 | try { |
| 293 | 334 | $this->image->setCompressionQuality($quality); |
@@ -21,13 +21,17 @@ discard block |
||
| 21 | 21 | |
| 22 | 22 | public function __construct($uri = null) |
| 23 | 23 | { |
| 24 | - if ($uri) $this->load($uri); |
|
| 24 | + if ($uri) { |
|
| 25 | + $this->load($uri); |
|
| 26 | + } |
|
| 25 | 27 | } |
| 26 | 28 | |
| 27 | 29 | |
| 28 | 30 | public function load($uri) |
| 29 | 31 | { |
| 30 | - if ($this->handle) $this->close(); |
|
| 32 | + if ($this->handle) { |
|
| 33 | + $this->close(); |
|
| 34 | + } |
|
| 31 | 35 | |
| 32 | 36 | $this->uri = $uri; |
| 33 | 37 | $this->handle = fopen($uri, 'r'); |
@@ -36,15 +40,16 @@ discard block |
||
| 36 | 40 | |
| 37 | 41 | public function close() |
| 38 | 42 | { |
| 39 | - if (is_resource($this->handle)) fclose($this->handle); |
|
| 43 | + if (is_resource($this->handle)) { |
|
| 44 | + fclose($this->handle); |
|
| 45 | + } |
|
| 40 | 46 | } |
| 41 | 47 | |
| 42 | 48 | |
| 43 | 49 | public function getSize() |
| 44 | 50 | { |
| 45 | 51 | $this->strpos = 0; |
| 46 | - if ($this->getType()) |
|
| 47 | - { |
|
| 52 | + if ($this->getType()) { |
|
| 48 | 53 | return array_values($this->parseSize()); |
| 49 | 54 | } |
| 50 | 55 | |
@@ -56,10 +61,8 @@ discard block |
||
| 56 | 61 | { |
| 57 | 62 | $this->strpos = 0; |
| 58 | 63 | |
| 59 | - if (!$this->type) |
|
| 60 | - { |
|
| 61 | - switch ($this->getChars(2)) |
|
| 62 | - { |
|
| 64 | + if (!$this->type) { |
|
| 65 | + switch ($this->getChars(2)) { |
|
| 63 | 66 | case "BM": |
| 64 | 67 | return $this->type = 'bmp'; |
| 65 | 68 | case "GI": |
@@ -81,8 +84,7 @@ discard block |
||
| 81 | 84 | { |
| 82 | 85 | $this->strpos = 0; |
| 83 | 86 | |
| 84 | - switch ($this->type) |
|
| 85 | - { |
|
| 87 | + switch ($this->type) { |
|
| 86 | 88 | case 'png': |
| 87 | 89 | return $this->parseSizeForPNG(); |
| 88 | 90 | case 'gif': |
@@ -127,10 +129,8 @@ discard block |
||
| 127 | 129 | { |
| 128 | 130 | $state = null; |
| 129 | 131 | |
| 130 | - while (true) |
|
| 131 | - { |
|
| 132 | - switch ($state) |
|
| 133 | - { |
|
| 132 | + while (true) { |
|
| 133 | + switch ($state) { |
|
| 134 | 134 | default: |
| 135 | 135 | $this->getChars(2); |
| 136 | 136 | $state = 'started'; |
@@ -138,27 +138,22 @@ discard block |
||
| 138 | 138 | |
| 139 | 139 | case 'started': |
| 140 | 140 | $b = $this->getByte(); |
| 141 | - if ($b === false) return false; |
|
| 141 | + if ($b === false) { |
|
| 142 | + return false; |
|
| 143 | + } |
|
| 142 | 144 | |
| 143 | 145 | $state = $b == 0xFF ? 'sof' : 'started'; |
| 144 | 146 | break; |
| 145 | 147 | |
| 146 | 148 | case 'sof': |
| 147 | 149 | $b = $this->getByte(); |
| 148 | - if (in_array($b, range(0xe0, 0xef))) |
|
| 149 | - { |
|
| 150 | + if (in_array($b, range(0xe0, 0xef))) { |
|
| 150 | 151 | $state = 'skipframe'; |
| 151 | - } |
|
| 152 | - elseif (in_array($b, array_merge(range(0xC0,0xC3), range(0xC5,0xC7), range(0xC9,0xCB), range(0xCD,0xCF)))) |
|
| 153 | - { |
|
| 152 | + } elseif (in_array($b, array_merge(range(0xC0,0xC3), range(0xC5,0xC7), range(0xC9,0xCB), range(0xCD,0xCF)))) { |
|
| 154 | 153 | $state = 'readsize'; |
| 155 | - } |
|
| 156 | - elseif ($b == 0xFF) |
|
| 157 | - { |
|
| 154 | + } elseif ($b == 0xFF) { |
|
| 158 | 155 | $state = 'sof'; |
| 159 | - } |
|
| 160 | - else |
|
| 161 | - { |
|
| 156 | + } else { |
|
| 162 | 157 | $state = 'skipframe'; |
| 163 | 158 | } |
| 164 | 159 | break; |
@@ -187,21 +182,16 @@ discard block |
||
| 187 | 182 | $response = null; |
| 188 | 183 | |
| 189 | 184 | // do we need more data? |
| 190 | - if ($this->strpos + $n -1 >= strlen($this->str)) |
|
| 191 | - { |
|
| 185 | + if ($this->strpos + $n -1 >= strlen($this->str)) { |
|
| 192 | 186 | $end = ($this->strpos + $n); |
| 193 | 187 | |
| 194 | - while (strlen($this->str) < $end && $response !== false) |
|
| 195 | - { |
|
| 188 | + while (strlen($this->str) < $end && $response !== false) { |
|
| 196 | 189 | // read more from the file handle |
| 197 | 190 | $need = $end - ftell($this->handle); |
| 198 | 191 | |
| 199 | - if ($response = fread($this->handle, $need)) |
|
| 200 | - { |
|
| 192 | + if ($response = fread($this->handle, $need)) { |
|
| 201 | 193 | $this->str .= $response; |
| 202 | - } |
|
| 203 | - else |
|
| 204 | - { |
|
| 194 | + } else { |
|
| 205 | 195 | return false; |
| 206 | 196 | } |
| 207 | 197 | } |
@@ -1,8 +1,8 @@ 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 | -if(!$modx->hasPermission('view_eventlog')) {
|
|
| 5 | +if(!$modx->hasPermission('view_eventlog')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | ?> |
@@ -19,11 +19,11 @@ discard block |
||
| 19 | 19 | <?php |
| 20 | 20 | $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC');
|
| 21 | 21 | $limit = $modx->db->getRecordCount($rs); |
| 22 | - if($limit < 1) {
|
|
| 22 | + if($limit < 1) { |
|
| 23 | 23 | ?> |
| 24 | 24 | <p><?= $_lang["no_docs_pending_publishing"] ?></p> |
| 25 | 25 | <?php |
| 26 | - } else {
|
|
| 26 | + } else { |
|
| 27 | 27 | ?> |
| 28 | 28 | <div class="table-responsive"> |
| 29 | 29 | <table class="grid sortabletable" id="table-1"> |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | </thead> |
| 37 | 37 | <tbody> |
| 38 | 38 | <?php |
| 39 | - while($row = $modx->db->getRow($rs)) {
|
|
| 39 | + while($row = $modx->db->getRow($rs)) { |
|
| 40 | 40 | ?> |
| 41 | 41 | <tr> |
| 42 | 42 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -58,11 +58,11 @@ discard block |
||
| 58 | 58 | <?php |
| 59 | 59 | $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC');
|
| 60 | 60 | $limit = $modx->db->getRecordCount($rs); |
| 61 | - if($limit < 1) {
|
|
| 61 | + if($limit < 1) { |
|
| 62 | 62 | ?> |
| 63 | 63 | <p><?= $_lang["no_docs_pending_unpublishing"] ?></p> |
| 64 | 64 | <?php |
| 65 | - } else {
|
|
| 65 | + } else { |
|
| 66 | 66 | ?> |
| 67 | 67 | <div class="table-responsive"> |
| 68 | 68 | <table class="grid sortabletable" id="table-2"> |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | </thead> |
| 76 | 76 | <tbody> |
| 77 | 77 | <?php |
| 78 | - while($row = $modx->db->getRow($rs)) {
|
|
| 78 | + while($row = $modx->db->getRow($rs)) { |
|
| 79 | 79 | ?> |
| 80 | 80 | <tr> |
| 81 | 81 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -97,11 +97,11 @@ discard block |
||
| 97 | 97 | <?php |
| 98 | 98 | $rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC");
|
| 99 | 99 | $limit = $modx->db->getRecordCount($rs); |
| 100 | - if($limit < 1) {
|
|
| 100 | + if($limit < 1) { |
|
| 101 | 101 | ?> |
| 102 | 102 | <p><?= $_lang["no_docs_pending_pubunpub"] ?></p> |
| 103 | 103 | <?php |
| 104 | - } else {
|
|
| 104 | + } else { |
|
| 105 | 105 | ?> |
| 106 | 106 | <div class="table-responsive"> |
| 107 | 107 | <table class="grid sortabletable" id="table-3"> |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | </thead> |
| 116 | 116 | <tbody> |
| 117 | 117 | <?php |
| 118 | - while($row = $modx->db->getRow($rs)) {
|
|
| 118 | + while($row = $modx->db->getRow($rs)) { |
|
| 119 | 119 | ?> |
| 120 | 120 | <tr> |
| 121 | 121 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -1,8 +1,8 @@ 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 | -if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) {
|
|
| 5 | +if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -10,10 +10,10 @@ discard block |
||
| 10 | 10 | $modx->manager->initPageViewState(); |
| 11 | 11 | |
| 12 | 12 | // get and save search string |
| 13 | -if ($_REQUEST['op'] == 'reset') {
|
|
| 13 | +if ($_REQUEST['op'] == 'reset') { |
|
| 14 | 14 | $query = ''; |
| 15 | 15 | $_PAGE['vs']['search'] = ''; |
| 16 | -} else {
|
|
| 16 | +} else { |
|
| 17 | 17 | $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
| 18 | 18 | $sqlQuery = $modx->db->escape($query); |
| 19 | 19 | $_PAGE['vs']['search'] = $query; |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; |
| 29 | 29 | $cm = new ContextMenu("cntxm", 150);
|
| 30 | 30 | $cm->addItem($_lang["run_module"], "js:menuAction(1)", $_style['actions_run'], (!$modx->hasPermission('exec_module') ? 1 : 0));
|
| 31 | -if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) {
|
|
| 31 | +if ($modx->hasPermission('edit_module') || $modx->hasPermission('new_module') || $modx->hasPermission('delete_module')) { |
|
| 32 | 32 | $cm->addSeparator(); |
| 33 | 33 | } |
| 34 | 34 | $cm->addItem($_lang["edit"], "js:menuAction(2)", $_style['actions_edit'], (!$modx->hasPermission('edit_module') ? 1 : 0));
|
@@ -107,21 +107,21 @@ discard block |
||
| 107 | 107 | <div class="tab-page"> |
| 108 | 108 | <div class="table-responsive"> |
| 109 | 109 | <?php |
| 110 | - if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) {
|
|
| 110 | + if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
| 111 | 111 | $rs = $modx->db->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"' . $_lang['yes'] . '","-") as disabled, IF(sm.icon<>"",sm.icon,"' . $_style['icons_modules'] . '") as icon
|
| 112 | 112 | FROM ' . $modx->getFullTableName('site_modules') . ' AS sm
|
| 113 | 113 | LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id
|
| 114 | 114 | LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group
|
| 115 | 115 | WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
| 116 | 116 | ORDER BY sm.name'); |
| 117 | - if ($modx->hasPermission('edit_module')) {
|
|
| 117 | + if ($modx->hasPermission('edit_module')) { |
|
| 118 | 118 | $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
| 119 | - } else if ($modx->hasPermission('exec_module')) {
|
|
| 119 | + } else if ($modx->hasPermission('exec_module')) { |
|
| 120 | 120 | $title = "<a href='index.php?a=112&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
| 121 | - } else {
|
|
| 121 | + } else { |
|
| 122 | 122 | $title = '[+value+]'; |
| 123 | 123 | } |
| 124 | - } else {
|
|
| 124 | + } else { |
|
| 125 | 125 | $rs = $modx->db->select("id, name, description, IF(locked,'{$_lang['yes']}','-') as locked, IF(disabled,'{$_lang['yes']}','-') as disabled, IF(icon<>'',icon,'{$_style['icons_module']}') as icon", $modx->getFullTableName("site_modules"), (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "name");
|
| 126 | 126 | $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
| 127 | 127 | } |
@@ -137,10 +137,10 @@ discard block |
||
| 137 | 137 | $grd->colWidths = "34,,,60,60"; |
| 138 | 138 | $grd->colAligns = "center,,,center,center"; |
| 139 | 139 | $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='[+value+]'></i></a>||template:" . $title; |
| 140 | - if ($listmode == '1') {
|
|
| 140 | + if ($listmode == '1') { |
|
| 141 | 141 | $grd->pageSize = 0; |
| 142 | 142 | } |
| 143 | - if ($_REQUEST['op'] == 'reset') {
|
|
| 143 | + if ($_REQUEST['op'] == 'reset') { |
|
| 144 | 144 | $grd->pageNumber = 1; |
| 145 | 145 | } |
| 146 | 146 | // render grid |
@@ -1,8 +1,8 @@ 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 | -if (!$modx->hasPermission('logs')) {
|
|
| 5 | +if (!$modx->hasPermission('logs')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -55,7 +55,7 @@ discard block |
||
| 55 | 55 | <table class="table data table-sm nowrap"> |
| 56 | 56 | <tbody> |
| 57 | 57 | <?php |
| 58 | - foreach ($serverArr as $key => $value) {
|
|
| 58 | + foreach ($serverArr as $key => $value) { |
|
| 59 | 59 | ?> |
| 60 | 60 | <tr> |
| 61 | 61 | <td width="1%"><?= $key ?></td> |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $sql = "SHOW TABLE STATUS FROM $dbase LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%';"; |
| 99 | 99 | $rs = $modx->db->query($sql); |
| 100 | 100 | $i = 0; |
| 101 | - while ($log_status = $modx->db->getRow($rs)) {
|
|
| 101 | + while ($log_status = $modx->db->getRow($rs)) { |
|
| 102 | 102 | ?> |
| 103 | 103 | <tr> |
| 104 | 104 | <td class="text-primary"><b><?= $log_status['Name'] ?></b></td> |
@@ -110,17 +110,17 @@ discard block |
||
| 110 | 110 | $modx->db->config['table_prefix'] . 'event_log', |
| 111 | 111 | $modx->db->config['table_prefix'] . 'manager_log', |
| 112 | 112 | ); |
| 113 | - if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) {
|
|
| 113 | + if ($modx->hasPermission('settings') && in_array($log_status['Name'], $truncateable)) { |
|
| 114 | 114 | echo "<td class=\"text-xs-right\">"; |
| 115 | 115 | echo "<a class=\"text-danger\" href='index.php?a=54&mode=$action&u=" . $log_status['Name'] . "' title='" . $_lang['truncate_table'] . "'>" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</a>"; |
| 116 | 116 | echo "</td>"; |
| 117 | - } else {
|
|
| 117 | + } else { |
|
| 118 | 118 | echo "<td class=\"text-xs-right\">" . $modx->nicesize($log_status['Data_length'] + $log_status['Data_free']) . "</td>"; |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | - if ($modx->hasPermission('settings')) {
|
|
| 121 | + if ($modx->hasPermission('settings')) { |
|
| 122 | 122 | echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? "<a class=\"text-danger\" href='index.php?a=54&mode=$action&t=" . $log_status['Name'] . "' title='" . $_lang['optimize_table'] . "' ><span>" . $modx->nicesize($log_status['Data_free']) . "</span></a>" : "-") . "</td>"; |
| 123 | - } else {
|
|
| 123 | + } else { |
|
| 124 | 124 | echo "<td class=\"text-xs-right\">" . ($log_status['Data_free'] > 0 ? $modx->nicesize($log_status['Data_free']) : "-") . "</td>"; |
| 125 | 125 | } |
| 126 | 126 | ?> |
@@ -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 | $helpBasePath = "actions/help/"; |
@@ -16,9 +16,9 @@ discard block |
||
| 16 | 16 | </script> |
| 17 | 17 | |
| 18 | 18 | <?php |
| 19 | - if($handle = opendir('actions/help')) {
|
|
| 20 | - while(false !== ($file = readdir($handle))) {
|
|
| 21 | - if($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) {
|
|
| 19 | + if($handle = opendir('actions/help')) { |
|
| 20 | + while(false !== ($file = readdir($handle))) { |
|
| 21 | + if($file != "." && $file != ".." && $file != ".svn" && $file != 'index.html' && !is_dir($helpBasePath . $file)) { |
|
| 22 | 22 | $help[] = $file; |
| 23 | 23 | } |
| 24 | 24 | } |
@@ -27,12 +27,12 @@ discard block |
||
| 27 | 27 | |
| 28 | 28 | natcasesort($help); |
| 29 | 29 | |
| 30 | - foreach($help as $k => $v) {
|
|
| 30 | + foreach($help as $k => $v) { |
|
| 31 | 31 | |
| 32 | 32 | $helpname = substr($v, 0, strrpos($v, '.')); |
| 33 | 33 | |
| 34 | 34 | $prefix = substr($helpname, 0, 2); |
| 35 | - if(is_numeric($prefix)) {
|
|
| 35 | + if(is_numeric($prefix)) { |
|
| 36 | 36 | $helpname = substr($helpname, 2, strlen($helpname) - 1); |
| 37 | 37 | } |
| 38 | 38 | |
@@ -18,8 +18,7 @@ |
||
| 18 | 18 | foreach($notices as $v) { |
| 19 | 19 | if ($v >= '1.3.0') { |
| 20 | 20 | $cms = 'EVO'; |
| 21 | - } |
|
| 22 | - else { |
|
| 21 | + } else { |
|
| 23 | 22 | $cms = 'MODX EVO'; |
| 24 | 23 | } |
| 25 | 24 | echo '<div class="sectionHeader"> '.$cms.' '.$v.'</div><div class="sectionBody">'; |
@@ -8,7 +8,8 @@ |
||
| 8 | 8 | <div class="sectionBody"> |
| 9 | 9 | <?php |
| 10 | 10 | $changeLog = MODX_BASE_PATH . 'assets/docs/changelog.txt'; |
| 11 | - if(is_readable($changeLog)) |
|
| 12 | - echo str_replace("\n",'<br>',file_get_contents($changeLog)); |
|
| 13 | -?> |
|
| 11 | + if(is_readable($changeLog)) { |
|
| 12 | + echo str_replace("\n",'<br>',file_get_contents($changeLog)); |
|
| 13 | + } |
|
| 14 | + ?> |
|
| 14 | 15 | </div> |
@@ -1,8 +1,8 @@ |
||
| 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 | -if(!$modx->hasPermission('change_password')) {
|
|
| 5 | +if(!$modx->hasPermission('change_password')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | ?> |