@@ -20,14 +20,14 @@ |
||
20 | 20 | ($docid > 0 ? "id='$docid'" : "privateweb = 1")); |
21 | 21 | $rs = $modx->getDatabase()->select( |
22 | 22 | 'DISTINCT sc.id', |
23 | - $modx->getDatabase()->getFullTableName("site_content") . " sc |
|
24 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName("document_groups") . " dg ON dg.document = sc.id |
|
25 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName("webgroup_access") . " wga ON wga.documentgroup = dg.document_group", |
|
26 | - ($docid > 0 ? " sc.id='{$docid}' AND " : "") . "wga.id>0" |
|
23 | + $modx->getDatabase()->getFullTableName("site_content")." sc |
|
24 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName("document_groups")." dg ON dg.document = sc.id |
|
25 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName("webgroup_access")." wga ON wga.documentgroup = dg.document_group", |
|
26 | + ($docid > 0 ? " sc.id='{$docid}' AND " : "")."wga.id>0" |
|
27 | 27 | ); |
28 | 28 | $ids = $modx->getDatabase()->getColumn("id", $rs); |
29 | 29 | if (count($ids) > 0) { |
30 | 30 | $modx->getDatabase()->update('privateweb = 1', $modx->getDatabase()->getFullTableName("site_content"), |
31 | - "id IN (" . implode(", ", $ids) . ")"); |
|
31 | + "id IN (".implode(", ", $ids).")"); |
|
32 | 32 | } |
33 | 33 | } |
@@ -34,7 +34,7 @@ |
||
34 | 34 | $newCat = $modx->getDatabase()->escape($newCat); |
35 | 35 | $cats = $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('categories'), "category='{$newCat}'"); |
36 | 36 | if ($cat = $modx->getDatabase()->getValue($cats)) { |
37 | - return (int)$cat; |
|
37 | + return (int) $cat; |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | return 0; |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class uploader { |
|
15 | +class uploader{ |
|
16 | 16 | |
17 | 17 | /** Release version */ |
18 | 18 | const VERSION = "2.54"; |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | |
73 | 73 | /** Next three properties are got from the current language file |
74 | 74 | * @var string */ |
75 | - protected $dateTimeFull; // Currently not used |
|
76 | - protected $dateTimeMid; // Currently not used |
|
75 | + protected $dateTimeFull; // Currently not used |
|
76 | + protected $dateTimeMid; // Currently not used |
|
77 | 77 | protected $dateTimeSmall; |
78 | 78 | |
79 | 79 | /** Contain Specified language labels |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | /** Magic method which allows read-only access to protected or private class properties |
105 | 105 | * @param string $property |
106 | 106 | * @return mixed */ |
107 | - public function __get($property) { |
|
107 | + public function __get($property){ |
|
108 | 108 | return property_exists($this, $property) ? $this->$property : null; |
109 | 109 | } |
110 | 110 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | * uploader constructor. |
113 | 113 | * @param DocumentParser $modx |
114 | 114 | */ |
115 | - public function __construct(DocumentParser $modx) { |
|
115 | + public function __construct(DocumentParser $modx){ |
|
116 | 116 | |
117 | 117 | //MODX |
118 | 118 | try { |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | // COOKIES INIT |
197 | 197 | $ip = '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'; |
198 | - $ip = '/^' . implode('\.', array($ip, $ip, $ip, $ip)) . '$/'; |
|
198 | + $ip = '/^'.implode('\.', array($ip, $ip, $ip, $ip)).'$/'; |
|
199 | 199 | if (preg_match($ip, $_SERVER['HTTP_HOST']) || |
200 | 200 | preg_match('/^[^\.]+$/', $_SERVER['HTTP_HOST']) |
201 | 201 | ) |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | ) { |
214 | 214 | list($unused, $protocol, $domain, $unused, $port, $path) = $patt; |
215 | 215 | $path = path::normalize($path); |
216 | - $this->config['uploadURL'] = "$protocol://$domain" . (strlen($port) ? ":$port" : "") . "/$path"; |
|
216 | + $this->config['uploadURL'] = "$protocol://$domain".(strlen($port) ? ":$port" : "")."/$path"; |
|
217 | 217 | $this->config['uploadDir'] = strlen($this->config['uploadDir']) |
218 | 218 | ? path::normalize($this->config['uploadDir']) |
219 | 219 | : path::url2fullPath("/$path"); |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | foreach ($this->langInputNames as $key) |
257 | 257 | if (isset($this->get[$key]) && |
258 | 258 | preg_match('/^[a-z][a-z\._\-]*$/i', $this->get[$key]) && |
259 | - file_exists("lang/" . strtolower($this->get[$key]) . ".php") |
|
259 | + file_exists("lang/".strtolower($this->get[$key]).".php") |
|
260 | 260 | ) { |
261 | 261 | $this->lang = $this->get[$key]; |
262 | 262 | break; |
@@ -290,12 +290,12 @@ discard block |
||
290 | 290 | /** |
291 | 291 | * @return array|bool|int|null|string|void |
292 | 292 | */ |
293 | - protected function getTransaliasSettings() { |
|
293 | + protected function getTransaliasSettings(){ |
|
294 | 294 | $modx = evolutionCMS(); |
295 | 295 | |
296 | 296 | // Cleaning uploaded filename? |
297 | 297 | $setting = $modx->getDatabase()->select('count(*)', $modx->getDatabase()->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); |
298 | - if ($modx->getDatabase()->getValue($setting)>0) { |
|
298 | + if ($modx->getDatabase()->getValue($setting) > 0) { |
|
299 | 299 | // Transalias plugin active? |
300 | 300 | $res = $modx->getDatabase()->select('properties', $modx->getDatabase()->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); |
301 | 301 | if ($properties = $modx->getDatabase()->getValue($res)) { |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | * @param $filename |
315 | 315 | * @return mixed|string |
316 | 316 | */ |
317 | - protected function normalizeFilename($filename) { |
|
317 | + protected function normalizeFilename($filename){ |
|
318 | 318 | if ($this->getTransaliasSettings()) { |
319 | 319 | $format = strrchr($filename, "."); |
320 | 320 | $filename = str_replace($format, "", $filename); |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | * @param $dirname |
328 | 328 | * @return string |
329 | 329 | */ |
330 | - protected function normalizeDirname($dirname) { |
|
330 | + protected function normalizeDirname($dirname){ |
|
331 | 331 | return $this->modx->stripAlias($dirname); |
332 | 332 | } |
333 | 333 | |
@@ -335,7 +335,7 @@ discard block |
||
335 | 335 | * @param array|null $aFile |
336 | 336 | * @return bool|mixed |
337 | 337 | */ |
338 | - protected function checkUploadedFile(array $aFile=null) { |
|
338 | + protected function checkUploadedFile(array $aFile = null){ |
|
339 | 339 | $config = &$this->config; |
340 | 340 | $file = ($aFile === null) ? $this->file : $aFile; |
341 | 341 | |
@@ -361,8 +361,7 @@ discard block |
||
361 | 361 | ($file['error'] == UPLOAD_ERR_NO_TMP_DIR) ? |
362 | 362 | $this->label("Missing a temporary folder.") : ( |
363 | 363 | ($file['error'] == UPLOAD_ERR_CANT_WRITE) ? |
364 | - $this->label("Failed to write file.") : |
|
365 | - $this->label("Unknown error.") |
|
364 | + $this->label("Failed to write file.") : $this->label("Unknown error.") |
|
366 | 365 | ))))); |
367 | 366 | |
368 | 367 | // HIDDEN FILENAMES CHECK |
@@ -397,7 +396,7 @@ discard block |
||
397 | 396 | |
398 | 397 | |
399 | 398 | // CHECK FOR MODX MAX FILE SIZE |
400 | - $actualfilesize=filesize($file['tmp_name']); |
|
399 | + $actualfilesize = filesize($file['tmp_name']); |
|
401 | 400 | if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) |
402 | 401 | return $this->label("File is too big: ".$actualfilesize." Bytes. (max ".$this->config['maxfilesize']." Bytes)"); |
403 | 402 | |
@@ -410,7 +409,7 @@ discard block |
||
410 | 409 | * @param bool $existing |
411 | 410 | * @return bool|string |
412 | 411 | */ |
413 | - protected function checkInputDir($dir, $inclType=true, $existing=true) { |
|
412 | + protected function checkInputDir($dir, $inclType = true, $existing = true){ |
|
414 | 413 | $dir = path::normalize($dir); |
415 | 414 | if (substr($dir, 0, 1) == "/") |
416 | 415 | $dir = substr($dir, 1); |
@@ -441,7 +440,7 @@ discard block |
||
441 | 440 | * @param $type |
442 | 441 | * @return bool |
443 | 442 | */ |
444 | - protected function validateExtension($ext, $type) { |
|
443 | + protected function validateExtension($ext, $type){ |
|
445 | 444 | $ext = trim(strtolower($ext)); |
446 | 445 | if (!isset($this->types[$type])) |
447 | 446 | return false; |
@@ -470,7 +469,7 @@ discard block |
||
470 | 469 | * @param $path |
471 | 470 | * @return mixed |
472 | 471 | */ |
473 | - protected function getTypeFromPath($path) { |
|
472 | + protected function getTypeFromPath($path){ |
|
474 | 473 | return preg_match('/^([^\/]*)\/.*$/', $path, $patt) |
475 | 474 | ? $patt[1] : $path; |
476 | 475 | } |
@@ -479,7 +478,7 @@ discard block |
||
479 | 478 | * @param $path |
480 | 479 | * @return string |
481 | 480 | */ |
482 | - protected function removeTypeFromPath($path) { |
|
481 | + protected function removeTypeFromPath($path){ |
|
483 | 482 | return preg_match('/^[^\/]*\/(.*)$/', $path, $patt) |
484 | 483 | ? $patt[1] : ""; |
485 | 484 | } |
@@ -489,7 +488,7 @@ discard block |
||
489 | 488 | * @param null $file |
490 | 489 | * @return bool |
491 | 490 | */ |
492 | - protected function imageResize($image, $file=null) { |
|
491 | + protected function imageResize($image, $file = null){ |
|
493 | 492 | |
494 | 493 | if (!($image instanceof image)) { |
495 | 494 | $img = image::factory($this->imageDriver, $image); |
@@ -577,19 +576,19 @@ discard block |
||
577 | 576 | $img->watermark($this->config['watermark']['file'], $left, $top); |
578 | 577 | } |
579 | 578 | |
580 | - $options = array( 'file' => $file ); |
|
579 | + $options = array('file' => $file); |
|
581 | 580 | |
582 | - $type = exif_imagetype( $file ); |
|
581 | + $type = exif_imagetype($file); |
|
583 | 582 | |
584 | - switch ( $type ) { |
|
583 | + switch ($type) { |
|
585 | 584 | case IMAGETYPE_GIF: |
586 | - return $img->output( 'gif', $options ); |
|
585 | + return $img->output('gif', $options); |
|
587 | 586 | |
588 | 587 | case IMAGETYPE_PNG: |
589 | - return $img->output( 'png', $options ); |
|
588 | + return $img->output('png', $options); |
|
590 | 589 | |
591 | 590 | default: |
592 | - return $img->output( 'jpeg', array_merge( $options, array( 'quality' => $this->config['jpegQuality'] ) ) ); |
|
591 | + return $img->output('jpeg', array_merge($options, array('quality' => $this->config['jpegQuality']))); |
|
593 | 592 | } |
594 | 593 | |
595 | 594 | } |
@@ -599,7 +598,7 @@ discard block |
||
599 | 598 | * @param bool $overwrite |
600 | 599 | * @return bool |
601 | 600 | */ |
602 | - protected function makeThumb($file, $overwrite=true) { |
|
601 | + protected function makeThumb($file, $overwrite = true){ |
|
603 | 602 | $img = image::factory($this->imageDriver, $file); |
604 | 603 | |
605 | 604 | // Drop files which are not images |
@@ -607,7 +606,7 @@ discard block |
||
607 | 606 | return true; |
608 | 607 | |
609 | 608 | $thumb = substr($file, strlen($this->config['uploadDir'])); |
610 | - $thumb = $this->config['uploadDir'] . "/" . $this->config['thumbsDir'] . "/" . $thumb; |
|
609 | + $thumb = $this->config['uploadDir']."/".$this->config['thumbsDir']."/".$thumb; |
|
611 | 610 | $thumb = path::normalize($thumb); |
612 | 611 | $thumbDir = dirname($thumb); |
613 | 612 | if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true)) |
@@ -630,15 +629,15 @@ discard block |
||
630 | 629 | if (!$img->resizeFit($this->config['thumbWidth'], $this->config['thumbHeight'])) |
631 | 630 | return false; |
632 | 631 | |
633 | - if ( $this->imageDriver == 'gd' ) { |
|
634 | - $width = imagesx( $img->image ); |
|
635 | - $height = imagesy( $img->image ); |
|
636 | - $back = image::factory( $this->imageDriver, array( $width, $height ) ); |
|
637 | - $tile = image::factory( $this->imageDriver, __DIR__ . '/../themes/' . $this->config['theme'] . '/img/bg_transparent.png' ); |
|
632 | + if ($this->imageDriver == 'gd') { |
|
633 | + $width = imagesx($img->image); |
|
634 | + $height = imagesy($img->image); |
|
635 | + $back = image::factory($this->imageDriver, array($width, $height)); |
|
636 | + $tile = image::factory($this->imageDriver, __DIR__.'/../themes/'.$this->config['theme'].'/img/bg_transparent.png'); |
|
638 | 637 | |
639 | - imagesettile( $back->image, $tile->image ); |
|
640 | - imagefilledrectangle( $back->image, 0, 0, $width, $height, IMG_COLOR_TILED ); |
|
641 | - imagecopy( $back->image, $img->image, 0, 0, 0, 0, $width, $height ); |
|
638 | + imagesettile($back->image, $tile->image); |
|
639 | + imagefilledrectangle($back->image, 0, 0, $width, $height, IMG_COLOR_TILED); |
|
640 | + imagecopy($back->image, $img->image, 0, 0, 0, 0, $width, $height); |
|
642 | 641 | |
643 | 642 | $img = $back; |
644 | 643 | } |
@@ -653,7 +652,7 @@ discard block |
||
653 | 652 | /** |
654 | 653 | * @param $langCode |
655 | 654 | */ |
656 | - protected function localize($langCode) { |
|
655 | + protected function localize($langCode){ |
|
657 | 656 | require "lang/{$langCode}.php"; |
658 | 657 | setlocale(LC_ALL, $lang['_locale']); |
659 | 658 | $this->charset = $lang['_charset']; |
@@ -673,7 +672,7 @@ discard block |
||
673 | 672 | * @param array|null $data |
674 | 673 | * @return mixed |
675 | 674 | */ |
676 | - protected function label($string, array $data=null) { |
|
675 | + protected function label($string, array $data = null){ |
|
677 | 676 | $return = isset($this->labels[$string]) ? $this->labels[$string] : $string; |
678 | 677 | if (is_array($data)) |
679 | 678 | foreach ($data as $key => $val) |
@@ -685,7 +684,7 @@ discard block |
||
685 | 684 | * @param $message |
686 | 685 | * @param array|null $data |
687 | 686 | */ |
688 | - protected function backMsg($message, array $data=null) { |
|
687 | + protected function backMsg($message, array $data = null){ |
|
689 | 688 | $message = $this->label($message, $data); |
690 | 689 | if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name'])) |
691 | 690 | @unlink($this->file['tmp_name']); |
@@ -697,7 +696,7 @@ discard block |
||
697 | 696 | * @param $url |
698 | 697 | * @param string $message |
699 | 698 | */ |
700 | - protected function callBack($url, $message="") { |
|
699 | + protected function callBack($url, $message = ""){ |
|
701 | 700 | $message = text::jsValue($message); |
702 | 701 | $CKfuncNum = isset($this->opener['CKEditor']['funcNum']) |
703 | 702 | ? $this->opener['CKEditor']['funcNum'] : 0; |
@@ -741,7 +740,7 @@ discard block |
||
741 | 740 | /** |
742 | 741 | * @return string |
743 | 742 | */ |
744 | - protected function get_htaccess() { |
|
743 | + protected function get_htaccess(){ |
|
745 | 744 | return "<IfModule mod_php4.c> |
746 | 745 | php_value engine off |
747 | 746 | </IfModule> |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -abstract class image { |
|
15 | +abstract class image{ |
|
16 | 16 | const DEFAULT_JPEG_QUALITY = 75; |
17 | 17 | |
18 | 18 | /** Image resource or object |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | * @param string $property |
42 | 42 | * @return mixed */ |
43 | 43 | |
44 | - final public function __get($property) { |
|
44 | + final public function __get($property){ |
|
45 | 45 | return property_exists($this, $property) ? $this->$property : null; |
46 | 46 | } |
47 | 47 | |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | * @param mixed $image |
58 | 58 | * @param array $options */ |
59 | 59 | |
60 | - public function __construct($image, array $options=array()) { |
|
60 | + public function __construct($image, array $options = array()){ |
|
61 | 61 | $this->image = $this->width = $this->height = null; |
62 | 62 | $imageDetails = $this->buildImage($image); |
63 | 63 | |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | * @param mixed $image |
76 | 76 | * @return object */ |
77 | 77 | |
78 | - final static function factory($driver, $image, array $options=array()) { |
|
78 | + final static function factory($driver, $image, array $options = array()){ |
|
79 | 79 | $class = "image_$driver"; |
80 | 80 | return new $class($image, $options); |
81 | 81 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | * @param array $drivers |
87 | 87 | * @return string */ |
88 | 88 | |
89 | - final static function getDriver(array $drivers=array('gd')) { |
|
89 | + final static function getDriver(array $drivers = array('gd')){ |
|
90 | 90 | foreach ($drivers as $driver) { |
91 | 91 | if (!preg_match('/^[a-z0-9\_]+$/i', $driver)) |
92 | 92 | continue; |
@@ -105,7 +105,7 @@ discard block |
||
105 | 105 | * @param mixed $image |
106 | 106 | * @return array */ |
107 | 107 | |
108 | - final protected function buildImage($image) { |
|
108 | + final protected function buildImage($image){ |
|
109 | 109 | $class = get_class($this); |
110 | 110 | if ($image instanceof $class) { |
111 | 111 | $width = $image->width; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | * @param integer $resizedHeight |
130 | 130 | * @return integer */ |
131 | 131 | |
132 | - final public function getPropWidth($resizedHeight) { |
|
132 | + final public function getPropWidth($resizedHeight){ |
|
133 | 133 | $width = round(($this->width * $resizedHeight) / $this->height); |
134 | 134 | if (!$width) $width = 1; |
135 | 135 | return $width; |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | * @param integer $resizedWidth |
141 | 141 | * @return integer */ |
142 | 142 | |
143 | - final public function getPropHeight($resizedWidth) { |
|
143 | + final public function getPropHeight($resizedWidth){ |
|
144 | 144 | $height = round(($this->height * $resizedWidth) / $this->width); |
145 | 145 | if (!$height) $height = 1; |
146 | 146 | return $height; |
@@ -151,13 +151,13 @@ discard block |
||
151 | 151 | * static method should be implemented into driver classes like abstract |
152 | 152 | * methods |
153 | 153 | * @return bool */ |
154 | - static function available() { return false; } |
|
154 | + static function available(){ return false; } |
|
155 | 155 | |
156 | 156 | /** Checks if file is an image. This static method should be implemented into |
157 | 157 | * driver classes like abstract methods |
158 | 158 | * @param string $file |
159 | 159 | * @return bool */ |
160 | - static function checkImage($file) { return false; } |
|
160 | + static function checkImage($file){ return false; } |
|
161 | 161 | |
162 | 162 | /** Resize image. Should return TRUE on success or FALSE on failure |
163 | 163 | * @param integer $width |
@@ -173,21 +173,21 @@ discard block |
||
173 | 173 | * @param integer $height |
174 | 174 | * @param mixed $background |
175 | 175 | * @return bool */ |
176 | - abstract public function resizeFit($width, $height, $background=false); |
|
176 | + abstract public function resizeFit($width, $height, $background = false); |
|
177 | 177 | |
178 | 178 | /** Resize and crop the image to fit in given resolution. Returns TRUE on |
179 | 179 | * success or FALSE on failure |
180 | 180 | * @param mixed $src |
181 | 181 | * @param integer $offset |
182 | 182 | * @return bool */ |
183 | - abstract public function resizeCrop($width, $height, $offset=false); |
|
183 | + abstract public function resizeCrop($width, $height, $offset = false); |
|
184 | 184 | |
185 | 185 | |
186 | 186 | /** Rotate image |
187 | 187 | * @param integer $angle |
188 | 188 | * @param string $background |
189 | 189 | * @return bool */ |
190 | - abstract public function rotate($angle, $background="#000000"); |
|
190 | + abstract public function rotate($angle, $background = "#000000"); |
|
191 | 191 | |
192 | 192 | abstract public function flipHorizontal(); |
193 | 193 | |
@@ -203,7 +203,7 @@ discard block |
||
203 | 203 | * @param mixed $top |
204 | 204 | * @param mixed $left |
205 | 205 | * @return bool */ |
206 | - abstract public function watermark($file, $left=false, $top=false); |
|
206 | + abstract public function watermark($file, $left = false, $top = false); |
|
207 | 207 | |
208 | 208 | /** Should output the image. Second parameter is used to pass some options like |
209 | 209 | * 'file' - if is set, the output will be written to a file |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * @param string $type |
213 | 213 | * @param array $options |
214 | 214 | * @return bool */ |
215 | - abstract public function output($type='jpeg', array $options=array()); |
|
215 | + abstract public function output($type = 'jpeg', array $options = array()); |
|
216 | 216 | |
217 | 217 | /** This method should create a blank image with selected size. Should returns |
218 | 218 | * resource or object related to the created image, which will be passed to |
@@ -37,14 +37,14 @@ discard block |
||
37 | 37 | mail_check_timeperiod: {{ $modx->getConfig('mail_check_timeperiod') }}, |
38 | 38 | menu_height: {{ (int)$modx->getConfig('manager_menu_height') }}, |
39 | 39 | tree_width: {{ (int)$MODX_widthSideBar }}, |
40 | - tree_min_width: <?= (int)$tree_min_width ?>, |
|
41 | - session_timeout: <?= (int)$modx->getConfig('session_timeout') ?>, |
|
42 | - site_start: <?= (int)$modx->getConfig('site_start') ?>, |
|
40 | + tree_min_width: <?= (int) $tree_min_width ?>, |
|
41 | + session_timeout: <?= (int) $modx->getConfig('session_timeout') ?>, |
|
42 | + site_start: <?= (int) $modx->getConfig('site_start') ?>, |
|
43 | 43 | tree_page_click: {{ $modx->getConfig('tree_page_click') }}, |
44 | 44 | theme: '{{ ManagerTheme::getTheme() }}', |
45 | 45 | theme_mode: '{{ ManagerTheme::getThemeStyle() }}', |
46 | 46 | which_browser: '<?= $user['which_browser'] ?>', |
47 | - layout: <?= (int)$modx->getConfig('manager_layout') ?>, |
|
47 | + layout: <?= (int) $modx->getConfig('manager_layout') ?>, |
|
48 | 48 | textdir: '<?= ManagerTheme::getTextDir() ?>', |
49 | 49 | global_tabs: <?= $modx->getConfig('global_tabs') ?> |
50 | 50 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | delete a[b]; |
130 | 130 | }, |
131 | 131 | openedArray: [], |
132 | - lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?> |
|
132 | + lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE)."\n" ?> |
|
133 | 133 | }; |
134 | 134 | <?php |
135 | 135 | $opened = array_filter( |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | ) |
142 | 142 | ) |
143 | 143 | ); |
144 | - echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n modx.openedArray[", $opened) . '] = 1;') . "\n"; |
|
144 | + echo (empty($opened) ? '' : 'modx.openedArray['.implode("] = 1;\n modx.openedArray[", $opened).'] = 1;')."\n"; |
|
145 | 145 | ?> |
146 | 146 | </script> |
147 | 147 | <script src="{{ ManagerTheme::getThemeUrl() }}js/modx.min.js?v=<?= EVO_INSTALL_TIME ?>"></script> |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | <a href="javascript:;" class="dropdown-toggle" onclick="return false;"> |
222 | 222 | <span class="username"><?= entities($user['username'], $modx->getConfig('modx_charset')) ?></span> |
223 | 223 | <?php if ($user['photo']) { ?> |
224 | - <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL . entities($user['photo'], $modx->getConfig('modx_charset')) ?>);"></span> |
|
224 | + <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL.entities($user['photo'], $modx->getConfig('modx_charset')) ?>);"></span> |
|
225 | 225 | <?php } else { ?> |
226 | 226 | <span class="icon"><i class="fa fa-user-circle"></i></span> |
227 | 227 | <?php } ?> |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | $version = 'Evolution'; |
249 | 249 | ?> |
250 | 250 | <?php |
251 | - echo sprintf('<li><span class="dropdown-item" title="%s – %s" %s>' . $version . ' %s</span></li>', $modx->getPhpCompat()->entities($modx->getConfig('site_name')), $modx->getVersionData('full_appname'), $style, $modx->getConfig('settings_version')); |
|
251 | + echo sprintf('<li><span class="dropdown-item" title="%s – %s" %s>'.$version.' %s</span></li>', $modx->getPhpCompat()->entities($modx->getConfig('site_name')), $modx->getVersionData('full_appname'), $style, $modx->getConfig('settings_version')); |
|
252 | 252 | ?> |
253 | 253 | </ul> |
254 | 254 | </li> |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | <?php |
316 | 316 | // invoke OnManagerTreeInit event |
317 | 317 | $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST); |
318 | - if(is_array($evtOut)) { |
|
318 | + if (is_array($evtOut)) { |
|
319 | 319 | echo implode("\n", $evtOut); |
320 | 320 | } |
321 | 321 | ?> |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | |
328 | 328 | <a class="treeButton" id="treeMenu_collapsetree" onclick="modx.tree.collapseTree();" title="<?php echo $_lang['collapse_tree']; ?>"><i class="fa fa-arrow-circle-up"></i></a> |
329 | 329 | |
330 | - <?php if($modx->hasPermission('new_document')) { ?> |
|
330 | + <?php if ($modx->hasPermission('new_document')) { ?> |
|
331 | 331 | <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']; ?>"><i class="fa fa-file"></i></a> |
332 | 332 | <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']; ?>"><i class="fa fa-link"></i></a> |
333 | 333 | <?php } ?> |
@@ -336,23 +336,23 @@ discard block |
||
336 | 336 | |
337 | 337 | <a class="treeButton" id="treeMenu_sortingtree" onclick="modx.tree.showSorter(event);" title="<?php echo $_lang['sort_tree']; ?>"><i class="fa fa-sort"></i></a> |
338 | 338 | |
339 | - <?php if($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { ?> |
|
339 | + <?php if ($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { ?> |
|
340 | 340 | <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']; ?>"><i class="fa fa-sort-numeric-asc"></i></a> |
341 | 341 | <?php } ?> |
342 | 342 | |
343 | 343 | @if($modx->getConfig('use_browser') && $modx->hasPermission('assets_images')) |
344 | - <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"] . "\n" . $_lang['em_button_shift'] ?>"><i class="fa fa-camera"></i></a> |
|
344 | + <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"]."\n".$_lang['em_button_shift'] ?>"><i class="fa fa-camera"></i></a> |
|
345 | 345 | @endif |
346 | 346 | |
347 | 347 | @if($modx->getConfig('use_browser') && $modx->hasPermission('assets_files')) |
348 | - <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"] . "\n" . $_lang['em_button_shift'] ?>"><i class="fa fa-files-o"></i></a> |
|
348 | + <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"]."\n".$_lang['em_button_shift'] ?>"><i class="fa fa-files-o"></i></a> |
|
349 | 349 | @endif |
350 | 350 | |
351 | - <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
352 | - <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"] . "\n" . $_lang['em_button_shift'] ?>"><i class="fa fa-th"></i></a> |
|
351 | + <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
352 | + <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"]."\n".$_lang['em_button_shift'] ?>"><i class="fa fa-th"></i></a> |
|
353 | 353 | <?php } ?> |
354 | 354 | |
355 | - <?php if($modx->hasPermission('empty_trash')) { ?> |
|
355 | + <?php if ($modx->hasPermission('empty_trash')) { ?> |
|
356 | 356 | <a class="treeButton treeButtonDisabled" id="treeMenu_emptytrash" title="<?php echo $_lang['empty_recycle_bin_empty']; ?>"><i class="fa fa-trash-o"></i></a> |
357 | 357 | <?php } ?> |
358 | 358 | |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | <?php |
365 | 365 | // invoke OnManagerTreePrerender event |
366 | 366 | $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->getDatabase()->escape($_REQUEST)); |
367 | - if(is_array($evtOut)) { |
|
367 | + if (is_array($evtOut)) { |
|
368 | 368 | echo implode("\n", $evtOut); |
369 | 369 | } |
370 | 370 | $siteName = $modx->getPhpCompat()->entities($modx->getConfig('site_name')); |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | <?php |
377 | 377 | // invoke OnManagerTreeRender event |
378 | 378 | $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->getDatabase()->escape($_REQUEST)); |
379 | - if(is_array($evtOut)) { |
|
379 | + if (is_array($evtOut)) { |
|
380 | 380 | echo implode("\n", $evtOut); |
381 | 381 | } |
382 | 382 | ?> |
@@ -470,7 +470,7 @@ discard block |
||
470 | 470 | </div> |
471 | 471 | |
472 | 472 | <?php |
473 | -if(!function_exists('constructLink')) { |
|
473 | +if (!function_exists('constructLink')) { |
|
474 | 474 | /** |
475 | 475 | * @param string $action |
476 | 476 | * @param string $img |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | */ |
480 | 480 | function constructLink($action, $img, $text, $allowed) |
481 | 481 | { |
482 | - if ((bool)$allowed) { |
|
482 | + if ((bool) $allowed) { |
|
483 | 483 | echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action, |
484 | 484 | $action); |
485 | 485 | echo sprintf('<i class="%s"></i> %s</div>', $img, $text); |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | <script type="text/javascript"> |
521 | 521 | |
522 | 522 | if (document.getElementById('treeMenu')) { |
523 | - <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
523 | + <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
524 | 524 | |
525 | 525 | document.getElementById('treeMenu_openelements').onclick = function(e) { |
526 | 526 | e.preventDefault(); |
@@ -2,7 +2,7 @@ |
||
2 | 2 | global $SystemAlertMsgQueque; |
3 | 3 | // display system alert window if messages are available |
4 | 4 | if (count($SystemAlertMsgQueque) > 0) { |
5 | - include MODX_MANAGER_PATH . 'includes/sysalert.display.inc.php'; |
|
5 | + include MODX_MANAGER_PATH.'includes/sysalert.display.inc.php'; |
|
6 | 6 | } |
7 | 7 | ?> |
8 | 8 | @stack('scripts.bot') |
@@ -1,5 +1,5 @@ |
||
1 | 1 | <?php /** get the mutate page for adding content */ ?> |
2 | 2 | @extends('manager::template.page') |
3 | 3 | @section('content') |
4 | - <?php include_once evolutionCMS()->get('ManagerTheme')->getFileProcessor("actions/mutate_content.dynamic.php");?> |
|
4 | + <?php include_once evolutionCMS()->get('ManagerTheme')->getFileProcessor("actions/mutate_content.dynamic.php"); ?> |
|
5 | 5 | @endsection |
@@ -498,19 +498,19 @@ |
||
498 | 498 | if ($checked) { |
499 | 499 | $notPublic = true; |
500 | 500 | } |
501 | - $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>"; |
|
501 | + $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='".$row['id']."' ".($checked ? "checked='checked'" : '')." onclick=\"makePublic(false)\" /> ".$row['name']."</label></li>"; |
|
502 | 502 | } else { |
503 | 503 | if ($checked) { |
504 | - echo "<input type='hidden' name='docgroups[]' value='" . $row['id'] . "' />"; |
|
504 | + echo "<input type='hidden' name='docgroups[]' value='".$row['id']."' />"; |
|
505 | 505 | } |
506 | 506 | } |
507 | 507 | } |
508 | 508 | |
509 | 509 | if ($modx->hasPermission('access_permissions')) { |
510 | - $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (empty($notPublic) ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks; |
|
510 | + $chks = "<li><label><input type='checkbox' name='chkalldocs' ".(empty($notPublic) ? "checked='checked'" : '')." onclick=\"makePublic(true)\" /> <span class='warning'>".$_lang['all_doc_groups']."</span></label></li>".$chks; |
|
511 | 511 | } |
512 | 512 | |
513 | - echo '<ul>' . $chks . '</ul>'; |
|
513 | + echo '<ul>'.$chks.'</ul>'; |
|
514 | 514 | |
515 | 515 | ?> |
516 | 516 | </div> |
@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | @section('content') |
4 | 4 | <?php /*include_once evolutionCMS()->get('ManagerTheme')->getFileProcessor("actions/document_data.static.php"); */?> |
5 | 5 | <?php |
6 | - if(isset($_REQUEST['id'])) { |
|
6 | + if (isset($_REQUEST['id'])) { |
|
7 | 7 | $id = (int) $_REQUEST['id']; |
8 | 8 | } else { |
9 | 9 | $id = 0; |
10 | 10 | } |
11 | 11 | |
12 | - if(isset($_GET['opened'])) { |
|
12 | + if (isset($_GET['opened'])) { |
|
13 | 13 | $_SESSION['openedArray'] = $_GET['opened']; |
14 | 14 | } |
15 | 15 | |
@@ -20,16 +20,16 @@ discard block |
||
20 | 20 | $tbl_site_templates = $modx->getDatabase()->getFullTableName('site_templates'); |
21 | 21 | |
22 | 22 | // Get access permissions |
23 | - if($_SESSION['mgrDocgroups']) { |
|
23 | + if ($_SESSION['mgrDocgroups']) { |
|
24 | 24 | $docgrp = implode(",", $_SESSION['mgrDocgroups']); |
25 | 25 | } |
26 | - $access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
26 | + $access = "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0".(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
27 | 27 | |
28 | 28 | // |
29 | - if($_SESSION['tree_show_only_folders']) { |
|
30 | - $parent = $id ? ($modx->getDatabase()->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; |
|
31 | - $isfolder = $modx->getDatabase()->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1"); |
|
32 | - if(!$isfolder && $parent != 0) { |
|
29 | + if ($_SESSION['tree_show_only_folders']) { |
|
30 | + $parent = $id ? ($modx->getDatabase()->getValue("SELECT parent FROM ".$tbl_site_content." WHERE id=$id LIMIT 1")) : 0; |
|
31 | + $isfolder = $modx->getDatabase()->getValue("SELECT isfolder FROM ".$tbl_site_content." WHERE id=$id LIMIT 1"); |
|
32 | + if (!$isfolder && $parent != 0) { |
|
33 | 33 | $id = $_REQUEST['id'] = $parent; |
34 | 34 | } |
35 | 35 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $rs = $modx->getDatabase()->select('DISTINCT sc.*', "{$tbl_site_content} AS sc |
39 | 39 | LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.id ='{$id}' AND ({$access})"); |
40 | 40 | $content = $modx->getDatabase()->getRow($rs); |
41 | - if(!$content) { |
|
41 | + if (!$content) { |
|
42 | 42 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
43 | 43 | } |
44 | 44 | |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | ); |
81 | 81 | $filter_sort = ''; |
82 | 82 | $filter_dir = ''; |
83 | - if($numRecords > 0) { |
|
84 | - $filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&dir=' . $dir . '&sort=\'+this.options[this.selectedIndex].value">' . '<option value="createdon"' . (($sort == 'createdon') ? ' selected' : '') . '>' . $_lang['createdon'] . '</option>' . '<option value="pub_date"' . (($sort == 'pub_date') ? ' selected' : '') . '>' . $_lang["page_data_publishdate"] . '</option>' . '<option value="pagetitle"' . (($sort == 'pagetitle') ? ' selected' : '') . '>' . $_lang['pagetitle'] . '</option>' . '<option value="menuindex"' . (($sort == 'menuindex') ? ' selected' : '') . '>' . $_lang['resource_opt_menu_index'] . '</option>' . //******** resource_opt_is_published - // |
|
85 | - '<option value="published"' . (($sort == 'published') ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . //********// |
|
83 | + if ($numRecords > 0) { |
|
84 | + $filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id='.$id.'&dir='.$dir.'&sort=\'+this.options[this.selectedIndex].value">'.'<option value="createdon"'.(($sort == 'createdon') ? ' selected' : '').'>'.$_lang['createdon'].'</option>'.'<option value="pub_date"'.(($sort == 'pub_date') ? ' selected' : '').'>'.$_lang["page_data_publishdate"].'</option>'.'<option value="pagetitle"'.(($sort == 'pagetitle') ? ' selected' : '').'>'.$_lang['pagetitle'].'</option>'.'<option value="menuindex"'.(($sort == 'menuindex') ? ' selected' : '').'>'.$_lang['resource_opt_menu_index'].'</option>'.//******** resource_opt_is_published - // |
|
85 | + '<option value="published"'.(($sort == 'published') ? ' selected' : '').'>'.$_lang['resource_opt_is_published'].'</option>'.//********// |
|
86 | 86 | '</select>'; |
87 | - $filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&sort=' . $sort . '&dir=\'+this.options[this.selectedIndex].value">' . '<option value="DESC"' . (($dir == 'DESC') ? ' selected' : '') . '>' . $_lang['sort_desc'] . '</option>' . '<option value="ASC"' . (($dir == 'ASC') ? ' selected' : '') . '>' . $_lang['sort_asc'] . '</option>' . '</select>'; |
|
87 | + $filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id='.$id.'&sort='.$sort.'&dir=\'+this.options[this.selectedIndex].value">'.'<option value="DESC"'.(($dir == 'DESC') ? ' selected' : '').'>'.$_lang['sort_desc'].'</option>'.'<option value="ASC"'.(($dir == 'ASC') ? ' selected' : '').'>'.$_lang['sort_asc'].'</option>'.'</select>'; |
|
88 | 88 | $resource = $modx->getDatabase()->makeArray($rs); |
89 | 89 | |
90 | 90 | // CSS style for table |
@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | ); |
129 | 129 | $modx->getMakeTable()->setColumnWidths($tbWidth); |
130 | 130 | |
131 | - $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; |
|
132 | - $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; |
|
133 | - $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; |
|
134 | - $add_path = $sd . $sb . $pg; |
|
131 | + $sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC'; |
|
132 | + $sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon'; |
|
133 | + $pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : ''; |
|
134 | + $add_path = $sd.$sb.$pg; |
|
135 | 135 | |
136 | 136 | $icons = array( |
137 | 137 | 'text/html' => $_style['tree_page_html'], |
@@ -149,9 +149,9 @@ discard block |
||
149 | 149 | ); |
150 | 150 | |
151 | 151 | $listDocs = array(); |
152 | - foreach($resource as $k => $children) { |
|
152 | + foreach ($resource as $k => $children) { |
|
153 | 153 | |
154 | - switch($children['id']) { |
|
154 | + switch ($children['id']) { |
|
155 | 155 | case $modx->getConfig('site_start') : |
156 | 156 | $icon = $_style['tree_page_home']; |
157 | 157 | break; |
@@ -165,10 +165,10 @@ discard block |
||
165 | 165 | $icon = $_style['tree_page_info']; |
166 | 166 | break; |
167 | 167 | default: |
168 | - if($children['isfolder']) { |
|
168 | + if ($children['isfolder']) { |
|
169 | 169 | $icon = $_style['tree_folder_new']; |
170 | 170 | } else { |
171 | - if(isset($icons[$children['contentType']])) { |
|
171 | + if (isset($icons[$children['contentType']])) { |
|
172 | 172 | $icon = $icons[$children['contentType']]; |
173 | 173 | } else { |
174 | 174 | $icon = $_style['tree_page']; |
@@ -183,32 +183,32 @@ discard block |
||
183 | 183 | $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); |
184 | 184 | //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); |
185 | 185 | //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); |
186 | - if($modx->hasPermission('edit_document')) { |
|
187 | - $title = '<span class="doc-item' . $private . '">' . $icon . '<a href="index.php?a=27&id=' . $children['id'] . $add_path . '">' . '<span class="' . $class . '">' . entities($children['pagetitle'], $modx->getConfig('modx_charset')) . '</span></a></span>'; |
|
186 | + if ($modx->hasPermission('edit_document')) { |
|
187 | + $title = '<span class="doc-item'.$private.'">'.$icon.'<a href="index.php?a=27&id='.$children['id'].$add_path.'">'.'<span class="'.$class.'">'.entities($children['pagetitle'], $modx->getConfig('modx_charset')).'</span></a></span>'; |
|
188 | 188 | } else { |
189 | - $title = '<span class="doc-item' . $private . '">' . $icon . '<span class="' . $class . '">' . entities($children['pagetitle'], $modx->getConfig('modx_charset')) . '</span></span>'; |
|
189 | + $title = '<span class="doc-item'.$private.'">'.$icon.'<span class="'.$class.'">'.entities($children['pagetitle'], $modx->getConfig('modx_charset')).'</span></span>'; |
|
190 | 190 | } |
191 | 191 | |
192 | - $icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&id=' . $children['id'] . $add_path . '" title="' . $_lang["publish_resource"] . '"><i class="' . $_style["icons_publish_document"] . '"></i></a>' : '<a href="index.php?a=62&id=' . $children['id'] . $add_path . '" title="' . $_lang["unpublish_resource"] . '"><i class="' . $_style["icons_unpublish_resource"] . '" ></i></a>'; |
|
192 | + $icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&id='.$children['id'].$add_path.'" title="'.$_lang["publish_resource"].'"><i class="'.$_style["icons_publish_document"].'"></i></a>' : '<a href="index.php?a=62&id='.$children['id'].$add_path.'" title="'.$_lang["unpublish_resource"].'"><i class="'.$_style["icons_unpublish_resource"].'" ></i></a>'; |
|
193 | 193 | |
194 | - $icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\'' . $_lang["confirm_delete_resource"] . '\')" href="index.php?a=6&id=' . $children['id'] . $add_path . '" title="' . $_lang['delete_resource'] . '"><i class="' . $_style["icons_delete_resource"] . '"></i></a>' : '<a onclick="return confirm(\'' . $_lang["confirm_undelete"] . '\')" href="index.php?a=63&id=' . $children['id'] . $add_path . '" title="' . $_lang['undelete_resource'] . '"><i class="' . $_style["icons_undelete_resource"] . '"></i></a>'; |
|
194 | + $icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\''.$_lang["confirm_delete_resource"].'\')" href="index.php?a=6&id='.$children['id'].$add_path.'" title="'.$_lang['delete_resource'].'"><i class="'.$_style["icons_delete_resource"].'"></i></a>' : '<a onclick="return confirm(\''.$_lang["confirm_undelete"].'\')" href="index.php?a=63&id='.$children['id'].$add_path.'" title="'.$_lang['undelete_resource'].'"><i class="'.$_style["icons_undelete_resource"].'"></i></a>'; |
|
195 | 195 | |
196 | 196 | $listDocs[] = array( |
197 | - 'docid' => '<div class="text-right">' . $children['id'] . '</div>', |
|
197 | + 'docid' => '<div class="text-right">'.$children['id'].'</div>', |
|
198 | 198 | 'title' => $title, |
199 | - 'createdon' => '<div class="text-right">' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '</div>', |
|
200 | - 'pub_date' => '<div class="text-right">' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '</div>', |
|
201 | - 'status' => '<div class="text-nowrap">' . ($children['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publishedDoc">' . $_lang['page_data_published'] . '</span>') . '</div>', |
|
202 | - 'edit' => '<div class="actions text-center text-nowrap">' . ($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&id=' . $children['id'] . $add_path . '" title="' . $_lang['edit'] . '"><i class="' . $_style["icons_edit_resource"] . '"></i></a><a href="index.php?a=51&id=' . $children['id'] . $add_path . '" title="' . $_lang['move'] . '"><i |
|
203 | - class="' . $_style["icons_move_document"] . '"></i></a>' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '</div>' |
|
199 | + 'createdon' => '<div class="text-right">'.($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')).'</div>', |
|
200 | + 'pub_date' => '<div class="text-right">'.($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '').'</div>', |
|
201 | + 'status' => '<div class="text-nowrap">'.($children['published'] == 0 ? '<span class="unpublishedDoc">'.$_lang['page_data_unpublished'].'</span>' : '<span class="publishedDoc">'.$_lang['page_data_published'].'</span>').'</div>', |
|
202 | + 'edit' => '<div class="actions text-center text-nowrap">'.($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&id='.$children['id'].$add_path.'" title="'.$_lang['edit'].'"><i class="'.$_style["icons_edit_resource"].'"></i></a><a href="index.php?a=51&id='.$children['id'].$add_path.'" title="'.$_lang['move'].'"><i |
|
203 | + class="' . $_style["icons_move_document"].'"></i></a>'.$icon_pub_unpub : '').($modx->hasPermission('delete_document') ? $icon_del_undel : '').'</div>' |
|
204 | 204 | ); |
205 | 205 | } |
206 | 206 | |
207 | - $modx->getMakeTable()->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); |
|
208 | - $children_output = $modx->getMakeTable()->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); |
|
207 | + $modx->getMakeTable()->createPagingNavigation($numRecords, 'a=3&id='.$content['id'].'&dir='.$dir.'&sort='.$sort); |
|
208 | + $children_output = $modx->getMakeTable()->create($listDocs, $listTableHeader, 'index.php?a=3&id='.$content['id']); |
|
209 | 209 | } else { |
210 | 210 | // No Child documents |
211 | - $children_output = '<div class="container"><p>' . $_lang['resources_in_container_no'] . '</p></div>'; |
|
211 | + $children_output = '<div class="container"><p>'.$_lang['resources_in_container_no'].'</p></div>'; |
|
212 | 212 | } |
213 | 213 | ?> |
214 | 214 | <script type="text/javascript"> |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | }, |
235 | 235 | cancel: function() { |
236 | 236 | documentDirty = false; |
237 | - document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id=' . $id . $add_path) ?>'; |
|
237 | + document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id='.$id.$add_path) ?>'; |
|
238 | 238 | }, |
239 | 239 | move: function() { |
240 | 240 | document.location.href = "index.php?id=<?= $_REQUEST['id'] ?>&a=51"; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | } |
246 | 246 | }, |
247 | 247 | view: function() { |
248 | - window.open('<?= ($modx->getConfig('friendly_urls')) ? UrlProcessor::makeUrl($id) : MODX_SITE_URL . 'index.php?id=' . $id ?>', 'previeWin'); |
|
248 | + window.open('<?= ($modx->getConfig('friendly_urls')) ? UrlProcessor::makeUrl($id) : MODX_SITE_URL.'index.php?id='.$id ?>', 'previeWin'); |
|
249 | 249 | } |
250 | 250 | }; |
251 | 251 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | <script type="text/javascript" src="media/script/tablesort.js"></script> |
254 | 254 | |
255 | 255 | <h1> |
256 | - <i class="fa fa-info"></i><?= entities(iconv_substr($content['pagetitle'], 0, 50, $modx->getConfig('modx_charset')), $modx->getConfig('modx_charset')) . (iconv_strlen($content['pagetitle'], $modx->getConfig('modx_charset')) > 50 ? '...' : '') . ' <small>(' . (int)$_REQUEST['id'] . ')</small>' ?> |
|
256 | + <i class="fa fa-info"></i><?= entities(iconv_substr($content['pagetitle'], 0, 50, $modx->getConfig('modx_charset')), $modx->getConfig('modx_charset')).(iconv_strlen($content['pagetitle'], $modx->getConfig('modx_charset')) > 50 ? '...' : '').' <small>('.(int) $_REQUEST['id'].')</small>' ?> |
|
257 | 257 | </h1> |
258 | 258 | |
259 | 259 | <?= $_style['actionbuttons']['static']['document'] ?> |
@@ -280,16 +280,16 @@ discard block |
||
280 | 280 | <tr> |
281 | 281 | <td width="200" valign="top">{{ ManagerTheme::getLexicon('long_title') }}:</td> |
282 | 282 | <td> |
283 | - <small><?= $content['longtitle'] != '' ? entities($content['longtitle'], $modx->getConfig('modx_charset')) : "(<i>" . $_lang['not_set'] . "</i>)" ?></small> |
|
283 | + <small><?= $content['longtitle'] != '' ? entities($content['longtitle'], $modx->getConfig('modx_charset')) : "(<i>".$_lang['not_set']."</i>)" ?></small> |
|
284 | 284 | </td> |
285 | 285 | </tr> |
286 | 286 | <tr> |
287 | 287 | <td valign="top">{{ ManagerTheme::getLexicon('resource_description') }}:</td> |
288 | - <td><?= $content['description'] != '' ? entities($content['description'], $modx->getConfig('modx_charset')) : "(<i>" . $_lang['not_set'] . "</i>)" ?></td> |
|
288 | + <td><?= $content['description'] != '' ? entities($content['description'], $modx->getConfig('modx_charset')) : "(<i>".$_lang['not_set']."</i>)" ?></td> |
|
289 | 289 | </tr> |
290 | 290 | <tr> |
291 | 291 | <td valign="top">{{ ManagerTheme::getLexicon('resource_summary') }}:</td> |
292 | - <td><?= $content['introtext'] != '' ? entities($content['introtext'], $modx->getConfig('modx_charset')) : "(<i>" . $_lang['not_set'] . "</i>)" ?></td> |
|
292 | + <td><?= $content['introtext'] != '' ? entities($content['introtext'], $modx->getConfig('modx_charset')) : "(<i>".$_lang['not_set']."</i>)" ?></td> |
|
293 | 293 | </tr> |
294 | 294 | <tr> |
295 | 295 | <td valign="top">{{ ManagerTheme::getLexicon('type') }}:</td> |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | </tr> |
298 | 298 | <tr> |
299 | 299 | <td valign="top">{{ ManagerTheme::getLexicon('resource_alias') }}:</td> |
300 | - <td><?= $content['alias'] != '' ? entities($content['alias'], $modx->getConfig('modx_charset')) : "(<i>" . $_lang['not_set'] . "</i>)" ?></td> |
|
300 | + <td><?= $content['alias'] != '' ? entities($content['alias'], $modx->getConfig('modx_charset')) : "(<i>".$_lang['not_set']."</i>)" ?></td> |
|
301 | 301 | </tr> |
302 | 302 | <tr> |
303 | 303 | <td colspan="2"> </td> |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | <td><?= $modx->toDateFormat($content['createdon'] + $server_offset_time) ?> (<b><?= entities($createdbyname, $modx->getConfig('modx_charset')) ?></b>) |
311 | 311 | </td> |
312 | 312 | </tr> |
313 | - <?php if($editedbyname != '') { ?> |
|
313 | + <?php if ($editedbyname != '') { ?> |
|
314 | 314 | <tr> |
315 | 315 | <td>{{ ManagerTheme::getLexicon('page_data_edited') }}:</td> |
316 | 316 | <td><?= $modx->toDateFormat($content['editedon'] + $server_offset_time) ?> (<b><?= entities($editedbyname, $modx->getConfig('modx_charset')) ?></b>) |
@@ -325,15 +325,15 @@ discard block |
||
325 | 325 | </tr> |
326 | 326 | <tr> |
327 | 327 | <td>{{ ManagerTheme::getLexicon('page_data_status') }}:</td> |
328 | - <td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publisheddoc">' . $_lang['page_data_published'] . '</span>' ?></td> |
|
328 | + <td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">'.$_lang['page_data_unpublished'].'</span>' : '<span class="publisheddoc">'.$_lang['page_data_published'].'</span>' ?></td> |
|
329 | 329 | </tr> |
330 | 330 | <tr> |
331 | 331 | <td>{{ ManagerTheme::getLexicon('page_data_publishdate') }}:</td> |
332 | - <td><?= $content['pub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['pub_date']) ?></td> |
|
332 | + <td><?= $content['pub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['pub_date']) ?></td> |
|
333 | 333 | </tr> |
334 | 334 | <tr> |
335 | 335 | <td>{{ ManagerTheme::getLexicon('page_data_unpublishdate') }}:</td> |
336 | - <td><?= $content['unpub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td> |
|
336 | + <td><?= $content['unpub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td> |
|
337 | 337 | </tr> |
338 | 338 | <tr> |
339 | 339 | <td>{{ ManagerTheme::getLexicon('page_data_cacheable') }}:</td> |
@@ -353,11 +353,11 @@ discard block |
||
353 | 353 | </tr> |
354 | 354 | <tr> |
355 | 355 | <td>{{ ManagerTheme::getLexicon('page_data_web_access') }}:</td> |
356 | - <td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td> |
|
356 | + <td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td> |
|
357 | 357 | </tr> |
358 | 358 | <tr> |
359 | 359 | <td>{{ ManagerTheme::getLexicon('page_data_mgr_access') }}:</td> |
360 | - <td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td> |
|
360 | + <td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td> |
|
361 | 361 | </tr> |
362 | 362 | <tr> |
363 | 363 | <td colspan="2"> </td> |
@@ -387,13 +387,13 @@ discard block |
||
387 | 387 | <script type="text/javascript">docSettings.addTabPage(document.getElementById("tabChildren"));</script> |
388 | 388 | <div class="container container-body"> |
389 | 389 | <div class="form-group clearfix"> |
390 | - <?php if($numRecords > 0) : ?> |
|
390 | + <?php if ($numRecords > 0) : ?> |
|
391 | 391 | <div class="float-xs-left"> |
392 | - <span class="publishedDoc"><?= $numRecords . ' ' . $_lang['resources_in_container'] ?> (<strong><?= entities($content['pagetitle'], $modx->getConfig('modx_charset')) ?></strong>)</span> |
|
392 | + <span class="publishedDoc"><?= $numRecords.' '.$_lang['resources_in_container'] ?> (<strong><?= entities($content['pagetitle'], $modx->getConfig('modx_charset')) ?></strong>)</span> |
|
393 | 393 | </div> |
394 | 394 | <?php endif; ?> |
395 | 395 | <div class="float-xs-right"> |
396 | - <?= $filter_sort . ' ' . $filter_dir ?> |
|
396 | + <?= $filter_sort.' '.$filter_dir ?> |
|
397 | 397 | </div> |
398 | 398 | |
399 | 399 | </div> |
@@ -410,16 +410,16 @@ discard block |
||
410 | 410 | <script type="text/javascript">docSettings.addTabPage(document.getElementById("tabSource"));</script> |
411 | 411 | <?php |
412 | 412 | $buffer = ""; |
413 | - $filename = MODX_BASE_PATH . "assets/cache/docid_" . $id . ".pageCache.php"; |
|
413 | + $filename = MODX_BASE_PATH."assets/cache/docid_".$id.".pageCache.php"; |
|
414 | 414 | $handle = @fopen($filename, "r"); |
415 | - if(!$handle) { |
|
416 | - $buffer = '<div class="container container-body">' . $_lang['page_data_notcached'] . '</div>'; |
|
415 | + if (!$handle) { |
|
416 | + $buffer = '<div class="container container-body">'.$_lang['page_data_notcached'].'</div>'; |
|
417 | 417 | } else { |
418 | - while(!feof($handle)) { |
|
418 | + while (!feof($handle)) { |
|
419 | 419 | $buffer .= fgets($handle, 4096); |
420 | 420 | } |
421 | 421 | fclose($handle); |
422 | - $buffer = '<div class="navbar navbar-editor">' . $_lang['page_data_cached'] . '</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">' . $modx->getPhpCompat()->htmlspecialchars($buffer) . "</textarea></div>\n"; |
|
422 | + $buffer = '<div class="navbar navbar-editor">'.$_lang['page_data_cached'].'</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">'.$modx->getPhpCompat()->htmlspecialchars($buffer)."</textarea></div>\n"; |
|
423 | 423 | } |
424 | 424 | echo $buffer; |
425 | 425 | ?> |