@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | class DATEPICKER { |
4 | - function __construct() { |
|
5 | - } |
|
4 | + function __construct() { |
|
5 | + } |
|
6 | 6 | |
7 | - function getDP() { |
|
8 | - global $modx, $_lang; |
|
7 | + function getDP() { |
|
8 | + global $modx, $_lang; |
|
9 | 9 | |
10 | - $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
|
11 | - return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
12 | - } |
|
10 | + $tpl = file_get_contents(dirname(__FILE__) . '/datepicker.tpl'); |
|
11 | + return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
12 | + } |
|
13 | 13 | } |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /** This file is part of KCFinder project |
4 | - * |
|
5 | - * @desc Uploader 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 Uploader 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 uploader { |
16 | 16 | |
@@ -18,92 +18,92 @@ discard block |
||
18 | 18 | const VERSION = "2.54"; |
19 | 19 | |
20 | 20 | /** Config session-overrided settings |
21 | - * @var array */ |
|
21 | + * @var array */ |
|
22 | 22 | protected $config = array(); |
23 | 23 | |
24 | 24 | /** Default image driver |
25 | - * @var string */ |
|
25 | + * @var string */ |
|
26 | 26 | protected $imageDriver = "gd"; |
27 | 27 | |
28 | 28 | /** Opener applocation properties |
29 | - * $opener['name'] Got from $_GET['opener']; |
|
30 | - * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) |
|
31 | - * $opener['TinyMCE'] Boolean |
|
32 | - * @var array */ |
|
29 | + * $opener['name'] Got from $_GET['opener']; |
|
30 | + * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) |
|
31 | + * $opener['TinyMCE'] Boolean |
|
32 | + * @var array */ |
|
33 | 33 | protected $opener = array(); |
34 | 34 | |
35 | 35 | /** Got from $_GET['type'] or first one $config['types'] array key, if inexistant |
36 | - * @var string */ |
|
36 | + * @var string */ |
|
37 | 37 | protected $type; |
38 | 38 | |
39 | 39 | /** Helper property. Local filesystem path to the Type Directory |
40 | - * Equivalent: $config['uploadDir'] . "/" . $type |
|
41 | - * @var string */ |
|
40 | + * Equivalent: $config['uploadDir'] . "/" . $type |
|
41 | + * @var string */ |
|
42 | 42 | protected $typeDir; |
43 | 43 | |
44 | 44 | /** Helper property. Web URL to the Type Directory |
45 | - * Equivalent: $config['uploadURL'] . "/" . $type |
|
46 | - * @var string */ |
|
45 | + * Equivalent: $config['uploadURL'] . "/" . $type |
|
46 | + * @var string */ |
|
47 | 47 | protected $typeURL; |
48 | 48 | |
49 | 49 | /** Linked to $config['types'] |
50 | - * @var array */ |
|
50 | + * @var array */ |
|
51 | 51 | protected $types = array(); |
52 | 52 | |
53 | 53 | /** Settings which can override default settings if exists as keys in $config['types'][$type] array |
54 | - * @var array */ |
|
54 | + * @var array */ |
|
55 | 55 | protected $typeSettings = array('disabled', 'theme', 'dirPerms', 'filePerms', 'denyZipDownload', 'maxImageWidth', 'maxImageHeight', 'thumbWidth', 'thumbHeight', 'jpegQuality', 'access', 'filenameChangeChars', 'dirnameChangeChars', 'denyExtensionRename', 'deniedExts', 'watermark'); |
56 | 56 | |
57 | 57 | /** Got from language file |
58 | - * @var string */ |
|
58 | + * @var string */ |
|
59 | 59 | protected $charset; |
60 | 60 | |
61 | 61 | /** The language got from $_GET['lng'] or $_GET['lang'] or... Please see next property |
62 | - * @var string */ |
|
62 | + * @var string */ |
|
63 | 63 | protected $lang = 'en'; |
64 | 64 | |
65 | 65 | /** Possible language $_GET keys |
66 | - * @var array */ |
|
66 | + * @var array */ |
|
67 | 67 | protected $langInputNames = array('lang', 'langCode', 'lng', 'language', 'lang_code'); |
68 | 68 | |
69 | 69 | /** Uploaded file(s) info. Linked to first $_FILES element |
70 | - * @var array */ |
|
70 | + * @var array */ |
|
71 | 71 | protected $file; |
72 | 72 | |
73 | 73 | /** Next three properties are got from the current language file |
74 | - * @var string */ |
|
74 | + * @var string */ |
|
75 | 75 | protected $dateTimeFull; // Currently not used |
76 | 76 | protected $dateTimeMid; // Currently not used |
77 | 77 | protected $dateTimeSmall; |
78 | 78 | |
79 | 79 | /** Contain Specified language labels |
80 | - * @var array */ |
|
80 | + * @var array */ |
|
81 | 81 | protected $labels = array(); |
82 | 82 | |
83 | 83 | /** Contain unprocessed $_GET array. Please use this instead of $_GET |
84 | - * @var array */ |
|
84 | + * @var array */ |
|
85 | 85 | protected $get; |
86 | 86 | |
87 | 87 | /** Contain unprocessed $_POST array. Please use this instead of $_POST |
88 | - * @var array */ |
|
88 | + * @var array */ |
|
89 | 89 | protected $post; |
90 | 90 | |
91 | 91 | /** Contain unprocessed $_COOKIE array. Please use this instead of $_COOKIE |
92 | - * @var array */ |
|
92 | + * @var array */ |
|
93 | 93 | protected $cookie; |
94 | 94 | |
95 | 95 | /** Session array. Please use this property instead of $_SESSION |
96 | - * @var array */ |
|
96 | + * @var array */ |
|
97 | 97 | protected $session; |
98 | 98 | |
99 | 99 | /** CMS integration attribute (got from $_GET['cms']) |
100 | - * @var string */ |
|
100 | + * @var string */ |
|
101 | 101 | protected $cms = ""; |
102 | 102 | |
103 | 103 | protected $modx = null; |
104 | 104 | /** Magic method which allows read-only access to protected or private class properties |
105 | - * @param string $property |
|
106 | - * @return mixed */ |
|
105 | + * @param string $property |
|
106 | + * @return mixed */ |
|
107 | 107 | public function __get($property) { |
108 | 108 | return property_exists($this, $property) ? $this->$property : null; |
109 | 109 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | ) |
133 | 133 | $this->cms = $this->get['cms']; |
134 | 134 | |
135 | - // LINKING UPLOADED FILE |
|
135 | + // LINKING UPLOADED FILE |
|
136 | 136 | if (count($_FILES)) |
137 | 137 | $this->file = &$_FILES[key($_FILES)]; |
138 | 138 | |
@@ -228,8 +228,8 @@ discard block |
||
228 | 228 | $this->config['uploadDir'] = strlen($this->config['uploadDir']) |
229 | 229 | ? path::normalize($this->config['uploadDir']) |
230 | 230 | : path::url2fullPath("/$path"); |
231 | - $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; |
|
232 | - $this->typeURL = "{$this->config['siteURL']}/{$this->config['uploadURL']}/{$this->type}"; |
|
231 | + $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; |
|
232 | + $this->typeURL = "{$this->config['siteURL']}/{$this->config['uploadURL']}/{$this->type}"; |
|
233 | 233 | |
234 | 234 | // SITE ROOT |
235 | 235 | } elseif ($this->config['uploadURL'] == "/") { |
@@ -365,36 +365,36 @@ discard block |
||
365 | 365 | } |
366 | 366 | |
367 | 367 | |
368 | - protected function getTransaliasSettings() { |
|
369 | - global $modx; |
|
370 | - |
|
371 | - // Cleaning uploaded filename? |
|
372 | - $setting = $modx->db->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); |
|
373 | - if ($modx->db->getValue($setting)>0) { |
|
374 | - // Transalias plugin active? |
|
375 | - $res = $modx->db->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); |
|
376 | - if ($properties = $modx->db->getValue($res)) { |
|
377 | - $properties = $modx->parseProperties($properties, 'TransAlias', 'plugin'); |
|
378 | - } else { |
|
379 | - $properties = NULL; |
|
380 | - } |
|
381 | - } else { |
|
382 | - $properties = NULL; |
|
383 | - } |
|
384 | - return $properties; |
|
385 | - } |
|
386 | - |
|
387 | - |
|
388 | - protected function normalizeFilename($filename) { |
|
389 | - if ($this->getTransaliasSettings()) { |
|
390 | - $format = strrchr($filename, "."); |
|
391 | - $filename = str_replace($format, "", $filename); |
|
392 | - $filename = $this->modx->stripAlias($filename).$format; |
|
393 | - } |
|
394 | - return $filename; |
|
395 | - } |
|
396 | - |
|
397 | - protected function normalizeDirname($dirname) { |
|
368 | + protected function getTransaliasSettings() { |
|
369 | + global $modx; |
|
370 | + |
|
371 | + // Cleaning uploaded filename? |
|
372 | + $setting = $modx->db->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); |
|
373 | + if ($modx->db->getValue($setting)>0) { |
|
374 | + // Transalias plugin active? |
|
375 | + $res = $modx->db->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); |
|
376 | + if ($properties = $modx->db->getValue($res)) { |
|
377 | + $properties = $modx->parseProperties($properties, 'TransAlias', 'plugin'); |
|
378 | + } else { |
|
379 | + $properties = NULL; |
|
380 | + } |
|
381 | + } else { |
|
382 | + $properties = NULL; |
|
383 | + } |
|
384 | + return $properties; |
|
385 | + } |
|
386 | + |
|
387 | + |
|
388 | + protected function normalizeFilename($filename) { |
|
389 | + if ($this->getTransaliasSettings()) { |
|
390 | + $format = strrchr($filename, "."); |
|
391 | + $filename = str_replace($format, "", $filename); |
|
392 | + $filename = $this->modx->stripAlias($filename).$format; |
|
393 | + } |
|
394 | + return $filename; |
|
395 | + } |
|
396 | + |
|
397 | + protected function normalizeDirname($dirname) { |
|
398 | 398 | return $this->modx->stripAlias($dirname); |
399 | 399 | } |
400 | 400 | |
@@ -472,10 +472,10 @@ discard block |
||
472 | 472 | return $this->label("The image is too big and/or cannot be resized."); |
473 | 473 | |
474 | 474 | |
475 | - // CHECK FOR MODX MAX FILE SIZE |
|
476 | - $actualfilesize=filesize($file['tmp_name']); |
|
477 | - if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) |
|
478 | - return $this->label("File is too big: ".$actualfilesize." Bytes. (max ".$this->config['maxfilesize']." Bytes)"); |
|
475 | + // CHECK FOR MODX MAX FILE SIZE |
|
476 | + $actualfilesize=filesize($file['tmp_name']); |
|
477 | + if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) |
|
478 | + return $this->label("File is too big: ".$actualfilesize." Bytes. (max ".$this->config['maxfilesize']." Bytes)"); |
|
479 | 479 | |
480 | 480 | return true; |
481 | 481 | } |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | $top = isset($this->config['watermark']['top']) |
628 | 628 | ? $this->config['watermark']['top'] : false; |
629 | 629 | $img->watermark($this->config['watermark']['file'], $left, $top); |
630 | - } |
|
630 | + } |
|
631 | 631 | |
632 | 632 | $options = array( 'file' => $file ); |
633 | 633 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | |
48 | 48 | $autoloader = __DIR__.'/vendor/autoload.php'; |
49 | 49 | if (file_exists($autoloader) && is_readable($autoloader)) { |
50 | - include_once($autoloader); |
|
50 | + include_once($autoloader); |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if(!isset($_SERVER['REQUEST_TIME_FLOAT'])) $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
@@ -56,11 +56,11 @@ discard block |
||
56 | 56 | if(is_file($base_path . 'assets/cache/siteManager.php')) |
57 | 57 | include_once($base_path . 'assets/cache/siteManager.php'); |
58 | 58 | if(!defined('MGR_DIR') && is_dir("{$base_path}manager")) |
59 | - define('MGR_DIR', 'manager'); |
|
59 | + define('MGR_DIR', 'manager'); |
|
60 | 60 | if(is_file($base_path . 'assets/cache/siteHostnames.php')) |
61 | 61 | include_once($base_path . 'assets/cache/siteHostnames.php'); |
62 | 62 | if(!defined('MODX_SITE_HOSTNAMES')) |
63 | - define('MODX_SITE_HOSTNAMES', ''); |
|
63 | + define('MODX_SITE_HOSTNAMES', ''); |
|
64 | 64 | |
65 | 65 | // get start time |
66 | 66 | $mstart = memory_get_usage(); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | |
85 | 85 | define('IN_PARSER_MODE', true); |
86 | 86 | if ( ! defined('IN_MANAGER_MODE')) { |
87 | - define('IN_MANAGER_MODE', false); |
|
87 | + define('IN_MANAGER_MODE', false); |
|
88 | 88 | } |
89 | 89 | if (!defined('MODX_API_MODE')) { |
90 | 90 | define('MODX_API_MODE', false); |
@@ -92,12 +92,12 @@ discard block |
||
92 | 92 | |
93 | 93 | // get the required includes |
94 | 94 | if(!isset($database_user) || $database_user=="") { |
95 | - $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php'); |
|
96 | - // Be sure config.inc.php is there and that it contains some important values |
|
97 | - if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) { |
|
98 | - readfile('install/not_installed.tpl'); |
|
99 | - exit; |
|
100 | - } |
|
95 | + $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php'); |
|
96 | + // Be sure config.inc.php is there and that it contains some important values |
|
97 | + if(!$rt || !$database_type || !$database_server || !$database_user || !$dbase) { |
|
98 | + readfile('install/not_installed.tpl'); |
|
99 | + exit; |
|
100 | + } |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | // start session |
@@ -105,11 +105,11 @@ discard block |
||
105 | 105 | |
106 | 106 | // initiate a new document parser |
107 | 107 | if (isset($coreClass) && class_exists($coreClass)) { |
108 | - $modx = new $coreClass; |
|
108 | + $modx = new $coreClass; |
|
109 | 109 | } |
110 | 110 | if (!isset($modx) || !($modx instanceof \DocumentParser)) { |
111 | - include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
112 | - $modx = new \DocumentParser; |
|
111 | + include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
112 | + $modx = new \DocumentParser; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | // set some parser options |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | |
13 | 13 | class DataGrid { |
14 | 14 | |
15 | - public $ds; // datasource |
|
15 | + public $ds; // datasource |
|
16 | 16 | public $id; |
17 | 17 | public $pageSize; // pager settings |
18 | 18 | public $pageNumber; |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | public $colWraps; |
37 | 37 | public $colColors; |
38 | 38 | public $colTypes; // coltype1, coltype2, etc or coltype1:format1, e.g. date:%Y %m |
39 | - // data type: integer,float,currency,date |
|
39 | + // data type: integer,float,currency,date |
|
40 | 40 | |
41 | 41 | public $header; |
42 | 42 | public $footer; |
@@ -73,239 +73,239 @@ discard block |
||
73 | 73 | public $cdelim; |
74 | 74 | |
75 | 75 | public function __construct($id, $ds, $pageSize = 20, $pageNumber = -1) { |
76 | - global $__DataGridCnt; |
|
76 | + global $__DataGridCnt; |
|
77 | 77 | |
78 | - // set id |
|
79 | - $__DataGridCnt++; |
|
80 | - $this->id = $this->id ? empty($id) : "dg" . $__DataGridCnt; |
|
78 | + // set id |
|
79 | + $__DataGridCnt++; |
|
80 | + $this->id = $this->id ? empty($id) : "dg" . $__DataGridCnt; |
|
81 | 81 | |
82 | - // set datasource |
|
83 | - $this->ds = $ds; |
|
82 | + // set datasource |
|
83 | + $this->ds = $ds; |
|
84 | 84 | |
85 | - // set pager |
|
86 | - $this->pageSize = $pageSize; |
|
87 | - $this->pageNumber = $pageNumber; // by setting pager to -1 will cause pager to load it's last page number |
|
88 | - $this->pagerLocation = 'top-right'; |
|
89 | - } |
|
85 | + // set pager |
|
86 | + $this->pageSize = $pageSize; |
|
87 | + $this->pageNumber = $pageNumber; // by setting pager to -1 will cause pager to load it's last page number |
|
88 | + $this->pagerLocation = 'top-right'; |
|
89 | + } |
|
90 | 90 | |
91 | 91 | public function setDataSource($ds) { |
92 | - $this->ds = $ds; |
|
93 | - } |
|
92 | + $this->ds = $ds; |
|
93 | + } |
|
94 | 94 | |
95 | 95 | public function render() { |
96 | - global $modx; |
|
97 | - $columnHeaderStyle = ($this->columnHeaderStyle) ? "style='" . $this->columnHeaderStyle . "'" : ''; |
|
98 | - $columnHeaderClass = ($this->columnHeaderClass) ? "class='" . $this->columnHeaderClass . "'" : ""; |
|
99 | - $cssStyle = ($this->cssStyle) ? "style='" . $this->cssStyle . "'" : ''; |
|
100 | - $cssClass = ($this->cssClass) ? "class='" . $this->cssClass . "'" : ''; |
|
101 | - |
|
102 | - $pagerClass = ($this->pagerClass) ? "class='" . $this->pagerClass . "'" : ''; |
|
103 | - $pagerStyle = ($this->pagerStyle) ? "style='" . $this->pagerStyle . "'" : "style='background-color:#ffffff;'"; |
|
104 | - |
|
105 | - $this->_itemStyle = ($this->itemStyle) ? "style='" . $this->itemStyle . "'" : ''; |
|
106 | - $this->_itemClass = ($this->itemClass) ? "class='" . $this->itemClass . "'" : ''; |
|
107 | - $this->_altItemStyle = ($this->altItemStyle) ? "style='" . $this->altItemStyle . "'" : ''; |
|
108 | - $this->_altItemClass = ($this->altItemClass) ? "class='" . $this->altItemClass . "'" : ''; |
|
109 | - |
|
110 | - $this->_alt = 0; |
|
111 | - $this->_total = 0; |
|
112 | - |
|
113 | - $this->_isDataset = $modx->db->isResult($this->ds); // if not dataset then treat as array |
|
114 | - |
|
115 | - if(!$cssStyle && !$cssClass) { |
|
116 | - $cssStyle = "style='width:100%;border:1px solid silver;font-family:verdana,arial; font-size:11px;'"; |
|
117 | - } |
|
118 | - if(!$columnHeaderStyle && !$columnHeaderClass) { |
|
119 | - $columnHeaderStyle = "style='color:black;background-color:silver'"; |
|
120 | - } |
|
121 | - if(!$this->_itemStyle && !$this->_itemClass) { |
|
122 | - $this->_itemStyle = "style='color:black;'"; |
|
123 | - } |
|
124 | - if(!$this->_altItemStyle && !$this->_altItemClass) { |
|
125 | - $this->_altItemStyle = "style='color:black;background-color:#eeeeee'"; |
|
126 | - } |
|
127 | - |
|
128 | - if($this->_isDataset && !$this->columns) { |
|
129 | - $cols = $modx->db->numFields($this->ds); |
|
130 | - for($i = 0; $i < $cols; $i++) $this->columns .= ($i ? "," : "") . $modx->db->fieldName($this->ds, $i); |
|
131 | - } |
|
132 | - |
|
133 | - // start grid |
|
134 | - $tblStart = "<table $cssClass $cssStyle cellpadding='" . (isset($this->cellPadding) ? (int) $this->cellPadding : 1) . "' cellspacing='" . (isset($this->cellSpacing) ? (int) $this->cellSpacing : 1) . "'>"; |
|
135 | - $tblEnd = "</table>"; |
|
136 | - |
|
137 | - // build column header |
|
138 | - $this->_colnames = explode((strstr($this->columns, "||") !== false ? "||" : ","), $this->columns); |
|
139 | - $this->_colwidths = explode((strstr($this->colWidths, "||") !== false ? "||" : ","), $this->colWidths); |
|
140 | - $this->_colaligns = explode((strstr($this->colAligns, "||") !== false ? "||" : ","), $this->colAligns); |
|
141 | - $this->_colwraps = explode((strstr($this->colWraps, "||") !== false ? "||" : ","), $this->colWraps); |
|
142 | - $this->_colcolors = explode((strstr($this->colColors, "||") !== false ? "||" : ","), $this->colColors); |
|
143 | - $this->_coltypes = explode((strstr($this->colTypes, "||") !== false ? "||" : ","), $this->colTypes); |
|
144 | - $this->_colcount = count($this->_colnames); |
|
145 | - if(!$this->_isDataset) { |
|
146 | - $this->ds = explode((strstr($this->ds, "||") !== false ? "||" : ","), $this->ds); |
|
147 | - $this->ds = array_chunk($this->ds, $this->_colcount); |
|
148 | - } |
|
149 | - $tblColHdr = "<thead><tr>"; |
|
150 | - for($c = 0; $c < $this->_colcount; $c++) { |
|
151 | - $name = $this->_colnames[$c]; |
|
152 | - $width = $this->_colwidths[$c]; |
|
153 | - $tblColHdr .= "<td $columnHeaderStyle $columnHeaderClass" . ($width ? " width='$width'" : "") . ">$name</td>"; |
|
154 | - } |
|
155 | - $tblColHdr .= "</tr></thead>\n"; |
|
156 | - |
|
157 | - // build rows |
|
158 | - $rowcount = $this->_isDataset ? $modx->db->getRecordCount($this->ds) : count($this->ds); |
|
159 | - $this->_fieldnames = explode(",", $this->fields); |
|
160 | - if($rowcount == 0) { |
|
161 | - $tblRows .= "<tr><td " . $this->_itemStyle . " " . $this->_itemClass . " colspan='" . $this->_colcount . "'>" . $this->noRecordMsg . "</td></tr>\n"; |
|
162 | - } else { |
|
163 | - // render grid items |
|
164 | - if($this->pageSize <= 0) { |
|
165 | - for($r = 0; $r < $rowcount; $r++) { |
|
166 | - $row = $this->_isDataset ? $modx->db->getRow($this->ds) : $this->ds[$r]; |
|
167 | - $tblRows .= $this->RenderRowFnc($r + 1, $row); |
|
168 | - } |
|
169 | - } else { |
|
170 | - if(!$this->pager) { |
|
171 | - include_once dirname(__FILE__) . "/datasetpager.class.php"; |
|
172 | - $this->pager = new DataSetPager($this->id, $this->ds, $this->pageSize, $this->pageNumber); |
|
173 | - $this->pager->setRenderRowFnc($this); // pass this object |
|
174 | - $this->pager->cssStyle = $pagerStyle; |
|
175 | - $this->pager->cssClass = $pagerClass; |
|
176 | - } else { |
|
177 | - $this->pager->pageSize = $this->pageSize; |
|
178 | - $this->pager->pageNumber = $this->pageNumber; |
|
179 | - } |
|
180 | - |
|
181 | - $this->pager->render(); |
|
182 | - $tblRows = $this->pager->getRenderedRows(); |
|
183 | - $tblPager = $this->pager->getRenderedPager(); |
|
184 | - } |
|
185 | - } |
|
186 | - |
|
187 | - // setup header,pager and footer |
|
188 | - $o = $tblStart; |
|
189 | - $ptop = (substr($this->pagerLocation, 0, 3) == "top") || (substr($this->pagerLocation, 0, 4) == "both"); |
|
190 | - $pbot = (substr($this->pagerLocation, 0, 3) == "bot") || (substr($this->pagerLocation, 0, 4) == "both"); |
|
191 | - if($this->header) { |
|
192 | - $o .= "<tr><td bgcolor='#ffffff' colspan='" . $this->_colcount . "'>" . $this->header . "</td></tr>"; |
|
193 | - } |
|
194 | - if($tblPager && $ptop) { |
|
195 | - $o .= "<tr><td align='" . (substr($this->pagerLocation, -4) == "left" ? "left" : "right") . "' $pagerClass $pagerStyle colspan='" . $this->_colcount . "'>" . $tblPager . " </td></tr>"; |
|
196 | - } |
|
197 | - $o .= $tblColHdr . $tblRows; |
|
198 | - if($tblPager && $pbot) { |
|
199 | - $o .= "<tr><td align='" . (substr($this->pagerLocation, -4) == "left" ? "left" : "right") . "' $pagerClass $pagerStyle colspan='" . $this->_colcount . "'>" . $tblPager . " </td></tr>"; |
|
200 | - } |
|
201 | - if($this->footer) { |
|
202 | - $o .= "<tr><td bgcolor='#ffffff' colspan='" . $this->_colcount . "'>" . $this->footer . "</td></tr>"; |
|
203 | - } |
|
204 | - $o .= $tblEnd; |
|
205 | - return $o; |
|
206 | - } |
|
207 | - |
|
208 | - // format column values |
|
96 | + global $modx; |
|
97 | + $columnHeaderStyle = ($this->columnHeaderStyle) ? "style='" . $this->columnHeaderStyle . "'" : ''; |
|
98 | + $columnHeaderClass = ($this->columnHeaderClass) ? "class='" . $this->columnHeaderClass . "'" : ""; |
|
99 | + $cssStyle = ($this->cssStyle) ? "style='" . $this->cssStyle . "'" : ''; |
|
100 | + $cssClass = ($this->cssClass) ? "class='" . $this->cssClass . "'" : ''; |
|
101 | + |
|
102 | + $pagerClass = ($this->pagerClass) ? "class='" . $this->pagerClass . "'" : ''; |
|
103 | + $pagerStyle = ($this->pagerStyle) ? "style='" . $this->pagerStyle . "'" : "style='background-color:#ffffff;'"; |
|
104 | + |
|
105 | + $this->_itemStyle = ($this->itemStyle) ? "style='" . $this->itemStyle . "'" : ''; |
|
106 | + $this->_itemClass = ($this->itemClass) ? "class='" . $this->itemClass . "'" : ''; |
|
107 | + $this->_altItemStyle = ($this->altItemStyle) ? "style='" . $this->altItemStyle . "'" : ''; |
|
108 | + $this->_altItemClass = ($this->altItemClass) ? "class='" . $this->altItemClass . "'" : ''; |
|
109 | + |
|
110 | + $this->_alt = 0; |
|
111 | + $this->_total = 0; |
|
112 | + |
|
113 | + $this->_isDataset = $modx->db->isResult($this->ds); // if not dataset then treat as array |
|
114 | + |
|
115 | + if(!$cssStyle && !$cssClass) { |
|
116 | + $cssStyle = "style='width:100%;border:1px solid silver;font-family:verdana,arial; font-size:11px;'"; |
|
117 | + } |
|
118 | + if(!$columnHeaderStyle && !$columnHeaderClass) { |
|
119 | + $columnHeaderStyle = "style='color:black;background-color:silver'"; |
|
120 | + } |
|
121 | + if(!$this->_itemStyle && !$this->_itemClass) { |
|
122 | + $this->_itemStyle = "style='color:black;'"; |
|
123 | + } |
|
124 | + if(!$this->_altItemStyle && !$this->_altItemClass) { |
|
125 | + $this->_altItemStyle = "style='color:black;background-color:#eeeeee'"; |
|
126 | + } |
|
127 | + |
|
128 | + if($this->_isDataset && !$this->columns) { |
|
129 | + $cols = $modx->db->numFields($this->ds); |
|
130 | + for($i = 0; $i < $cols; $i++) $this->columns .= ($i ? "," : "") . $modx->db->fieldName($this->ds, $i); |
|
131 | + } |
|
132 | + |
|
133 | + // start grid |
|
134 | + $tblStart = "<table $cssClass $cssStyle cellpadding='" . (isset($this->cellPadding) ? (int) $this->cellPadding : 1) . "' cellspacing='" . (isset($this->cellSpacing) ? (int) $this->cellSpacing : 1) . "'>"; |
|
135 | + $tblEnd = "</table>"; |
|
136 | + |
|
137 | + // build column header |
|
138 | + $this->_colnames = explode((strstr($this->columns, "||") !== false ? "||" : ","), $this->columns); |
|
139 | + $this->_colwidths = explode((strstr($this->colWidths, "||") !== false ? "||" : ","), $this->colWidths); |
|
140 | + $this->_colaligns = explode((strstr($this->colAligns, "||") !== false ? "||" : ","), $this->colAligns); |
|
141 | + $this->_colwraps = explode((strstr($this->colWraps, "||") !== false ? "||" : ","), $this->colWraps); |
|
142 | + $this->_colcolors = explode((strstr($this->colColors, "||") !== false ? "||" : ","), $this->colColors); |
|
143 | + $this->_coltypes = explode((strstr($this->colTypes, "||") !== false ? "||" : ","), $this->colTypes); |
|
144 | + $this->_colcount = count($this->_colnames); |
|
145 | + if(!$this->_isDataset) { |
|
146 | + $this->ds = explode((strstr($this->ds, "||") !== false ? "||" : ","), $this->ds); |
|
147 | + $this->ds = array_chunk($this->ds, $this->_colcount); |
|
148 | + } |
|
149 | + $tblColHdr = "<thead><tr>"; |
|
150 | + for($c = 0; $c < $this->_colcount; $c++) { |
|
151 | + $name = $this->_colnames[$c]; |
|
152 | + $width = $this->_colwidths[$c]; |
|
153 | + $tblColHdr .= "<td $columnHeaderStyle $columnHeaderClass" . ($width ? " width='$width'" : "") . ">$name</td>"; |
|
154 | + } |
|
155 | + $tblColHdr .= "</tr></thead>\n"; |
|
156 | + |
|
157 | + // build rows |
|
158 | + $rowcount = $this->_isDataset ? $modx->db->getRecordCount($this->ds) : count($this->ds); |
|
159 | + $this->_fieldnames = explode(",", $this->fields); |
|
160 | + if($rowcount == 0) { |
|
161 | + $tblRows .= "<tr><td " . $this->_itemStyle . " " . $this->_itemClass . " colspan='" . $this->_colcount . "'>" . $this->noRecordMsg . "</td></tr>\n"; |
|
162 | + } else { |
|
163 | + // render grid items |
|
164 | + if($this->pageSize <= 0) { |
|
165 | + for($r = 0; $r < $rowcount; $r++) { |
|
166 | + $row = $this->_isDataset ? $modx->db->getRow($this->ds) : $this->ds[$r]; |
|
167 | + $tblRows .= $this->RenderRowFnc($r + 1, $row); |
|
168 | + } |
|
169 | + } else { |
|
170 | + if(!$this->pager) { |
|
171 | + include_once dirname(__FILE__) . "/datasetpager.class.php"; |
|
172 | + $this->pager = new DataSetPager($this->id, $this->ds, $this->pageSize, $this->pageNumber); |
|
173 | + $this->pager->setRenderRowFnc($this); // pass this object |
|
174 | + $this->pager->cssStyle = $pagerStyle; |
|
175 | + $this->pager->cssClass = $pagerClass; |
|
176 | + } else { |
|
177 | + $this->pager->pageSize = $this->pageSize; |
|
178 | + $this->pager->pageNumber = $this->pageNumber; |
|
179 | + } |
|
180 | + |
|
181 | + $this->pager->render(); |
|
182 | + $tblRows = $this->pager->getRenderedRows(); |
|
183 | + $tblPager = $this->pager->getRenderedPager(); |
|
184 | + } |
|
185 | + } |
|
186 | + |
|
187 | + // setup header,pager and footer |
|
188 | + $o = $tblStart; |
|
189 | + $ptop = (substr($this->pagerLocation, 0, 3) == "top") || (substr($this->pagerLocation, 0, 4) == "both"); |
|
190 | + $pbot = (substr($this->pagerLocation, 0, 3) == "bot") || (substr($this->pagerLocation, 0, 4) == "both"); |
|
191 | + if($this->header) { |
|
192 | + $o .= "<tr><td bgcolor='#ffffff' colspan='" . $this->_colcount . "'>" . $this->header . "</td></tr>"; |
|
193 | + } |
|
194 | + if($tblPager && $ptop) { |
|
195 | + $o .= "<tr><td align='" . (substr($this->pagerLocation, -4) == "left" ? "left" : "right") . "' $pagerClass $pagerStyle colspan='" . $this->_colcount . "'>" . $tblPager . " </td></tr>"; |
|
196 | + } |
|
197 | + $o .= $tblColHdr . $tblRows; |
|
198 | + if($tblPager && $pbot) { |
|
199 | + $o .= "<tr><td align='" . (substr($this->pagerLocation, -4) == "left" ? "left" : "right") . "' $pagerClass $pagerStyle colspan='" . $this->_colcount . "'>" . $tblPager . " </td></tr>"; |
|
200 | + } |
|
201 | + if($this->footer) { |
|
202 | + $o .= "<tr><td bgcolor='#ffffff' colspan='" . $this->_colcount . "'>" . $this->footer . "</td></tr>"; |
|
203 | + } |
|
204 | + $o .= $tblEnd; |
|
205 | + return $o; |
|
206 | + } |
|
207 | + |
|
208 | + // format column values |
|
209 | 209 | |
210 | 210 | public function RenderRowFnc($n, $row) { |
211 | - if($this->_alt == 0) { |
|
212 | - $Style = $this->_itemStyle; |
|
213 | - $Class = $this->_itemClass; |
|
214 | - $this->_alt = 1; |
|
215 | - } else { |
|
216 | - $Style = $this->_altItemStyle; |
|
217 | - $Class = $this->_altItemClass; |
|
218 | - $this->_alt = 0; |
|
219 | - } |
|
220 | - $o = "<tr>"; |
|
221 | - for($c = 0; $c < $this->_colcount; $c++) { |
|
222 | - $colStyle = $Style; |
|
223 | - $fld = trim($this->_fieldnames[$c]); |
|
224 | - $width = isset($this->_colwidths[$c]) ? $this->_colwidths[$c] : null; |
|
225 | - $align = isset($this->_colaligns[$c]) ? $this->_colaligns[$c] : null; |
|
226 | - $color = isset($this->_colcolors[$c]) ? $this->_colcolors[$c] : null; |
|
227 | - $type = isset($this->_coltypes[$c]) ? $this->_coltypes[$c] : null; |
|
228 | - $nowrap = isset($this->_colwraps[$c]) ? $this->_colwraps[$c] : null; |
|
229 | - $value = $row[($this->_isDataset && $fld ? $fld : $c)]; |
|
230 | - if($color && $Style) { |
|
231 | - $colStyle = substr($colStyle, 0, -1) . ";background-color:$color;'"; |
|
232 | - } |
|
233 | - $value = $this->formatColumnValue($row, $value, $type, $align); |
|
234 | - $o .= "<td $colStyle $Class" . ($align ? " align='$align'" : "") . ($color ? " bgcolor='$color'" : "") . ($nowrap ? " nowrap='$nowrap'" : "") . ($width ? " width='$width'" : "") . ">$value</td>"; |
|
235 | - } |
|
236 | - $o .= "</tr>\n"; |
|
237 | - return $o; |
|
238 | - } |
|
211 | + if($this->_alt == 0) { |
|
212 | + $Style = $this->_itemStyle; |
|
213 | + $Class = $this->_itemClass; |
|
214 | + $this->_alt = 1; |
|
215 | + } else { |
|
216 | + $Style = $this->_altItemStyle; |
|
217 | + $Class = $this->_altItemClass; |
|
218 | + $this->_alt = 0; |
|
219 | + } |
|
220 | + $o = "<tr>"; |
|
221 | + for($c = 0; $c < $this->_colcount; $c++) { |
|
222 | + $colStyle = $Style; |
|
223 | + $fld = trim($this->_fieldnames[$c]); |
|
224 | + $width = isset($this->_colwidths[$c]) ? $this->_colwidths[$c] : null; |
|
225 | + $align = isset($this->_colaligns[$c]) ? $this->_colaligns[$c] : null; |
|
226 | + $color = isset($this->_colcolors[$c]) ? $this->_colcolors[$c] : null; |
|
227 | + $type = isset($this->_coltypes[$c]) ? $this->_coltypes[$c] : null; |
|
228 | + $nowrap = isset($this->_colwraps[$c]) ? $this->_colwraps[$c] : null; |
|
229 | + $value = $row[($this->_isDataset && $fld ? $fld : $c)]; |
|
230 | + if($color && $Style) { |
|
231 | + $colStyle = substr($colStyle, 0, -1) . ";background-color:$color;'"; |
|
232 | + } |
|
233 | + $value = $this->formatColumnValue($row, $value, $type, $align); |
|
234 | + $o .= "<td $colStyle $Class" . ($align ? " align='$align'" : "") . ($color ? " bgcolor='$color'" : "") . ($nowrap ? " nowrap='$nowrap'" : "") . ($width ? " width='$width'" : "") . ">$value</td>"; |
|
235 | + } |
|
236 | + $o .= "</tr>\n"; |
|
237 | + return $o; |
|
238 | + } |
|
239 | 239 | |
240 | 240 | public function formatColumnValue($row, $value, $type, &$align) { |
241 | - if(strpos($type, ":") !== false) { |
|
242 | - list($type, $type_format) = explode(":", $type, 2); |
|
243 | - } |
|
244 | - switch(strtolower($type)) { |
|
245 | - case "integer": |
|
246 | - if($align == "") { |
|
247 | - $align = "right"; |
|
248 | - } |
|
249 | - $value = number_format($value); |
|
250 | - break; |
|
251 | - |
|
252 | - case "float": |
|
253 | - if($align == "") { |
|
254 | - $align = "right"; |
|
255 | - } |
|
256 | - if(!$type_format) { |
|
257 | - $type_format = 2; |
|
258 | - } |
|
259 | - $value = number_format($value, $type_format); |
|
260 | - break; |
|
261 | - |
|
262 | - case "currency": |
|
263 | - if($align == "") { |
|
264 | - $align = "right"; |
|
265 | - } |
|
266 | - if(!$type_format) { |
|
267 | - $type_format = 2; |
|
268 | - } |
|
269 | - $value = "$" . number_format($value, $type_format); |
|
270 | - break; |
|
271 | - |
|
272 | - case "date": |
|
273 | - if($align == "") { |
|
274 | - $align = "right"; |
|
275 | - } |
|
276 | - if(!is_numeric($value)) { |
|
277 | - $value = strtotime($value); |
|
278 | - } |
|
279 | - if(!$type_format) { |
|
280 | - $type_format = "%A %d, %B %Y"; |
|
281 | - } |
|
282 | - $value = strftime($type_format, $value); |
|
283 | - break; |
|
284 | - |
|
285 | - case "boolean": |
|
286 | - if($align == '') { |
|
287 | - $align = "center"; |
|
288 | - } |
|
289 | - $value = number_format($value); |
|
290 | - if($value) { |
|
291 | - $value = '•'; |
|
292 | - } else { |
|
293 | - $value = ' '; |
|
294 | - } |
|
295 | - break; |
|
296 | - |
|
297 | - case "template": |
|
298 | - // replace [+value+] first |
|
299 | - $value = str_replace("[+value+]", $value, $type_format); |
|
300 | - // replace other [+fields+] |
|
301 | - if(strpos($value, "[+") !== false) { |
|
302 | - foreach($row as $k => $v) { |
|
303 | - $value = str_replace("[+$k+]", $v, $value); |
|
304 | - } |
|
305 | - } |
|
306 | - break; |
|
307 | - |
|
308 | - } |
|
309 | - return $value; |
|
310 | - } |
|
241 | + if(strpos($type, ":") !== false) { |
|
242 | + list($type, $type_format) = explode(":", $type, 2); |
|
243 | + } |
|
244 | + switch(strtolower($type)) { |
|
245 | + case "integer": |
|
246 | + if($align == "") { |
|
247 | + $align = "right"; |
|
248 | + } |
|
249 | + $value = number_format($value); |
|
250 | + break; |
|
251 | + |
|
252 | + case "float": |
|
253 | + if($align == "") { |
|
254 | + $align = "right"; |
|
255 | + } |
|
256 | + if(!$type_format) { |
|
257 | + $type_format = 2; |
|
258 | + } |
|
259 | + $value = number_format($value, $type_format); |
|
260 | + break; |
|
261 | + |
|
262 | + case "currency": |
|
263 | + if($align == "") { |
|
264 | + $align = "right"; |
|
265 | + } |
|
266 | + if(!$type_format) { |
|
267 | + $type_format = 2; |
|
268 | + } |
|
269 | + $value = "$" . number_format($value, $type_format); |
|
270 | + break; |
|
271 | + |
|
272 | + case "date": |
|
273 | + if($align == "") { |
|
274 | + $align = "right"; |
|
275 | + } |
|
276 | + if(!is_numeric($value)) { |
|
277 | + $value = strtotime($value); |
|
278 | + } |
|
279 | + if(!$type_format) { |
|
280 | + $type_format = "%A %d, %B %Y"; |
|
281 | + } |
|
282 | + $value = strftime($type_format, $value); |
|
283 | + break; |
|
284 | + |
|
285 | + case "boolean": |
|
286 | + if($align == '') { |
|
287 | + $align = "center"; |
|
288 | + } |
|
289 | + $value = number_format($value); |
|
290 | + if($value) { |
|
291 | + $value = '•'; |
|
292 | + } else { |
|
293 | + $value = ' '; |
|
294 | + } |
|
295 | + break; |
|
296 | + |
|
297 | + case "template": |
|
298 | + // replace [+value+] first |
|
299 | + $value = str_replace("[+value+]", $value, $type_format); |
|
300 | + // replace other [+fields+] |
|
301 | + if(strpos($value, "[+") !== false) { |
|
302 | + foreach($row as $k => $v) { |
|
303 | + $value = str_replace("[+$k+]", $v, $value); |
|
304 | + } |
|
305 | + } |
|
306 | + break; |
|
307 | + |
|
308 | + } |
|
309 | + return $value; |
|
310 | + } |
|
311 | 311 | } |
@@ -12,18 +12,18 @@ discard block |
||
12 | 12 | |
13 | 13 | class DataSetPager { |
14 | 14 | |
15 | - public $ds; // datasource |
|
15 | + public $ds; // datasource |
|
16 | 16 | public $pageSize; |
17 | 17 | public $pageNumber; |
18 | 18 | public $rows; |
19 | 19 | public $pager; |
20 | 20 | public $id; |
21 | 21 | |
22 | - // normal page |
|
22 | + // normal page |
|
23 | 23 | public $pageStyle; |
24 | 24 | public $pageClass; |
25 | 25 | |
26 | - // selected page |
|
26 | + // selected page |
|
27 | 27 | public $selPageStyle; |
28 | 28 | public $selPageClass; |
29 | 29 | public $renderRowFnc; |
@@ -32,166 +32,166 @@ discard block |
||
32 | 32 | public $renderPagerFncArgs; |
33 | 33 | |
34 | 34 | public function __construct($id, $ds, $pageSize = 10, $pageNumber = -1) { |
35 | - global $_PAGE; // use view state object |
|
36 | - |
|
37 | - global $__DataSetPagerCnt; |
|
38 | - |
|
39 | - // set id |
|
40 | - $__DataSetPagerCnt++; |
|
41 | - $this->id = !empty($id) ? $id : "dsp" . $__DataSetPagerCnt; |
|
42 | - |
|
43 | - // get pagenumber |
|
44 | - // by setting pager to -1 cause pager to load it's last page number |
|
45 | - if($pageNumber == -1) { |
|
46 | - $pageNumber = 1; |
|
47 | - if(isset($_GET["dpgn" . $this->id])) { |
|
48 | - $pageNumber = $_GET["dpgn" . $this->id]; |
|
49 | - } elseif(isset($_PAGE['vs'][$id . '_dpgn'])) { |
|
50 | - $pageNumber = $_PAGE['vs'][$id . '_dpgn']; |
|
51 | - } |
|
52 | - } |
|
53 | - if(!is_numeric($pageNumber)) { |
|
54 | - $pageNumber = 1; |
|
55 | - } |
|
56 | - |
|
57 | - $this->ds = $ds; // datasource |
|
58 | - $this->pageSize = $pageSize; |
|
59 | - $this->pageNumber = $pageNumber; |
|
60 | - $this->rows = ''; |
|
61 | - $this->pager = ''; |
|
62 | - } |
|
35 | + global $_PAGE; // use view state object |
|
36 | + |
|
37 | + global $__DataSetPagerCnt; |
|
38 | + |
|
39 | + // set id |
|
40 | + $__DataSetPagerCnt++; |
|
41 | + $this->id = !empty($id) ? $id : "dsp" . $__DataSetPagerCnt; |
|
42 | + |
|
43 | + // get pagenumber |
|
44 | + // by setting pager to -1 cause pager to load it's last page number |
|
45 | + if($pageNumber == -1) { |
|
46 | + $pageNumber = 1; |
|
47 | + if(isset($_GET["dpgn" . $this->id])) { |
|
48 | + $pageNumber = $_GET["dpgn" . $this->id]; |
|
49 | + } elseif(isset($_PAGE['vs'][$id . '_dpgn'])) { |
|
50 | + $pageNumber = $_PAGE['vs'][$id . '_dpgn']; |
|
51 | + } |
|
52 | + } |
|
53 | + if(!is_numeric($pageNumber)) { |
|
54 | + $pageNumber = 1; |
|
55 | + } |
|
56 | + |
|
57 | + $this->ds = $ds; // datasource |
|
58 | + $this->pageSize = $pageSize; |
|
59 | + $this->pageNumber = $pageNumber; |
|
60 | + $this->rows = ''; |
|
61 | + $this->pager = ''; |
|
62 | + } |
|
63 | 63 | |
64 | 64 | public function getRenderedPager() { |
65 | - return $this->pager; |
|
66 | - } |
|
65 | + return $this->pager; |
|
66 | + } |
|
67 | 67 | |
68 | 68 | public function getRenderedRows() { |
69 | - return $this->rows; |
|
70 | - } |
|
69 | + return $this->rows; |
|
70 | + } |
|
71 | 71 | |
72 | 72 | public function setDataSource($ds) { |
73 | - $this->ds = $ds; |
|
74 | - } |
|
73 | + $this->ds = $ds; |
|
74 | + } |
|
75 | 75 | |
76 | 76 | public function setPageSize($ps) { |
77 | - $this->pageSize = $ps; |
|
78 | - } |
|
77 | + $this->pageSize = $ps; |
|
78 | + } |
|
79 | 79 | |
80 | 80 | public function setRenderRowFnc($fncName, $args = "") { |
81 | - $this->renderRowFnc = &$fncName; |
|
82 | - $this->renderRowFncArgs = $args; // extra agruments |
|
81 | + $this->renderRowFnc = &$fncName; |
|
82 | + $this->renderRowFncArgs = $args; // extra agruments |
|
83 | 83 | |
84 | 84 | |
85 | - } |
|
85 | + } |
|
86 | 86 | |
87 | 87 | public function setRenderPagerFnc($fncName, $args = "") { |
88 | - $this->renderPagerFnc = $fncName; |
|
89 | - $this->renderPagerFncArgs = $args; // extra agruments |
|
90 | - } |
|
88 | + $this->renderPagerFnc = $fncName; |
|
89 | + $this->renderPagerFncArgs = $args; // extra agruments |
|
90 | + } |
|
91 | 91 | |
92 | 92 | public function render() { |
93 | - global $modx, $_PAGE; |
|
94 | - |
|
95 | - $isDataset = $modx->db->isResult($this->ds); |
|
96 | - |
|
97 | - if(!$this->selPageStyle) { |
|
98 | - $this->selPageStyle = "font-weight:bold"; |
|
99 | - } |
|
100 | - |
|
101 | - // get total number of rows |
|
102 | - $tnr = ($isDataset) ? $modx->db->getRecordCount($this->ds) : count($this->ds); |
|
103 | - |
|
104 | - // render: no records found |
|
105 | - if($tnr <= 0) { |
|
106 | - $fnc = $this->renderRowFnc; |
|
107 | - $args = $this->renderRowFncArgs; |
|
108 | - if(isset($fnc)) { |
|
109 | - if($args != "") { |
|
110 | - $this->rows .= $fnc(0, null, $args); |
|
111 | - } // if agrs was specified then we will pass three params |
|
112 | - else { |
|
113 | - $this->rows .= $fnc(0, null); |
|
114 | - } // otherwise two will be passed |
|
115 | - } |
|
116 | - return; |
|
117 | - } |
|
118 | - |
|
119 | - // get total pages |
|
120 | - $tp = ceil($tnr / $this->pageSize); |
|
121 | - if($this->pageNumber > $tp) { |
|
122 | - $this->pageNumber = 1; |
|
123 | - } |
|
124 | - |
|
125 | - // get page number |
|
126 | - $p = $this->pageNumber; |
|
127 | - |
|
128 | - // save page number to view state if available |
|
129 | - if(isset($_PAGE['vs'])) { |
|
130 | - $_PAGE['vs'][$this->id . '_dpgn'] = $p; |
|
131 | - } |
|
132 | - |
|
133 | - // render pager : renderPagerFnc($cuurentPage,$pagerNumber,$arguments=""); |
|
134 | - if($tp > 1) { |
|
135 | - $url = ''; |
|
136 | - $fnc = $this->renderPagerFnc; |
|
137 | - $args = $this->renderPagerFncArgs; |
|
138 | - if(!isset($fnc)) { |
|
139 | - if($modx->isFrontend()) { |
|
140 | - $url = $modx->makeUrl($modx->documentIdentifier, '', '', 'full') . '?'; |
|
141 | - } else { |
|
142 | - $url = $_SERVER['PHP_SELF'] . '?'; |
|
143 | - } |
|
144 | - $i = 0; |
|
145 | - foreach($_GET as $n => $v) if($n != 'dpgn' . $this->id) { |
|
146 | - $i++; |
|
147 | - $url .= (($i > 1) ? "&" : "") . "$n=$v"; |
|
148 | - } |
|
149 | - if($i >= 1) { |
|
150 | - $url .= "&"; |
|
151 | - } |
|
152 | - } |
|
153 | - for($i = 1; $i <= $tp; $i++) { |
|
154 | - if(isset($fnc)) { |
|
155 | - if($args != "") { |
|
156 | - $this->pager .= $fnc($p, $i, $args); |
|
157 | - } else { |
|
158 | - $this->pager .= $fnc($p, $i); |
|
159 | - } |
|
160 | - } else { |
|
161 | - $this->pager .= ($p == $i) ? " <span class='" . $this->selPageClass . "' style='" . $this->selPageStyle . "'>$i</span> " : " <a href='" . $url . "dpgn" . $this->id . "=$i' class='" . $this->pageClass . "' style='" . $this->pageStyle . "'>$i</a> "; |
|
162 | - } |
|
163 | - } |
|
164 | - } |
|
165 | - |
|
166 | - // render row : renderRowFnc($rowNumber,$row,$arguments="") |
|
167 | - $fnc = $this->renderRowFnc; |
|
168 | - $args = $this->renderRowFncArgs; |
|
169 | - |
|
170 | - if(isset($fnc)) { |
|
171 | - $i = 1; |
|
172 | - $fncObject = is_object($fnc); |
|
173 | - $minitems = (($p - 1) * $this->pageSize) + 1; |
|
174 | - $maxitems = (($p - 1) * $this->pageSize) + $this->pageSize; |
|
175 | - while($i <= $maxitems && ($row = ($isDataset) ? $modx->db->getRow($this->ds) : $this->ds[$i - 1])) { |
|
176 | - if($i >= $minitems && $i <= $maxitems) { |
|
177 | - if($fncObject) { |
|
178 | - if($args != "") { |
|
179 | - $this->rows .= $fnc->RenderRowFnc($i, $row, $args); |
|
180 | - } else { |
|
181 | - $this->rows .= $fnc->RenderRowFnc($i, $row); |
|
182 | - } |
|
183 | - } else { |
|
184 | - if($args != "") { |
|
185 | - $this->rows .= $fnc($i, $row, $args); |
|
186 | - } // if agrs was specified then we wil pass three params |
|
187 | - else { |
|
188 | - $this->rows .= $fnc($i, $row); |
|
189 | - } // otherwise two will be passed |
|
190 | - } |
|
191 | - |
|
192 | - } |
|
193 | - $i++; |
|
194 | - } |
|
195 | - } |
|
196 | - } |
|
93 | + global $modx, $_PAGE; |
|
94 | + |
|
95 | + $isDataset = $modx->db->isResult($this->ds); |
|
96 | + |
|
97 | + if(!$this->selPageStyle) { |
|
98 | + $this->selPageStyle = "font-weight:bold"; |
|
99 | + } |
|
100 | + |
|
101 | + // get total number of rows |
|
102 | + $tnr = ($isDataset) ? $modx->db->getRecordCount($this->ds) : count($this->ds); |
|
103 | + |
|
104 | + // render: no records found |
|
105 | + if($tnr <= 0) { |
|
106 | + $fnc = $this->renderRowFnc; |
|
107 | + $args = $this->renderRowFncArgs; |
|
108 | + if(isset($fnc)) { |
|
109 | + if($args != "") { |
|
110 | + $this->rows .= $fnc(0, null, $args); |
|
111 | + } // if agrs was specified then we will pass three params |
|
112 | + else { |
|
113 | + $this->rows .= $fnc(0, null); |
|
114 | + } // otherwise two will be passed |
|
115 | + } |
|
116 | + return; |
|
117 | + } |
|
118 | + |
|
119 | + // get total pages |
|
120 | + $tp = ceil($tnr / $this->pageSize); |
|
121 | + if($this->pageNumber > $tp) { |
|
122 | + $this->pageNumber = 1; |
|
123 | + } |
|
124 | + |
|
125 | + // get page number |
|
126 | + $p = $this->pageNumber; |
|
127 | + |
|
128 | + // save page number to view state if available |
|
129 | + if(isset($_PAGE['vs'])) { |
|
130 | + $_PAGE['vs'][$this->id . '_dpgn'] = $p; |
|
131 | + } |
|
132 | + |
|
133 | + // render pager : renderPagerFnc($cuurentPage,$pagerNumber,$arguments=""); |
|
134 | + if($tp > 1) { |
|
135 | + $url = ''; |
|
136 | + $fnc = $this->renderPagerFnc; |
|
137 | + $args = $this->renderPagerFncArgs; |
|
138 | + if(!isset($fnc)) { |
|
139 | + if($modx->isFrontend()) { |
|
140 | + $url = $modx->makeUrl($modx->documentIdentifier, '', '', 'full') . '?'; |
|
141 | + } else { |
|
142 | + $url = $_SERVER['PHP_SELF'] . '?'; |
|
143 | + } |
|
144 | + $i = 0; |
|
145 | + foreach($_GET as $n => $v) if($n != 'dpgn' . $this->id) { |
|
146 | + $i++; |
|
147 | + $url .= (($i > 1) ? "&" : "") . "$n=$v"; |
|
148 | + } |
|
149 | + if($i >= 1) { |
|
150 | + $url .= "&"; |
|
151 | + } |
|
152 | + } |
|
153 | + for($i = 1; $i <= $tp; $i++) { |
|
154 | + if(isset($fnc)) { |
|
155 | + if($args != "") { |
|
156 | + $this->pager .= $fnc($p, $i, $args); |
|
157 | + } else { |
|
158 | + $this->pager .= $fnc($p, $i); |
|
159 | + } |
|
160 | + } else { |
|
161 | + $this->pager .= ($p == $i) ? " <span class='" . $this->selPageClass . "' style='" . $this->selPageStyle . "'>$i</span> " : " <a href='" . $url . "dpgn" . $this->id . "=$i' class='" . $this->pageClass . "' style='" . $this->pageStyle . "'>$i</a> "; |
|
162 | + } |
|
163 | + } |
|
164 | + } |
|
165 | + |
|
166 | + // render row : renderRowFnc($rowNumber,$row,$arguments="") |
|
167 | + $fnc = $this->renderRowFnc; |
|
168 | + $args = $this->renderRowFncArgs; |
|
169 | + |
|
170 | + if(isset($fnc)) { |
|
171 | + $i = 1; |
|
172 | + $fncObject = is_object($fnc); |
|
173 | + $minitems = (($p - 1) * $this->pageSize) + 1; |
|
174 | + $maxitems = (($p - 1) * $this->pageSize) + $this->pageSize; |
|
175 | + while($i <= $maxitems && ($row = ($isDataset) ? $modx->db->getRow($this->ds) : $this->ds[$i - 1])) { |
|
176 | + if($i >= $minitems && $i <= $maxitems) { |
|
177 | + if($fncObject) { |
|
178 | + if($args != "") { |
|
179 | + $this->rows .= $fnc->RenderRowFnc($i, $row, $args); |
|
180 | + } else { |
|
181 | + $this->rows .= $fnc->RenderRowFnc($i, $row); |
|
182 | + } |
|
183 | + } else { |
|
184 | + if($args != "") { |
|
185 | + $this->rows .= $fnc($i, $row, $args); |
|
186 | + } // if agrs was specified then we wil pass three params |
|
187 | + else { |
|
188 | + $this->rows .= $fnc($i, $row); |
|
189 | + } // otherwise two will be passed |
|
190 | + } |
|
191 | + |
|
192 | + } |
|
193 | + $i++; |
|
194 | + } |
|
195 | + } |
|
196 | + } |
|
197 | 197 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | |
51 | 51 | $autoloader = realpath(__DIR__.'/../vendor/autoload.php'); |
52 | 52 | if (file_exists($autoloader) && is_readable($autoloader)) { |
53 | - include_once($autoloader); |
|
53 | + include_once($autoloader); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | // get start time |
@@ -65,22 +65,22 @@ discard block |
||
65 | 65 | $site_hostnames_path = $base_path . 'assets/cache/siteHostnames.php'; |
66 | 66 | if(is_file($site_hostnames_path)) include_once($site_hostnames_path); |
67 | 67 | if(!defined('MGR_DIR') || MGR_DIR!==$mgr_dir) { |
68 | - $src = "<?php\n"; |
|
69 | - $src .= "define('MGR_DIR', '{$mgr_dir}');\n"; |
|
70 | - $rs = file_put_contents($site_mgr_path,$src); |
|
71 | - if(!$rs) { |
|
72 | - echo 'siteManager.php write error'; |
|
73 | - exit; |
|
74 | - } |
|
75 | - sleep(1); |
|
76 | - header('Location:' . $_SERVER['REQUEST_URI']); |
|
77 | - exit; |
|
68 | + $src = "<?php\n"; |
|
69 | + $src .= "define('MGR_DIR', '{$mgr_dir}');\n"; |
|
70 | + $rs = file_put_contents($site_mgr_path,$src); |
|
71 | + if(!$rs) { |
|
72 | + echo 'siteManager.php write error'; |
|
73 | + exit; |
|
74 | + } |
|
75 | + sleep(1); |
|
76 | + header('Location:' . $_SERVER['REQUEST_URI']); |
|
77 | + exit; |
|
78 | 78 | } |
79 | 79 | |
80 | 80 | // we use this to make sure files are accessed through |
81 | 81 | // the manager instead of seperately. |
82 | 82 | if ( ! defined('IN_MANAGER_MODE')) { |
83 | - define('IN_MANAGER_MODE', true); |
|
83 | + define('IN_MANAGER_MODE', true); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | // harden it |
@@ -101,16 +101,16 @@ discard block |
||
101 | 101 | |
102 | 102 | // check PHP version. EVO is compatible with php 5 (5.0.0+) |
103 | 103 | $php_ver_comp = version_compare(phpversion(), "5.0.0"); |
104 | - // -1 if left is less, 0 if equal, +1 if left is higher |
|
104 | + // -1 if left is less, 0 if equal, +1 if left is higher |
|
105 | 105 | if($php_ver_comp < 0) { |
106 | - echo sprintf($_lang['php_version_check'], phpversion()); |
|
107 | - exit; |
|
106 | + echo sprintf($_lang['php_version_check'], phpversion()); |
|
107 | + exit; |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | // check if iconv is installed |
111 | 111 | if(!function_exists('iconv')) { |
112 | - echo $_lang['iconv_not_available']; |
|
113 | - exit; |
|
112 | + echo $_lang['iconv_not_available']; |
|
113 | + exit; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | // set some runtime options |
@@ -123,15 +123,15 @@ discard block |
||
123 | 123 | |
124 | 124 | // set the document_root :| |
125 | 125 | if(!isset($_SERVER['DOCUMENT_ROOT']) || empty($_SERVER['DOCUMENT_ROOT'])) { |
126 | - $_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['PATH_INFO'], "", preg_replace("/\\\\/", "/", $_SERVER['PATH_TRANSLATED']))."/"; |
|
126 | + $_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['PATH_INFO'], "", preg_replace("/\\\\/", "/", $_SERVER['PATH_TRANSLATED']))."/"; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | // include_once config file |
130 | 130 | $config_filename = "./includes/config.inc.php"; |
131 | 131 | if (!file_exists($config_filename)) { |
132 | - echo "<h3>Unable to load configuration settings</h3>"; |
|
133 | - echo "Please run the EVO <a href='../install'>install utility</a>"; |
|
134 | - exit; |
|
132 | + echo "<h3>Unable to load configuration settings</h3>"; |
|
133 | + echo "Please run the EVO <a href='../install'>install utility</a>"; |
|
134 | + exit; |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | // include the database configuration file |
@@ -139,11 +139,11 @@ discard block |
||
139 | 139 | |
140 | 140 | // initiate the content manager class |
141 | 141 | if (isset($coreClass) && class_exists($coreClass)) { |
142 | - $modx = new $coreClass; |
|
142 | + $modx = new $coreClass; |
|
143 | 143 | } |
144 | 144 | if (!isset($modx) || !($modx instanceof \DocumentParser)) { |
145 | - include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
146 | - $modx = new \DocumentParser; |
|
145 | + include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
146 | + $modx = new \DocumentParser; |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | $modx->loadExtension("ManagerAPI"); |
@@ -166,25 +166,25 @@ discard block |
||
166 | 166 | |
167 | 167 | // now include_once different language file as english |
168 | 168 | if(!isset($manager_language) || !file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) { |
169 | - $manager_language = "english"; // if not set, get the english language file. |
|
169 | + $manager_language = "english"; // if not set, get the english language file. |
|
170 | 170 | } |
171 | 171 | |
172 | 172 | // $length_eng_lang = count($_lang); // Not used for now, required for difference-check with other languages than english (i.e. inside installer) |
173 | 173 | |
174 | 174 | if($manager_language!="english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) { |
175 | - include_once "lang/".$manager_language.".inc.php"; |
|
175 | + include_once "lang/".$manager_language.".inc.php"; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | // allow custom language overrides not altered by future EVO-updates |
179 | 179 | if(file_exists(MODX_MANAGER_PATH."includes/lang/override/".$manager_language.".inc.php")) { |
180 | - include_once "lang/override/".$manager_language.".inc.php"; |
|
180 | + include_once "lang/override/".$manager_language.".inc.php"; |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | $s = array('[+MGR_DIR+]'); |
184 | 184 | $r = array(MGR_DIR); |
185 | 185 | foreach($_lang as $k=>$v) |
186 | 186 | { |
187 | - if(strpos($v,'[+')!==false) $_lang[$k] = str_replace($s, $r, $v); |
|
187 | + if(strpos($v,'[+')!==false) $_lang[$k] = str_replace($s, $r, $v); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | // send the charset header |
@@ -199,19 +199,19 @@ discard block |
||
199 | 199 | |
200 | 200 | // double check the session |
201 | 201 | if(!isset($_SESSION['mgrValidated'])){ |
202 | - echo "Not Logged In!"; |
|
203 | - exit; |
|
202 | + echo "Not Logged In!"; |
|
203 | + exit; |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | // include_once the style variables file |
207 | 207 | if(isset($manager_theme) && !isset($_style)) { |
208 | - $_style = array(); |
|
209 | - include_once "media/style/".$manager_theme."/style.php"; |
|
208 | + $_style = array(); |
|
209 | + include_once "media/style/".$manager_theme."/style.php"; |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | // check if user is allowed to access manager interface |
213 | 213 | if(isset($allow_manager_access) && $allow_manager_access==0) { |
214 | - include_once "manager.lockout.inc.php"; |
|
214 | + include_once "manager.lockout.inc.php"; |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | // Initialize System Alert Message Queque |
@@ -220,13 +220,13 @@ discard block |
||
220 | 220 | |
221 | 221 | // first we check to see if this is a frameset request |
222 | 222 | if(!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) { |
223 | - // this looks to be a top-level frameset request, so let's serve up a frameset |
|
224 | - if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) { |
|
225 | - include_once "media/style/".$manager_theme."/frames/1.php"; |
|
226 | - }else{ |
|
227 | - include_once "frames/1.php"; |
|
228 | - } |
|
229 | - exit; |
|
223 | + // this looks to be a top-level frameset request, so let's serve up a frameset |
|
224 | + if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) { |
|
225 | + include_once "media/style/".$manager_theme."/frames/1.php"; |
|
226 | + }else{ |
|
227 | + include_once "frames/1.php"; |
|
228 | + } |
|
229 | + exit; |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | // OK, let's retrieve the action directive from the request |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | else $action = null; |
238 | 238 | |
239 | 239 | if (isset($_POST['updateMsgCount']) && $modx->hasPermission('messages')) { |
240 | - include_once 'messageCount.inc.php'; |
|
240 | + include_once 'messageCount.inc.php'; |
|
241 | 241 | } |
242 | 242 | |
243 | 243 | // save page to manager object |
@@ -245,19 +245,19 @@ discard block |
||
245 | 245 | |
246 | 246 | // attempt to foil some simple types of CSRF attacks |
247 | 247 | if (isset($modx->config['validate_referer']) && (int)$modx->config['validate_referer']) { |
248 | - if (isset($_SERVER['HTTP_REFERER'])) { |
|
249 | - $referer = $_SERVER['HTTP_REFERER']; |
|
250 | - |
|
251 | - if (!empty($referer)) { |
|
252 | - if (!preg_match('/^'.preg_quote(MODX_SITE_URL, '/').'/i', $referer)) { |
|
253 | - $modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php"); |
|
254 | - } |
|
255 | - } else { |
|
256 | - $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the client.", "index.php"); |
|
257 | - } |
|
258 | - } else { |
|
259 | - $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the server.", "index.php"); |
|
260 | - } |
|
248 | + if (isset($_SERVER['HTTP_REFERER'])) { |
|
249 | + $referer = $_SERVER['HTTP_REFERER']; |
|
250 | + |
|
251 | + if (!empty($referer)) { |
|
252 | + if (!preg_match('/^'.preg_quote(MODX_SITE_URL, '/').'/i', $referer)) { |
|
253 | + $modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php"); |
|
254 | + } |
|
255 | + } else { |
|
256 | + $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the client.", "index.php"); |
|
257 | + } |
|
258 | + } else { |
|
259 | + $modx->webAlertAndQuit("A possible CSRF attempt was detected. No referer was provided by the server.", "index.php"); |
|
260 | + } |
|
261 | 261 | } |
262 | 262 | |
263 | 263 | // invoke OnManagerPageInit event |
@@ -265,13 +265,13 @@ discard block |
||
265 | 265 | |
266 | 266 | // return element filepath |
267 | 267 | function includeFileProcessor ($filepath,$manager_theme) { |
268 | - $element = ""; |
|
269 | - if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) { |
|
270 | - $element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath; |
|
271 | - }else{ |
|
272 | - $element = $filepath; |
|
273 | - } |
|
274 | - return $element; |
|
268 | + $element = ""; |
|
269 | + if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) { |
|
270 | + $element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath; |
|
271 | + }else{ |
|
272 | + $element = $filepath; |
|
273 | + } |
|
274 | + return $element; |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | // Now we decide what to do according to the action request. This is a BIG list :) |
@@ -279,714 +279,714 @@ discard block |
||
279 | 279 | /********************************************************************/ |
280 | 280 | /* frame management - show the requested frame */ |
281 | 281 | /********************************************************************/ |
282 | - case 1 : |
|
283 | - // get the requested frame |
|
284 | - $frame = preg_replace('/[^a-z0-9]/i','',$_REQUEST['f']); |
|
285 | - if($frame>9) { |
|
286 | - $enable_debug=false; // this is to stop the debug thingy being attached to the framesets |
|
287 | - } |
|
288 | - include_once(includeFileProcessor("frames/".$frame.".php",$manager_theme)); |
|
289 | - break; |
|
282 | + case 1 : |
|
283 | + // get the requested frame |
|
284 | + $frame = preg_replace('/[^a-z0-9]/i','',$_REQUEST['f']); |
|
285 | + if($frame>9) { |
|
286 | + $enable_debug=false; // this is to stop the debug thingy being attached to the framesets |
|
287 | + } |
|
288 | + include_once(includeFileProcessor("frames/".$frame.".php",$manager_theme)); |
|
289 | + break; |
|
290 | 290 | /********************************************************************/ |
291 | 291 | /* show the homepage */ |
292 | 292 | /********************************************************************/ |
293 | - case 2: |
|
294 | - // get the home page |
|
295 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
296 | - include_once(includeFileProcessor("actions/welcome.static.php",$manager_theme)); |
|
297 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
298 | - break; |
|
293 | + case 2: |
|
294 | + // get the home page |
|
295 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
296 | + include_once(includeFileProcessor("actions/welcome.static.php",$manager_theme)); |
|
297 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
298 | + break; |
|
299 | 299 | /********************************************************************/ |
300 | 300 | /* document data */ |
301 | 301 | /********************************************************************/ |
302 | - case 3: |
|
303 | - // get the page to show document's data |
|
304 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
305 | - include_once(includeFileProcessor("actions/document_data.static.php",$manager_theme)); |
|
306 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
307 | - break; |
|
302 | + case 3: |
|
303 | + // get the page to show document's data |
|
304 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
305 | + include_once(includeFileProcessor("actions/document_data.static.php",$manager_theme)); |
|
306 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
307 | + break; |
|
308 | 308 | /********************************************************************/ |
309 | 309 | /* content management */ |
310 | 310 | /********************************************************************/ |
311 | - case 85: |
|
312 | - // get the mutate page for adding a folder |
|
313 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
314 | - include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); |
|
315 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
316 | - break; |
|
317 | - case 27: |
|
318 | - // get the mutate page for changing content |
|
319 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
320 | - include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); |
|
321 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
322 | - break; |
|
323 | - case 4: |
|
324 | - // get the mutate page for adding content |
|
325 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
326 | - include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); |
|
327 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
328 | - break; |
|
329 | - case 5: |
|
330 | - // get the save processor |
|
331 | - include_once(includeFileProcessor("processors/save_content.processor.php",$manager_theme)); |
|
332 | - break; |
|
333 | - case 6: |
|
334 | - // get the delete processor |
|
335 | - include_once(includeFileProcessor("processors/delete_content.processor.php",$manager_theme)); |
|
336 | - break; |
|
337 | - case 63: |
|
338 | - // get the undelete processor |
|
339 | - include_once(includeFileProcessor("processors/undelete_content.processor.php",$manager_theme)); |
|
340 | - break; |
|
341 | - case 51: |
|
342 | - // get the move action |
|
343 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
344 | - include_once(includeFileProcessor("actions/move_document.dynamic.php",$manager_theme)); |
|
345 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
346 | - break; |
|
347 | - case 52: |
|
348 | - // get the move document processor |
|
349 | - include_once(includeFileProcessor("processors/move_document.processor.php",$manager_theme)); |
|
350 | - break; |
|
351 | - case 61: |
|
352 | - // get the processor for publishing content |
|
353 | - include_once(includeFileProcessor("processors/publish_content.processor.php",$manager_theme)); |
|
354 | - break; |
|
355 | - case 62: |
|
356 | - // get the processor for publishing content |
|
357 | - include_once(includeFileProcessor("processors/unpublish_content.processor.php",$manager_theme)); |
|
358 | - break; |
|
359 | - case 56: |
|
360 | - // get the sort menuindex action |
|
361 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
362 | - include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php",$manager_theme)); |
|
363 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
364 | - break; |
|
311 | + case 85: |
|
312 | + // get the mutate page for adding a folder |
|
313 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
314 | + include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); |
|
315 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
316 | + break; |
|
317 | + case 27: |
|
318 | + // get the mutate page for changing content |
|
319 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
320 | + include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); |
|
321 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
322 | + break; |
|
323 | + case 4: |
|
324 | + // get the mutate page for adding content |
|
325 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
326 | + include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); |
|
327 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
328 | + break; |
|
329 | + case 5: |
|
330 | + // get the save processor |
|
331 | + include_once(includeFileProcessor("processors/save_content.processor.php",$manager_theme)); |
|
332 | + break; |
|
333 | + case 6: |
|
334 | + // get the delete processor |
|
335 | + include_once(includeFileProcessor("processors/delete_content.processor.php",$manager_theme)); |
|
336 | + break; |
|
337 | + case 63: |
|
338 | + // get the undelete processor |
|
339 | + include_once(includeFileProcessor("processors/undelete_content.processor.php",$manager_theme)); |
|
340 | + break; |
|
341 | + case 51: |
|
342 | + // get the move action |
|
343 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
344 | + include_once(includeFileProcessor("actions/move_document.dynamic.php",$manager_theme)); |
|
345 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
346 | + break; |
|
347 | + case 52: |
|
348 | + // get the move document processor |
|
349 | + include_once(includeFileProcessor("processors/move_document.processor.php",$manager_theme)); |
|
350 | + break; |
|
351 | + case 61: |
|
352 | + // get the processor for publishing content |
|
353 | + include_once(includeFileProcessor("processors/publish_content.processor.php",$manager_theme)); |
|
354 | + break; |
|
355 | + case 62: |
|
356 | + // get the processor for publishing content |
|
357 | + include_once(includeFileProcessor("processors/unpublish_content.processor.php",$manager_theme)); |
|
358 | + break; |
|
359 | + case 56: |
|
360 | + // get the sort menuindex action |
|
361 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
362 | + include_once(includeFileProcessor("actions/mutate_menuindex_sort.dynamic.php",$manager_theme)); |
|
363 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
364 | + break; |
|
365 | 365 | /********************************************************************/ |
366 | 366 | /* show the wait page - gives the tree time to refresh (hopefully) */ |
367 | 367 | /********************************************************************/ |
368 | - case 7: |
|
369 | - // get the wait page (so the tree can reload) |
|
370 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
371 | - include_once(includeFileProcessor("actions/wait.static.php",$manager_theme)); |
|
372 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
373 | - break; |
|
368 | + case 7: |
|
369 | + // get the wait page (so the tree can reload) |
|
370 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
371 | + include_once(includeFileProcessor("actions/wait.static.php",$manager_theme)); |
|
372 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
373 | + break; |
|
374 | 374 | /********************************************************************/ |
375 | 375 | /* let the user log out */ |
376 | 376 | /********************************************************************/ |
377 | - case 8: |
|
378 | - // get the logout processor |
|
379 | - include_once(includeFileProcessor("processors/logout.processor.php",$manager_theme)); |
|
380 | - break; |
|
377 | + case 8: |
|
378 | + // get the logout processor |
|
379 | + include_once(includeFileProcessor("processors/logout.processor.php",$manager_theme)); |
|
380 | + break; |
|
381 | 381 | /********************************************************************/ |
382 | 382 | /* user management */ |
383 | 383 | /********************************************************************/ |
384 | - case 87: |
|
385 | - // get the new web user page |
|
386 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
387 | - include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme)); |
|
388 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
389 | - break; |
|
390 | - case 88: |
|
391 | - // get the edit web user page |
|
392 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
393 | - include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme)); |
|
394 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
395 | - break; |
|
396 | - case 89: |
|
397 | - // get the save web user processor |
|
398 | - include_once(includeFileProcessor("processors/save_web_user.processor.php",$manager_theme)); |
|
399 | - break; |
|
400 | - case 90: |
|
401 | - // get the delete web user page |
|
402 | - include_once(includeFileProcessor("processors/delete_web_user.processor.php",$manager_theme)); |
|
403 | - break; |
|
404 | - case 11: |
|
405 | - // get the new user page |
|
406 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
407 | - include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme)); |
|
408 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
409 | - break; |
|
410 | - case 12: |
|
411 | - // get the edit user page |
|
412 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
413 | - include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme)); |
|
414 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
415 | - break; |
|
416 | - case 32: |
|
417 | - // get the save user processor |
|
418 | - include_once(includeFileProcessor("processors/save_user.processor.php",$manager_theme)); |
|
419 | - break; |
|
420 | - case 28: |
|
421 | - // get the change password page |
|
422 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
423 | - include_once(includeFileProcessor("actions/mutate_password.dynamic.php",$manager_theme)); |
|
424 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
425 | - break; |
|
426 | - case 34: |
|
427 | - // get the save new password page |
|
428 | - include_once(includeFileProcessor("processors/save_password.processor.php",$manager_theme)); |
|
429 | - break; |
|
430 | - case 33: |
|
431 | - // get the delete user page |
|
432 | - include_once(includeFileProcessor("processors/delete_user.processor.php",$manager_theme)); |
|
433 | - break; |
|
384 | + case 87: |
|
385 | + // get the new web user page |
|
386 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
387 | + include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme)); |
|
388 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
389 | + break; |
|
390 | + case 88: |
|
391 | + // get the edit web user page |
|
392 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
393 | + include_once(includeFileProcessor("actions/mutate_web_user.dynamic.php",$manager_theme)); |
|
394 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
395 | + break; |
|
396 | + case 89: |
|
397 | + // get the save web user processor |
|
398 | + include_once(includeFileProcessor("processors/save_web_user.processor.php",$manager_theme)); |
|
399 | + break; |
|
400 | + case 90: |
|
401 | + // get the delete web user page |
|
402 | + include_once(includeFileProcessor("processors/delete_web_user.processor.php",$manager_theme)); |
|
403 | + break; |
|
404 | + case 11: |
|
405 | + // get the new user page |
|
406 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
407 | + include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme)); |
|
408 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
409 | + break; |
|
410 | + case 12: |
|
411 | + // get the edit user page |
|
412 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
413 | + include_once(includeFileProcessor("actions/mutate_user.dynamic.php",$manager_theme)); |
|
414 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
415 | + break; |
|
416 | + case 32: |
|
417 | + // get the save user processor |
|
418 | + include_once(includeFileProcessor("processors/save_user.processor.php",$manager_theme)); |
|
419 | + break; |
|
420 | + case 28: |
|
421 | + // get the change password page |
|
422 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
423 | + include_once(includeFileProcessor("actions/mutate_password.dynamic.php",$manager_theme)); |
|
424 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
425 | + break; |
|
426 | + case 34: |
|
427 | + // get the save new password page |
|
428 | + include_once(includeFileProcessor("processors/save_password.processor.php",$manager_theme)); |
|
429 | + break; |
|
430 | + case 33: |
|
431 | + // get the delete user page |
|
432 | + include_once(includeFileProcessor("processors/delete_user.processor.php",$manager_theme)); |
|
433 | + break; |
|
434 | 434 | /********************************************************************/ |
435 | 435 | /* role management */ |
436 | 436 | /********************************************************************/ |
437 | - case 38: |
|
438 | - // get the new role page |
|
439 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
440 | - include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme)); |
|
441 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
442 | - break; |
|
443 | - case 35: |
|
444 | - // get the edit role page |
|
445 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
446 | - include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme)); |
|
447 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
448 | - break; |
|
449 | - case 36: |
|
450 | - // get the save role page |
|
451 | - include_once(includeFileProcessor("processors/save_role.processor.php",$manager_theme)); |
|
452 | - break; |
|
453 | - case 37: |
|
454 | - // get the delete role page |
|
455 | - include_once(includeFileProcessor("processors/delete_role.processor.php",$manager_theme)); |
|
456 | - break; |
|
437 | + case 38: |
|
438 | + // get the new role page |
|
439 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
440 | + include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme)); |
|
441 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
442 | + break; |
|
443 | + case 35: |
|
444 | + // get the edit role page |
|
445 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
446 | + include_once(includeFileProcessor("actions/mutate_role.dynamic.php",$manager_theme)); |
|
447 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
448 | + break; |
|
449 | + case 36: |
|
450 | + // get the save role page |
|
451 | + include_once(includeFileProcessor("processors/save_role.processor.php",$manager_theme)); |
|
452 | + break; |
|
453 | + case 37: |
|
454 | + // get the delete role page |
|
455 | + include_once(includeFileProcessor("processors/delete_role.processor.php",$manager_theme)); |
|
456 | + break; |
|
457 | 457 | /********************************************************************/ |
458 | 458 | /* category management */ |
459 | 459 | /********************************************************************/ |
460 | - case 120: |
|
461 | - // get the edit category page |
|
462 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
463 | - include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme)); |
|
464 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
465 | - break; |
|
466 | - case 121: |
|
467 | - // for ajax-requests |
|
468 | - include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme)); |
|
469 | - break; |
|
460 | + case 120: |
|
461 | + // get the edit category page |
|
462 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
463 | + include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme)); |
|
464 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
465 | + break; |
|
466 | + case 121: |
|
467 | + // for ajax-requests |
|
468 | + include_once(includeFileProcessor("actions/mutate_categories.dynamic.php",$manager_theme)); |
|
469 | + break; |
|
470 | 470 | /********************************************************************/ |
471 | 471 | /* template management */ |
472 | 472 | /********************************************************************/ |
473 | - case 16: |
|
474 | - // get the edit template action |
|
475 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
476 | - include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme)); |
|
477 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
478 | - break; |
|
479 | - case 19: |
|
480 | - // get the new template action |
|
481 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
482 | - include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme)); |
|
483 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
484 | - break; |
|
485 | - case 20: |
|
486 | - // get the save processor |
|
487 | - include_once(includeFileProcessor("processors/save_template.processor.php",$manager_theme)); |
|
488 | - break; |
|
489 | - case 21: |
|
490 | - // get the delete processor |
|
491 | - include_once(includeFileProcessor("processors/delete_template.processor.php",$manager_theme)); |
|
492 | - break; |
|
493 | - case 96: |
|
494 | - // get the duplicate template processor |
|
495 | - include_once(includeFileProcessor("processors/duplicate_template.processor.php",$manager_theme)); |
|
496 | - break; |
|
497 | - case 117: |
|
498 | - // change the tv rank for selected template |
|
499 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
500 | - include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php",$manager_theme)); |
|
501 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
502 | - break; |
|
473 | + case 16: |
|
474 | + // get the edit template action |
|
475 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
476 | + include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme)); |
|
477 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
478 | + break; |
|
479 | + case 19: |
|
480 | + // get the new template action |
|
481 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
482 | + include_once(includeFileProcessor("actions/mutate_templates.dynamic.php",$manager_theme)); |
|
483 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
484 | + break; |
|
485 | + case 20: |
|
486 | + // get the save processor |
|
487 | + include_once(includeFileProcessor("processors/save_template.processor.php",$manager_theme)); |
|
488 | + break; |
|
489 | + case 21: |
|
490 | + // get the delete processor |
|
491 | + include_once(includeFileProcessor("processors/delete_template.processor.php",$manager_theme)); |
|
492 | + break; |
|
493 | + case 96: |
|
494 | + // get the duplicate template processor |
|
495 | + include_once(includeFileProcessor("processors/duplicate_template.processor.php",$manager_theme)); |
|
496 | + break; |
|
497 | + case 117: |
|
498 | + // change the tv rank for selected template |
|
499 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
500 | + include_once(includeFileProcessor("actions/mutate_template_tv_rank.dynamic.php",$manager_theme)); |
|
501 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
502 | + break; |
|
503 | 503 | /********************************************************************/ |
504 | 504 | /* snippet management */ |
505 | 505 | /********************************************************************/ |
506 | - case 22: |
|
507 | - // get the edit snippet action |
|
508 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
509 | - include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme)); |
|
510 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
511 | - break; |
|
512 | - case 23: |
|
513 | - // get the new snippet action |
|
514 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
515 | - include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme)); |
|
516 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
517 | - break; |
|
518 | - case 24: |
|
519 | - // get the save processor |
|
520 | - include_once(includeFileProcessor("processors/save_snippet.processor.php",$manager_theme)); |
|
521 | - break; |
|
522 | - case 25: |
|
523 | - // get the delete processor |
|
524 | - include_once(includeFileProcessor("processors/delete_snippet.processor.php",$manager_theme)); |
|
525 | - break; |
|
526 | - case 98: |
|
527 | - // get the duplicate processor |
|
528 | - include_once(includeFileProcessor("processors/duplicate_snippet.processor.php",$manager_theme)); |
|
529 | - break; |
|
506 | + case 22: |
|
507 | + // get the edit snippet action |
|
508 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
509 | + include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme)); |
|
510 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
511 | + break; |
|
512 | + case 23: |
|
513 | + // get the new snippet action |
|
514 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
515 | + include_once(includeFileProcessor("actions/mutate_snippet.dynamic.php",$manager_theme)); |
|
516 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
517 | + break; |
|
518 | + case 24: |
|
519 | + // get the save processor |
|
520 | + include_once(includeFileProcessor("processors/save_snippet.processor.php",$manager_theme)); |
|
521 | + break; |
|
522 | + case 25: |
|
523 | + // get the delete processor |
|
524 | + include_once(includeFileProcessor("processors/delete_snippet.processor.php",$manager_theme)); |
|
525 | + break; |
|
526 | + case 98: |
|
527 | + // get the duplicate processor |
|
528 | + include_once(includeFileProcessor("processors/duplicate_snippet.processor.php",$manager_theme)); |
|
529 | + break; |
|
530 | 530 | /********************************************************************/ |
531 | 531 | /* htmlsnippet management */ |
532 | 532 | /********************************************************************/ |
533 | - case 78: |
|
534 | - // get the edit snippet action |
|
535 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
536 | - include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme)); |
|
537 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
538 | - break; |
|
539 | - case 77: |
|
540 | - // get the new snippet action |
|
541 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
542 | - include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme)); |
|
543 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
544 | - break; |
|
545 | - case 79: |
|
546 | - // get the save processor |
|
547 | - include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php",$manager_theme)); |
|
548 | - break; |
|
549 | - case 80: |
|
550 | - // get the delete processor |
|
551 | - include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php",$manager_theme)); |
|
552 | - break; |
|
553 | - case 97: |
|
554 | - // get the duplicate processor |
|
555 | - include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php",$manager_theme)); |
|
556 | - break; |
|
533 | + case 78: |
|
534 | + // get the edit snippet action |
|
535 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
536 | + include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme)); |
|
537 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
538 | + break; |
|
539 | + case 77: |
|
540 | + // get the new snippet action |
|
541 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
542 | + include_once(includeFileProcessor("actions/mutate_htmlsnippet.dynamic.php",$manager_theme)); |
|
543 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
544 | + break; |
|
545 | + case 79: |
|
546 | + // get the save processor |
|
547 | + include_once(includeFileProcessor("processors/save_htmlsnippet.processor.php",$manager_theme)); |
|
548 | + break; |
|
549 | + case 80: |
|
550 | + // get the delete processor |
|
551 | + include_once(includeFileProcessor("processors/delete_htmlsnippet.processor.php",$manager_theme)); |
|
552 | + break; |
|
553 | + case 97: |
|
554 | + // get the duplicate processor |
|
555 | + include_once(includeFileProcessor("processors/duplicate_htmlsnippet.processor.php",$manager_theme)); |
|
556 | + break; |
|
557 | 557 | /********************************************************************/ |
558 | 558 | /* show the credits page */ |
559 | 559 | /********************************************************************/ |
560 | - case 18: |
|
561 | - // get the credits page |
|
562 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
563 | - include_once(includeFileProcessor("actions/credits.static.php",$manager_theme)); |
|
564 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
565 | - break; |
|
560 | + case 18: |
|
561 | + // get the credits page |
|
562 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
563 | + include_once(includeFileProcessor("actions/credits.static.php",$manager_theme)); |
|
564 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
565 | + break; |
|
566 | 566 | /********************************************************************/ |
567 | 567 | /* empty cache & synchronisation */ |
568 | 568 | /********************************************************************/ |
569 | - case 26: |
|
570 | - // get the cache emptying processor |
|
571 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
572 | - include_once(includeFileProcessor("actions/refresh_site.dynamic.php",$manager_theme)); |
|
573 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
574 | - break; |
|
569 | + case 26: |
|
570 | + // get the cache emptying processor |
|
571 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
572 | + include_once(includeFileProcessor("actions/refresh_site.dynamic.php",$manager_theme)); |
|
573 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
574 | + break; |
|
575 | 575 | /********************************************************************/ |
576 | 576 | /* Module management */ |
577 | 577 | /********************************************************************/ |
578 | - case 106: |
|
579 | - // get module management |
|
580 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
581 | - include_once(includeFileProcessor("actions/modules.static.php",$manager_theme)); |
|
582 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
583 | - break; |
|
584 | - case 107: |
|
585 | - // get the new module action |
|
586 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
587 | - include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme)); |
|
588 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
589 | - break; |
|
590 | - case 108: |
|
591 | - // get the edit module action |
|
592 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
593 | - include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme)); |
|
594 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
595 | - break; |
|
596 | - case 109: |
|
597 | - // get the save processor |
|
598 | - include_once(includeFileProcessor("processors/save_module.processor.php",$manager_theme)); |
|
599 | - break; |
|
600 | - case 110: |
|
601 | - // get the delete processor |
|
602 | - include_once(includeFileProcessor("processors/delete_module.processor.php",$manager_theme)); |
|
603 | - break; |
|
604 | - case 111: |
|
605 | - // get the duplicate processor |
|
606 | - include_once(includeFileProcessor("processors/duplicate_module.processor.php",$manager_theme)); |
|
607 | - break; |
|
608 | - case 112: |
|
609 | - // execute/run the module |
|
610 | - //include_once "header.inc.php"; |
|
611 | - include_once(includeFileProcessor("processors/execute_module.processor.php",$manager_theme)); |
|
612 | - //include_once "footer.inc.php"; |
|
613 | - break; |
|
614 | - case 113: |
|
615 | - // get the module resources (dependencies) action |
|
616 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
617 | - include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php",$manager_theme)); |
|
618 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
619 | - break; |
|
578 | + case 106: |
|
579 | + // get module management |
|
580 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
581 | + include_once(includeFileProcessor("actions/modules.static.php",$manager_theme)); |
|
582 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
583 | + break; |
|
584 | + case 107: |
|
585 | + // get the new module action |
|
586 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
587 | + include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme)); |
|
588 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
589 | + break; |
|
590 | + case 108: |
|
591 | + // get the edit module action |
|
592 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
593 | + include_once(includeFileProcessor("actions/mutate_module.dynamic.php",$manager_theme)); |
|
594 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
595 | + break; |
|
596 | + case 109: |
|
597 | + // get the save processor |
|
598 | + include_once(includeFileProcessor("processors/save_module.processor.php",$manager_theme)); |
|
599 | + break; |
|
600 | + case 110: |
|
601 | + // get the delete processor |
|
602 | + include_once(includeFileProcessor("processors/delete_module.processor.php",$manager_theme)); |
|
603 | + break; |
|
604 | + case 111: |
|
605 | + // get the duplicate processor |
|
606 | + include_once(includeFileProcessor("processors/duplicate_module.processor.php",$manager_theme)); |
|
607 | + break; |
|
608 | + case 112: |
|
609 | + // execute/run the module |
|
610 | + //include_once "header.inc.php"; |
|
611 | + include_once(includeFileProcessor("processors/execute_module.processor.php",$manager_theme)); |
|
612 | + //include_once "footer.inc.php"; |
|
613 | + break; |
|
614 | + case 113: |
|
615 | + // get the module resources (dependencies) action |
|
616 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
617 | + include_once(includeFileProcessor("actions/mutate_module_resources.dynamic.php",$manager_theme)); |
|
618 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
619 | + break; |
|
620 | 620 | /********************************************************************/ |
621 | 621 | /* plugin management */ |
622 | 622 | /********************************************************************/ |
623 | - case 100: |
|
624 | - // change the plugin priority |
|
625 | - //include_once "header.inc.php"; - in action file |
|
626 | - include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php",$manager_theme)); |
|
627 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
628 | - break; |
|
629 | - case 101: |
|
630 | - // get the new plugin action |
|
631 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
632 | - include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme)); |
|
633 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
634 | - break; |
|
635 | - case 102: |
|
636 | - // get the edit plugin action |
|
637 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
638 | - include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme)); |
|
639 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
640 | - break; |
|
641 | - case 103: |
|
642 | - // get the save processor |
|
643 | - include_once(includeFileProcessor("processors/save_plugin.processor.php",$manager_theme)); |
|
644 | - break; |
|
645 | - case 104: |
|
646 | - // get the delete processor |
|
647 | - include_once(includeFileProcessor("processors/delete_plugin.processor.php",$manager_theme)); |
|
648 | - break; |
|
649 | - case 105: |
|
650 | - // get the duplicate processor |
|
651 | - include_once(includeFileProcessor("processors/duplicate_plugin.processor.php",$manager_theme)); |
|
652 | - break; |
|
653 | - case 119: |
|
654 | - // get the purge processor |
|
655 | - include_once(includeFileProcessor("processors/purge_plugin.processor.php",$manager_theme)); |
|
656 | - break; |
|
623 | + case 100: |
|
624 | + // change the plugin priority |
|
625 | + //include_once "header.inc.php"; - in action file |
|
626 | + include_once(includeFileProcessor("actions/mutate_plugin_priority.dynamic.php",$manager_theme)); |
|
627 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
628 | + break; |
|
629 | + case 101: |
|
630 | + // get the new plugin action |
|
631 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
632 | + include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme)); |
|
633 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
634 | + break; |
|
635 | + case 102: |
|
636 | + // get the edit plugin action |
|
637 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
638 | + include_once(includeFileProcessor("actions/mutate_plugin.dynamic.php",$manager_theme)); |
|
639 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
640 | + break; |
|
641 | + case 103: |
|
642 | + // get the save processor |
|
643 | + include_once(includeFileProcessor("processors/save_plugin.processor.php",$manager_theme)); |
|
644 | + break; |
|
645 | + case 104: |
|
646 | + // get the delete processor |
|
647 | + include_once(includeFileProcessor("processors/delete_plugin.processor.php",$manager_theme)); |
|
648 | + break; |
|
649 | + case 105: |
|
650 | + // get the duplicate processor |
|
651 | + include_once(includeFileProcessor("processors/duplicate_plugin.processor.php",$manager_theme)); |
|
652 | + break; |
|
653 | + case 119: |
|
654 | + // get the purge processor |
|
655 | + include_once(includeFileProcessor("processors/purge_plugin.processor.php",$manager_theme)); |
|
656 | + break; |
|
657 | 657 | /********************************************************************/ |
658 | 658 | /* view phpinfo */ |
659 | 659 | /********************************************************************/ |
660 | - case 200: |
|
661 | - // show phpInfo |
|
662 | - if($modx->hasPermission('logs')) { |
|
663 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
664 | - include_once(includeFileProcessor("actions/phpinfo.static.php",$manager_theme)); |
|
665 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
666 | - } |
|
667 | - break; |
|
660 | + case 200: |
|
661 | + // show phpInfo |
|
662 | + if($modx->hasPermission('logs')) { |
|
663 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
664 | + include_once(includeFileProcessor("actions/phpinfo.static.php",$manager_theme)); |
|
665 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
666 | + } |
|
667 | + break; |
|
668 | 668 | /********************************************************************/ |
669 | 669 | /* errorpage */ |
670 | 670 | /********************************************************************/ |
671 | - case 29: |
|
672 | - // get the error page |
|
673 | - include_once(includeFileProcessor("actions/error_dialog.static.php",$manager_theme)); |
|
674 | - break; |
|
671 | + case 29: |
|
672 | + // get the error page |
|
673 | + include_once(includeFileProcessor("actions/error_dialog.static.php",$manager_theme)); |
|
674 | + break; |
|
675 | 675 | /********************************************************************/ |
676 | 676 | /* file manager */ |
677 | 677 | /********************************************************************/ |
678 | - case 31: |
|
679 | - // get the page to manage files |
|
680 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
681 | - include_once(includeFileProcessor("actions/files.dynamic.php",$manager_theme)); |
|
682 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
683 | - break; |
|
678 | + case 31: |
|
679 | + // get the page to manage files |
|
680 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
681 | + include_once(includeFileProcessor("actions/files.dynamic.php",$manager_theme)); |
|
682 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
683 | + break; |
|
684 | 684 | /********************************************************************/ |
685 | 685 | /* access permissions */ |
686 | 686 | /********************************************************************/ |
687 | - case 40: |
|
688 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
689 | - include_once(includeFileProcessor("actions/access_permissions.dynamic.php",$manager_theme)); |
|
690 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
691 | - break; |
|
692 | - case 91: |
|
693 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
694 | - include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php",$manager_theme)); |
|
695 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
696 | - break; |
|
687 | + case 40: |
|
688 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
689 | + include_once(includeFileProcessor("actions/access_permissions.dynamic.php",$manager_theme)); |
|
690 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
691 | + break; |
|
692 | + case 91: |
|
693 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
694 | + include_once(includeFileProcessor("actions/web_access_permissions.dynamic.php",$manager_theme)); |
|
695 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
696 | + break; |
|
697 | 697 | /********************************************************************/ |
698 | 698 | /* access groups processor */ |
699 | 699 | /********************************************************************/ |
700 | - case 41: |
|
701 | - include_once(includeFileProcessor("processors/access_groups.processor.php",$manager_theme)); |
|
702 | - break; |
|
703 | - case 92: |
|
704 | - include_once(includeFileProcessor("processors/web_access_groups.processor.php",$manager_theme)); |
|
705 | - break; |
|
700 | + case 41: |
|
701 | + include_once(includeFileProcessor("processors/access_groups.processor.php",$manager_theme)); |
|
702 | + break; |
|
703 | + case 92: |
|
704 | + include_once(includeFileProcessor("processors/web_access_groups.processor.php",$manager_theme)); |
|
705 | + break; |
|
706 | 706 | /********************************************************************/ |
707 | 707 | /* settings editor */ |
708 | 708 | /********************************************************************/ |
709 | - case 17: |
|
710 | - // get the settings editor |
|
711 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
712 | - include_once(includeFileProcessor("actions/mutate_settings.dynamic.php",$manager_theme)); |
|
713 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
714 | - break; |
|
715 | - case 118: |
|
716 | - // call settings ajax include |
|
717 | - ob_clean(); |
|
718 | - include_once(includeFileProcessor("includes/mutate_settings.ajax.php",$manager_theme)); |
|
719 | - break; |
|
709 | + case 17: |
|
710 | + // get the settings editor |
|
711 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
712 | + include_once(includeFileProcessor("actions/mutate_settings.dynamic.php",$manager_theme)); |
|
713 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
714 | + break; |
|
715 | + case 118: |
|
716 | + // call settings ajax include |
|
717 | + ob_clean(); |
|
718 | + include_once(includeFileProcessor("includes/mutate_settings.ajax.php",$manager_theme)); |
|
719 | + break; |
|
720 | 720 | /********************************************************************/ |
721 | 721 | /* save settings */ |
722 | 722 | /********************************************************************/ |
723 | - case 30: |
|
724 | - // get the save settings processor |
|
725 | - include_once(includeFileProcessor("processors/save_settings.processor.php",$manager_theme)); |
|
726 | - break; |
|
723 | + case 30: |
|
724 | + // get the save settings processor |
|
725 | + include_once(includeFileProcessor("processors/save_settings.processor.php",$manager_theme)); |
|
726 | + break; |
|
727 | 727 | /********************************************************************/ |
728 | 728 | /* system information */ |
729 | 729 | /********************************************************************/ |
730 | - case 53: |
|
731 | - // get the settings editor |
|
732 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
733 | - include_once(includeFileProcessor("actions/sysinfo.static.php",$manager_theme)); |
|
734 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
735 | - break; |
|
730 | + case 53: |
|
731 | + // get the settings editor |
|
732 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
733 | + include_once(includeFileProcessor("actions/sysinfo.static.php",$manager_theme)); |
|
734 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
735 | + break; |
|
736 | 736 | /********************************************************************/ |
737 | 737 | /* optimise table */ |
738 | 738 | /********************************************************************/ |
739 | - case 54: |
|
740 | - // get the table optimizer/truncate processor |
|
741 | - include_once(includeFileProcessor("processors/optimize_table.processor.php",$manager_theme)); |
|
742 | - break; |
|
739 | + case 54: |
|
740 | + // get the table optimizer/truncate processor |
|
741 | + include_once(includeFileProcessor("processors/optimize_table.processor.php",$manager_theme)); |
|
742 | + break; |
|
743 | 743 | /********************************************************************/ |
744 | 744 | /* view logging */ |
745 | 745 | /********************************************************************/ |
746 | - case 13: |
|
747 | - // view logging |
|
748 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
749 | - include_once(includeFileProcessor("actions/logging.static.php",$manager_theme)); |
|
750 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
751 | - break; |
|
746 | + case 13: |
|
747 | + // view logging |
|
748 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
749 | + include_once(includeFileProcessor("actions/logging.static.php",$manager_theme)); |
|
750 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
751 | + break; |
|
752 | 752 | /********************************************************************/ |
753 | 753 | /* empty logs */ |
754 | 754 | /********************************************************************/ |
755 | - case 55: |
|
756 | - // get the settings editor |
|
757 | - include_once(includeFileProcessor("processors/empty_table.processor.php",$manager_theme)); |
|
758 | - break; |
|
755 | + case 55: |
|
756 | + // get the settings editor |
|
757 | + include_once(includeFileProcessor("processors/empty_table.processor.php",$manager_theme)); |
|
758 | + break; |
|
759 | 759 | /********************************************************************/ |
760 | 760 | /* calls test page */ |
761 | 761 | /********************************************************************/ |
762 | - case 999: |
|
763 | - // get the test page |
|
764 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
765 | - include_once(includeFileProcessor("test_page.php",$manager_theme)); |
|
766 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
767 | - break; |
|
762 | + case 999: |
|
763 | + // get the test page |
|
764 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
765 | + include_once(includeFileProcessor("test_page.php",$manager_theme)); |
|
766 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
767 | + break; |
|
768 | 768 | /********************************************************************/ |
769 | 769 | /* Empty recycle bin */ |
770 | 770 | /********************************************************************/ |
771 | - case 64: |
|
772 | - // get the Recycle bin emptier |
|
773 | - include_once(includeFileProcessor("processors/remove_content.processor.php",$manager_theme)); |
|
774 | - break; |
|
771 | + case 64: |
|
772 | + // get the Recycle bin emptier |
|
773 | + include_once(includeFileProcessor("processors/remove_content.processor.php",$manager_theme)); |
|
774 | + break; |
|
775 | 775 | /********************************************************************/ |
776 | 776 | /* Messages */ |
777 | 777 | /********************************************************************/ |
778 | - case 10: |
|
779 | - // get the messages page |
|
780 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
781 | - include_once(includeFileProcessor("actions/messages.static.php",$manager_theme)); |
|
782 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
783 | - break; |
|
778 | + case 10: |
|
779 | + // get the messages page |
|
780 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
781 | + include_once(includeFileProcessor("actions/messages.static.php",$manager_theme)); |
|
782 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
783 | + break; |
|
784 | 784 | /********************************************************************/ |
785 | 785 | /* Delete a message */ |
786 | 786 | /********************************************************************/ |
787 | - case 65: |
|
788 | - // get the message deleter |
|
789 | - include_once(includeFileProcessor("processors/delete_message.processor.php",$manager_theme)); |
|
790 | - break; |
|
787 | + case 65: |
|
788 | + // get the message deleter |
|
789 | + include_once(includeFileProcessor("processors/delete_message.processor.php",$manager_theme)); |
|
790 | + break; |
|
791 | 791 | /********************************************************************/ |
792 | 792 | /* Send a message */ |
793 | 793 | /********************************************************************/ |
794 | - case 66: |
|
795 | - // get the message deleter |
|
796 | - include_once(includeFileProcessor("processors/send_message.processor.php",$manager_theme)); |
|
797 | - break; |
|
794 | + case 66: |
|
795 | + // get the message deleter |
|
796 | + include_once(includeFileProcessor("processors/send_message.processor.php",$manager_theme)); |
|
797 | + break; |
|
798 | 798 | /********************************************************************/ |
799 | 799 | /* Remove locks */ |
800 | 800 | /********************************************************************/ |
801 | - case 67: |
|
802 | - // get the lock remover |
|
803 | - include_once(includeFileProcessor("processors/remove_locks.processor.php",$manager_theme)); |
|
804 | - break; |
|
801 | + case 67: |
|
802 | + // get the lock remover |
|
803 | + include_once(includeFileProcessor("processors/remove_locks.processor.php",$manager_theme)); |
|
804 | + break; |
|
805 | 805 | /********************************************************************/ |
806 | 806 | /* Site schedule */ |
807 | 807 | /********************************************************************/ |
808 | - case 70: |
|
809 | - // get the schedule page |
|
810 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
811 | - include_once(includeFileProcessor("actions/site_schedule.static.php",$manager_theme)); |
|
812 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
813 | - break; |
|
808 | + case 70: |
|
809 | + // get the schedule page |
|
810 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
811 | + include_once(includeFileProcessor("actions/site_schedule.static.php",$manager_theme)); |
|
812 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
813 | + break; |
|
814 | 814 | /********************************************************************/ |
815 | 815 | /* Search */ |
816 | 816 | /********************************************************************/ |
817 | - case 71: |
|
818 | - // get the search page |
|
819 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
820 | - include_once(includeFileProcessor("actions/search.static.php",$manager_theme)); |
|
821 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
822 | - break; |
|
817 | + case 71: |
|
818 | + // get the search page |
|
819 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
820 | + include_once(includeFileProcessor("actions/search.static.php",$manager_theme)); |
|
821 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
822 | + break; |
|
823 | 823 | /********************************************************************/ |
824 | 824 | /* About */ |
825 | 825 | /********************************************************************/ |
826 | - case 59: |
|
827 | - // get the about page |
|
828 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
829 | - include_once(includeFileProcessor("actions/about.static.php",$manager_theme)); |
|
830 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
831 | - break; |
|
826 | + case 59: |
|
827 | + // get the about page |
|
828 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
829 | + include_once(includeFileProcessor("actions/about.static.php",$manager_theme)); |
|
830 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
831 | + break; |
|
832 | 832 | /********************************************************************/ |
833 | 833 | /* Add weblink */ |
834 | 834 | /********************************************************************/ |
835 | - case 72: |
|
836 | - // get the weblink page |
|
837 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
838 | - include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); |
|
839 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
840 | - break; |
|
835 | + case 72: |
|
836 | + // get the weblink page |
|
837 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
838 | + include_once(includeFileProcessor("actions/mutate_content.dynamic.php",$manager_theme)); |
|
839 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
840 | + break; |
|
841 | 841 | /********************************************************************/ |
842 | 842 | /* User management */ |
843 | 843 | /********************************************************************/ |
844 | - case 75: |
|
845 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
846 | - include_once(includeFileProcessor("actions/user_management.static.php",$manager_theme)); |
|
847 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
848 | - break; |
|
849 | - case 99: |
|
850 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
851 | - include_once(includeFileProcessor("actions/web_user_management.static.php",$manager_theme)); |
|
852 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
853 | - break; |
|
854 | - case 86: |
|
855 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
856 | - include_once(includeFileProcessor("actions/role_management.static.php",$manager_theme)); |
|
857 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
858 | - break; |
|
844 | + case 75: |
|
845 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
846 | + include_once(includeFileProcessor("actions/user_management.static.php",$manager_theme)); |
|
847 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
848 | + break; |
|
849 | + case 99: |
|
850 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
851 | + include_once(includeFileProcessor("actions/web_user_management.static.php",$manager_theme)); |
|
852 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
853 | + break; |
|
854 | + case 86: |
|
855 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
856 | + include_once(includeFileProcessor("actions/role_management.static.php",$manager_theme)); |
|
857 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
858 | + break; |
|
859 | 859 | /********************************************************************/ |
860 | 860 | /* template/ snippet management */ |
861 | 861 | /********************************************************************/ |
862 | - case 76: |
|
863 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
864 | - include_once(includeFileProcessor("actions/resources.static.php",$manager_theme)); |
|
865 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
866 | - break; |
|
862 | + case 76: |
|
863 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
864 | + include_once(includeFileProcessor("actions/resources.static.php",$manager_theme)); |
|
865 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
866 | + break; |
|
867 | 867 | /********************************************************************/ |
868 | 868 | /* Export to file */ |
869 | 869 | /********************************************************************/ |
870 | - case 83: |
|
871 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
872 | - include_once(includeFileProcessor("actions/export_site.static.php",$manager_theme)); |
|
873 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
874 | - break; |
|
870 | + case 83: |
|
871 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
872 | + include_once(includeFileProcessor("actions/export_site.static.php",$manager_theme)); |
|
873 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
874 | + break; |
|
875 | 875 | /********************************************************************/ |
876 | 876 | /* Resource Selector */ |
877 | 877 | /********************************************************************/ |
878 | - case 84: |
|
879 | - include_once(includeFileProcessor("actions/resource_selector.static.php",$manager_theme)); |
|
880 | - break; |
|
878 | + case 84: |
|
879 | + include_once(includeFileProcessor("actions/resource_selector.static.php",$manager_theme)); |
|
880 | + break; |
|
881 | 881 | /********************************************************************/ |
882 | 882 | /* Backup Manager */ |
883 | 883 | /********************************************************************/ |
884 | - case 93: |
|
885 | - # header and footer will be handled interally |
|
886 | - include_once(includeFileProcessor("actions/bkmanager.static.php",$manager_theme)); |
|
887 | - break; |
|
884 | + case 93: |
|
885 | + # header and footer will be handled interally |
|
886 | + include_once(includeFileProcessor("actions/bkmanager.static.php",$manager_theme)); |
|
887 | + break; |
|
888 | 888 | /********************************************************************/ |
889 | 889 | /* Duplicate Document */ |
890 | 890 | /********************************************************************/ |
891 | - case 94: |
|
892 | - // get the duplicate processor |
|
893 | - include_once(includeFileProcessor("processors/duplicate_content.processor.php",$manager_theme)); |
|
894 | - break; |
|
891 | + case 94: |
|
892 | + // get the duplicate processor |
|
893 | + include_once(includeFileProcessor("processors/duplicate_content.processor.php",$manager_theme)); |
|
894 | + break; |
|
895 | 895 | /********************************************************************/ |
896 | 896 | /* Import Document from file */ |
897 | 897 | /********************************************************************/ |
898 | - case 95: |
|
899 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
900 | - include_once(includeFileProcessor("actions/import_site.static.php",$manager_theme)); |
|
901 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
902 | - break; |
|
898 | + case 95: |
|
899 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
900 | + include_once(includeFileProcessor("actions/import_site.static.php",$manager_theme)); |
|
901 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
902 | + break; |
|
903 | 903 | /********************************************************************/ |
904 | 904 | /* Help */ |
905 | 905 | /********************************************************************/ |
906 | - case 9: |
|
907 | - // get the help page |
|
908 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
909 | - include_once(includeFileProcessor("actions/help.static.php",$manager_theme)); |
|
910 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
911 | - break; |
|
906 | + case 9: |
|
907 | + // get the help page |
|
908 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
909 | + include_once(includeFileProcessor("actions/help.static.php",$manager_theme)); |
|
910 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
911 | + break; |
|
912 | 912 | /********************************************************************/ |
913 | 913 | /* Template Variables - Based on Apodigm's Docvars */ |
914 | 914 | /********************************************************************/ |
915 | - case 300: |
|
916 | - // get the new document variable action |
|
917 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
918 | - include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme)); |
|
919 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
920 | - break; |
|
921 | - case 301: |
|
922 | - // get the edit document variable action |
|
923 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
924 | - include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme)); |
|
925 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
926 | - break; |
|
927 | - case 302: |
|
928 | - // get the save processor |
|
929 | - include_once(includeFileProcessor("processors/save_tmplvars.processor.php",$manager_theme)); |
|
930 | - break; |
|
931 | - case 303: |
|
932 | - // get the delete processor |
|
933 | - include_once(includeFileProcessor("processors/delete_tmplvars.processor.php",$manager_theme)); |
|
934 | - break; |
|
935 | - case 304: |
|
936 | - // get the duplicate processor |
|
937 | - include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php",$manager_theme)); |
|
938 | - break; |
|
939 | - case 305: |
|
940 | - // get the tv-rank action |
|
941 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
942 | - include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php",$manager_theme)); |
|
943 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
944 | - break; |
|
915 | + case 300: |
|
916 | + // get the new document variable action |
|
917 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
918 | + include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme)); |
|
919 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
920 | + break; |
|
921 | + case 301: |
|
922 | + // get the edit document variable action |
|
923 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
924 | + include_once(includeFileProcessor("actions/mutate_tmplvars.dynamic.php",$manager_theme)); |
|
925 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
926 | + break; |
|
927 | + case 302: |
|
928 | + // get the save processor |
|
929 | + include_once(includeFileProcessor("processors/save_tmplvars.processor.php",$manager_theme)); |
|
930 | + break; |
|
931 | + case 303: |
|
932 | + // get the delete processor |
|
933 | + include_once(includeFileProcessor("processors/delete_tmplvars.processor.php",$manager_theme)); |
|
934 | + break; |
|
935 | + case 304: |
|
936 | + // get the duplicate processor |
|
937 | + include_once(includeFileProcessor("processors/duplicate_tmplvars.processor.php",$manager_theme)); |
|
938 | + break; |
|
939 | + case 305: |
|
940 | + // get the tv-rank action |
|
941 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
942 | + include_once(includeFileProcessor("actions/mutate_tv_rank.dynamic.php",$manager_theme)); |
|
943 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
944 | + break; |
|
945 | 945 | /********************************************************************/ |
946 | 946 | /* Event viewer: show event message log */ |
947 | 947 | /********************************************************************/ |
948 | - case 114: |
|
949 | - // get event logs |
|
950 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
951 | - include_once(includeFileProcessor("actions/eventlog.dynamic.php",$manager_theme)); |
|
952 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
953 | - break; |
|
954 | - case 115: |
|
955 | - // get event log details viewer |
|
956 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
957 | - include_once(includeFileProcessor("actions/eventlog_details.dynamic.php",$manager_theme)); |
|
958 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
959 | - break; |
|
960 | - case 116: |
|
961 | - // get the event log delete processor |
|
962 | - include_once(includeFileProcessor("processors/delete_eventlog.processor.php",$manager_theme)); |
|
963 | - break; |
|
964 | - |
|
965 | - case 501: |
|
966 | - //delete category |
|
967 | - include_once(includeFileProcessor("processors/delete_category.processor.php",$manager_theme)); |
|
968 | - break; |
|
948 | + case 114: |
|
949 | + // get event logs |
|
950 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
951 | + include_once(includeFileProcessor("actions/eventlog.dynamic.php",$manager_theme)); |
|
952 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
953 | + break; |
|
954 | + case 115: |
|
955 | + // get event log details viewer |
|
956 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
957 | + include_once(includeFileProcessor("actions/eventlog_details.dynamic.php",$manager_theme)); |
|
958 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
959 | + break; |
|
960 | + case 116: |
|
961 | + // get the event log delete processor |
|
962 | + include_once(includeFileProcessor("processors/delete_eventlog.processor.php",$manager_theme)); |
|
963 | + break; |
|
964 | + |
|
965 | + case 501: |
|
966 | + //delete category |
|
967 | + include_once(includeFileProcessor("processors/delete_category.processor.php",$manager_theme)); |
|
968 | + break; |
|
969 | 969 | /********************************************************************/ |
970 | 970 | /* default action: show not implemented message */ |
971 | 971 | /********************************************************************/ |
972 | - default : |
|
973 | - // say that what was requested doesn't do anything yet |
|
974 | - include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
975 | - echo " |
|
972 | + default : |
|
973 | + // say that what was requested doesn't do anything yet |
|
974 | + include_once(includeFileProcessor("includes/header.inc.php",$manager_theme)); |
|
975 | + echo " |
|
976 | 976 | <div class='sectionHeader'>".$_lang['functionnotimpl']."</div> |
977 | 977 | <div class='sectionBody'> |
978 | 978 | <p>".$_lang['functionnotimpl_message']."</p> |
979 | 979 | </div> |
980 | 980 | "; |
981 | - include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
981 | + include_once(includeFileProcessor("includes/footer.inc.php",$manager_theme)); |
|
982 | 982 | } |
983 | 983 | |
984 | 984 | /********************************************************************/ |
985 | 985 | // log action, unless it's a frame request |
986 | 986 | if($action!=1 && $action!=7 && $action!=2) { |
987 | - include_once "log.class.inc.php"; |
|
988 | - $log = new logHandler; |
|
989 | - $log->initAndWriteLog(); |
|
987 | + include_once "log.class.inc.php"; |
|
988 | + $log = new logHandler; |
|
989 | + $log->initAndWriteLog(); |
|
990 | 990 | } |
991 | 991 | /********************************************************************/ |
992 | 992 | // show debug |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.'); |
|
3 | + die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.'); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
7 | 7 | |
8 | 8 | if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
9 | - // seems to be a new install - send the user to the configuration page |
|
10 | - exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>'); |
|
9 | + // seems to be a new install - send the user to the configuration page |
|
10 | + exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>'); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | // set placeholders |
@@ -17,70 +17,70 @@ discard block |
||
17 | 17 | |
18 | 18 | // setup message info |
19 | 19 | if($modx->hasPermission('messages')) { |
20 | - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
21 | - $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
|
22 | - $_SESSION['nrnewmessages'] = $nrnewmessages; |
|
23 | - |
|
24 | - $msg = array(); |
|
25 | - $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']); |
|
26 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : ''; |
|
27 | - $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold"> <a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages); |
|
28 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0'; |
|
29 | - $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
|
30 | - $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages); |
|
31 | - $ph['MessageInfo'] = implode("\n", $msg); |
|
20 | + include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
21 | + $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
|
22 | + $_SESSION['nrnewmessages'] = $nrnewmessages; |
|
23 | + |
|
24 | + $msg = array(); |
|
25 | + $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']); |
|
26 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : ''; |
|
27 | + $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold"> <a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages); |
|
28 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0'; |
|
29 | + $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
|
30 | + $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages); |
|
31 | + $ph['MessageInfo'] = implode("\n", $msg); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | // setup icons |
35 | 35 | if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
36 | - $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
|
37 | - $ph['SecurityIcon'] = wrapIcon($icon, 75); |
|
36 | + $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
|
37 | + $ph['SecurityIcon'] = wrapIcon($icon, 75); |
|
38 | 38 | } |
39 | 39 | if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
40 | - $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
|
41 | - $ph['WebUserIcon'] = wrapIcon($icon, 99); |
|
40 | + $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
|
41 | + $ph['WebUserIcon'] = wrapIcon($icon, 99); |
|
42 | 42 | } |
43 | 43 | if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
44 | - $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
|
45 | - $ph['ModulesIcon'] = wrapIcon($icon, 106); |
|
44 | + $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
|
45 | + $ph['ModulesIcon'] = wrapIcon($icon, 106); |
|
46 | 46 | } |
47 | 47 | if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { |
48 | - $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
|
49 | - $ph['ResourcesIcon'] = wrapIcon($icon, 76); |
|
48 | + $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
|
49 | + $ph['ResourcesIcon'] = wrapIcon($icon, 76); |
|
50 | 50 | } |
51 | 51 | if($modx->hasPermission('bk_manager')) { |
52 | - $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
|
53 | - $ph['BackupIcon'] = wrapIcon($icon, 93); |
|
52 | + $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
|
53 | + $ph['BackupIcon'] = wrapIcon($icon, 93); |
|
54 | 54 | } |
55 | 55 | if($modx->hasPermission('help')) { |
56 | - $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
|
57 | - $ph['HelpIcon'] = wrapIcon($icon, 9); |
|
56 | + $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
|
57 | + $ph['HelpIcon'] = wrapIcon($icon, 9); |
|
58 | 58 | } |
59 | 59 | // do some config checks |
60 | 60 | if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
61 | - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
62 | - if($config_check_results != $_lang['configcheck_ok']) { |
|
63 | - $ph['config_check_results'] = $config_check_results; |
|
64 | - $ph['config_display'] = 'block'; |
|
65 | - } else { |
|
66 | - $ph['config_display'] = 'none'; |
|
67 | - } |
|
61 | + include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
62 | + if($config_check_results != $_lang['configcheck_ok']) { |
|
63 | + $ph['config_check_results'] = $config_check_results; |
|
64 | + $ph['config_display'] = 'block'; |
|
65 | + } else { |
|
66 | + $ph['config_display'] = 'none'; |
|
67 | + } |
|
68 | 68 | } else { |
69 | - $ph['config_display'] = 'none'; |
|
69 | + $ph['config_display'] = 'none'; |
|
70 | 70 | } |
71 | 71 | |
72 | 72 | // Check logout-reminder |
73 | 73 | if(isset($_SESSION['show_logout_reminder'])) { |
74 | - switch($_SESSION['show_logout_reminder']['type']) { |
|
75 | - case 'logout_reminder': |
|
76 | - $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
|
77 | - $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
|
78 | - break; |
|
79 | - } |
|
80 | - $ph['show_logout_reminder'] = 'block'; |
|
81 | - unset($_SESSION['show_logout_reminder']); |
|
74 | + switch($_SESSION['show_logout_reminder']['type']) { |
|
75 | + case 'logout_reminder': |
|
76 | + $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
|
77 | + $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
|
78 | + break; |
|
79 | + } |
|
80 | + $ph['show_logout_reminder'] = 'block'; |
|
81 | + unset($_SESSION['show_logout_reminder']); |
|
82 | 82 | } else { |
83 | - $ph['show_logout_reminder'] = 'none'; |
|
83 | + $ph['show_logout_reminder'] = 'none'; |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | // Check multiple sessions |
@@ -128,11 +128,11 @@ discard block |
||
128 | 128 | $nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>'; |
129 | 129 | |
130 | 130 | $ph['UserInfo'] = $modx->parseText($tpl, array( |
131 | - 'username' => $modx->getLoginUserName(), |
|
132 | - 'role' => $_SESSION['mgrPermissions']['name'], |
|
133 | - 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), |
|
134 | - 'logincount' => $_SESSION['mgrLogincount'] + 1, |
|
135 | - 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) |
|
131 | + 'username' => $modx->getLoginUserName(), |
|
132 | + 'role' => $_SESSION['mgrPermissions']['name'], |
|
133 | + 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), |
|
134 | + 'logincount' => $_SESSION['mgrLogincount'] + 1, |
|
135 | + 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) |
|
136 | 136 | )); |
137 | 137 | |
138 | 138 | $from = array(); |
@@ -141,13 +141,13 @@ discard block |
||
141 | 141 | $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC'); |
142 | 142 | |
143 | 143 | if($modx->db->getRecordCount($rs) < 1) { |
144 | - $html = '<p>[%no_active_users_found%]</p>'; |
|
144 | + $html = '<p>[%no_active_users_found%]</p>'; |
|
145 | 145 | } else { |
146 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
147 | - $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
|
148 | - $ph['now'] = strftime('%H:%M:%S', $now); |
|
149 | - $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
|
150 | - $html = ' |
|
146 | + include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
147 | + $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
|
148 | + $ph['now'] = strftime('%H:%M:%S', $now); |
|
149 | + $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
|
150 | + $html = ' |
|
151 | 151 | <div class="card-body"> |
152 | 152 | [%onlineusers_message%] |
153 | 153 | <b>[+now+]</b>): |
@@ -165,33 +165,33 @@ discard block |
||
165 | 165 | </thead> |
166 | 166 | <tbody>'; |
167 | 167 | |
168 | - $userList = array(); |
|
169 | - $userCount = array(); |
|
170 | - // Create userlist with session-count first before output |
|
171 | - while($activeusers = $modx->db->getRow($rs)) { |
|
172 | - $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
|
173 | - |
|
174 | - $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
|
175 | - $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" /> ' : ''; |
|
176 | - $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; |
|
177 | - $currentaction = getAction($activeusers['action'], $activeusers['id']); |
|
178 | - $userList[] = array( |
|
179 | - $idle, |
|
180 | - '', |
|
181 | - $activeusers['username'], |
|
182 | - $webicon, |
|
183 | - abs($activeusers['internalKey']), |
|
184 | - $ip, |
|
185 | - strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), |
|
186 | - $currentaction |
|
187 | - ); |
|
188 | - } |
|
189 | - foreach($userList as $params) { |
|
190 | - $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
|
191 | - $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params); |
|
192 | - } |
|
193 | - |
|
194 | - $html .= ' |
|
168 | + $userList = array(); |
|
169 | + $userCount = array(); |
|
170 | + // Create userlist with session-count first before output |
|
171 | + while($activeusers = $modx->db->getRow($rs)) { |
|
172 | + $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
|
173 | + |
|
174 | + $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
|
175 | + $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" /> ' : ''; |
|
176 | + $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; |
|
177 | + $currentaction = getAction($activeusers['action'], $activeusers['id']); |
|
178 | + $userList[] = array( |
|
179 | + $idle, |
|
180 | + '', |
|
181 | + $activeusers['username'], |
|
182 | + $webicon, |
|
183 | + abs($activeusers['internalKey']), |
|
184 | + $ip, |
|
185 | + strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), |
|
186 | + $currentaction |
|
187 | + ); |
|
188 | + } |
|
189 | + foreach($userList as $params) { |
|
190 | + $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
|
191 | + $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params); |
|
192 | + } |
|
193 | + |
|
194 | + $html .= ' |
|
195 | 195 | </tbody> |
196 | 196 | </table> |
197 | 197 | </div> |
@@ -232,17 +232,17 @@ discard block |
||
232 | 232 | // invoke event OnManagerWelcomePrerender |
233 | 233 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); |
234 | 234 | if(is_array($evtOut)) { |
235 | - $output = implode('', $evtOut); |
|
236 | - $ph['OnManagerWelcomePrerender'] = $output; |
|
235 | + $output = implode('', $evtOut); |
|
236 | + $ph['OnManagerWelcomePrerender'] = $output; |
|
237 | 237 | } |
238 | 238 | |
239 | 239 | $widgets['welcome'] = array( |
240 | - 'menuindex' => '10', |
|
241 | - 'id' => 'welcome', |
|
242 | - 'cols' => 'col-sm-6', |
|
243 | - 'icon' => 'fa-home', |
|
244 | - 'title' => '[%welcome_title%]', |
|
245 | - 'body' => ' |
|
240 | + 'menuindex' => '10', |
|
241 | + 'id' => 'welcome', |
|
242 | + 'cols' => 'col-sm-6', |
|
243 | + 'icon' => 'fa-home', |
|
244 | + 'title' => '[%welcome_title%]', |
|
245 | + 'body' => ' |
|
246 | 246 | <div class="wm_buttons card-body"> |
247 | 247 | <!--@IF:[[#hasPermission?key=new_user]] OR [[#hasPermission?key=edit_user]]--> |
248 | 248 | <span class="wm_button"> |
@@ -320,25 +320,25 @@ discard block |
||
320 | 320 | </table> |
321 | 321 | </div> |
322 | 322 | ', |
323 | - 'hide'=>'0' |
|
323 | + 'hide'=>'0' |
|
324 | 324 | ); |
325 | 325 | $widgets['onlineinfo'] = array( |
326 | - 'menuindex' => '20', |
|
327 | - 'id' => 'onlineinfo', |
|
328 | - 'cols' => 'col-sm-6', |
|
329 | - 'icon' => 'fa-user', |
|
330 | - 'title' => '[%onlineusers_title%]', |
|
331 | - 'body' => '<div class="userstable">[+OnlineInfo+]</div>', |
|
332 | - 'hide'=>'0' |
|
326 | + 'menuindex' => '20', |
|
327 | + 'id' => 'onlineinfo', |
|
328 | + 'cols' => 'col-sm-6', |
|
329 | + 'icon' => 'fa-user', |
|
330 | + 'title' => '[%onlineusers_title%]', |
|
331 | + 'body' => '<div class="userstable">[+OnlineInfo+]</div>', |
|
332 | + 'hide'=>'0' |
|
333 | 333 | ); |
334 | 334 | $widgets['recentinfo'] = array( |
335 | - 'menuindex' => '30', |
|
336 | - 'id' => 'modxrecent_widget', |
|
337 | - 'cols' => 'col-sm-12', |
|
338 | - 'icon' => 'fa-pencil-square-o', |
|
339 | - 'title' => '[%activity_title%]', |
|
340 | - 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
|
341 | - 'hide'=>'0' |
|
335 | + 'menuindex' => '30', |
|
336 | + 'id' => 'modxrecent_widget', |
|
337 | + 'cols' => 'col-sm-12', |
|
338 | + 'icon' => 'fa-pencil-square-o', |
|
339 | + 'title' => '[%activity_title%]', |
|
340 | + 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
|
341 | + 'hide'=>'0' |
|
342 | 342 | ); |
343 | 343 | if ($modx->config['rss_url_news']) { |
344 | 344 | $widgets['news'] = array( |
@@ -366,7 +366,7 @@ discard block |
||
366 | 366 | // invoke OnManagerWelcomeHome event |
367 | 367 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); |
368 | 368 | if(is_array($sitewidgets)) { |
369 | - $newwidgets = array(); |
|
369 | + $newwidgets = array(); |
|
370 | 370 | foreach($sitewidgets as $widget){ |
371 | 371 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
372 | 372 | } |
@@ -374,21 +374,21 @@ discard block |
||
374 | 374 | } |
375 | 375 | |
376 | 376 | usort($widgets, function ($a, $b) { |
377 | - return $a['menuindex'] - $b['menuindex']; |
|
377 | + return $a['menuindex'] - $b['menuindex']; |
|
378 | 378 | }); |
379 | 379 | |
380 | 380 | $tpl = getTplWidget(); |
381 | 381 | $output = ''; |
382 | 382 | foreach($widgets as $widget) { |
383 | - if ($widget['hide'] != '1'){ |
|
384 | - $output .= $modx->parseText($tpl, $widget); |
|
385 | - } |
|
383 | + if ($widget['hide'] != '1'){ |
|
384 | + $output .= $modx->parseText($tpl, $widget); |
|
385 | + } |
|
386 | 386 | } |
387 | 387 | $ph['widgets'] = $output; |
388 | 388 | |
389 | 389 | // load template |
390 | 390 | if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
391 | - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
391 | + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | $target = $modx->config['manager_welcome_tpl']; |
@@ -396,27 +396,27 @@ discard block |
||
396 | 396 | $target = $modx->mergeSettingsContent($target); |
397 | 397 | |
398 | 398 | if(substr($target, 0, 1) === '@') { |
399 | - if(substr($target, 0, 6) === '@CHUNK') { |
|
400 | - $content = $modx->getChunk(trim(substr($target, 7))); |
|
401 | - } elseif(substr($target, 0, 5) === '@FILE') { |
|
402 | - $content = file_get_contents(trim(substr($target, 6))); |
|
403 | - } else { |
|
404 | - $content = ''; |
|
405 | - } |
|
399 | + if(substr($target, 0, 6) === '@CHUNK') { |
|
400 | + $content = $modx->getChunk(trim(substr($target, 7))); |
|
401 | + } elseif(substr($target, 0, 5) === '@FILE') { |
|
402 | + $content = file_get_contents(trim(substr($target, 6))); |
|
403 | + } else { |
|
404 | + $content = ''; |
|
405 | + } |
|
406 | 406 | } else { |
407 | - $chunk = $modx->getChunk($target); |
|
408 | - if($chunk !== false && !empty($chunk)) { |
|
409 | - $content = $chunk; |
|
410 | - } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
411 | - $content = file_get_contents(MODX_BASE_PATH . $target); |
|
412 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
413 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
414 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
415 | - { |
|
416 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
417 | - } else { |
|
418 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
419 | - } |
|
407 | + $chunk = $modx->getChunk($target); |
|
408 | + if($chunk !== false && !empty($chunk)) { |
|
409 | + $content = $chunk; |
|
410 | + } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
411 | + $content = file_get_contents(MODX_BASE_PATH . $target); |
|
412 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
413 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
414 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
415 | + { |
|
416 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
417 | + } else { |
|
418 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
419 | + } |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | // merge placeholders |
@@ -424,8 +424,8 @@ discard block |
||
424 | 424 | $content = $modx->mergeSettingsContent($content); |
425 | 425 | $content = $modx->parseText($content, $ph); |
426 | 426 | if(strpos($content, '[+') !== false) { |
427 | - $modx->toPlaceholders($ph); |
|
428 | - $content = $modx->mergePlaceholderContent($content); |
|
427 | + $modx->toPlaceholders($ph); |
|
428 | + $content = $modx->mergePlaceholderContent($content); |
|
429 | 429 | } |
430 | 430 | $content = $modx->parseDocumentSource($content); |
431 | 431 | $content = $modx->parseText($content, $_lang, '[%', '%]'); |
@@ -433,7 +433,7 @@ discard block |
||
433 | 433 | $content = $modx->cleanUpMODXTags($content); //cleanup |
434 | 434 | |
435 | 435 | if($js = $modx->getRegisteredClientScripts()) { |
436 | - $content .= $js; |
|
436 | + $content .= $js; |
|
437 | 437 | } |
438 | 438 | |
439 | 439 | echo $content; |
@@ -443,7 +443,7 @@ discard block |
||
443 | 443 | // <a href="javascript:;" class="closed"><i class="fa fa-close"></i></a> |
444 | 444 | //</span> |
445 | 445 | function getTplWidget() { // recent document info |
446 | - return ' |
|
446 | + return ' |
|
447 | 447 | <div class="[+cols+]" id="[+id+]"> |
448 | 448 | <div class="card"[+cardAttr+]> |
449 | 449 | <div class="card-header"[+headAttr+]> <i class="fa [+icon+]"></i> [+title+] </div> |
@@ -454,11 +454,11 @@ discard block |
||
454 | 454 | } |
455 | 455 | |
456 | 456 | function getRecentInfo() { // recent document info |
457 | - global $modx; |
|
457 | + global $modx; |
|
458 | 458 | |
459 | - $modx->addSnippet('recentInfoList', 'getRecentInfoList'); |
|
459 | + $modx->addSnippet('recentInfoList', 'getRecentInfoList'); |
|
460 | 460 | |
461 | - $html = ' |
|
461 | + $html = ' |
|
462 | 462 | <div class="table-responsive"> |
463 | 463 | <table class="table data"> |
464 | 464 | <thead> |
@@ -476,96 +476,96 @@ discard block |
||
476 | 476 | </table> |
477 | 477 | </div> |
478 | 478 | '; |
479 | - return $html; |
|
479 | + return $html; |
|
480 | 480 | } |
481 | 481 | |
482 | 482 | function getRecentInfoList() { |
483 | - global $modx; |
|
484 | - |
|
485 | - $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); |
|
486 | - |
|
487 | - if($modx->db->getRecordCount($rs) < 1) { |
|
488 | - return '<tr><td>[%no_activity_message%]</td></tr>'; |
|
489 | - } |
|
490 | - |
|
491 | - $tpl = getRecentInfoRowTpl(); |
|
492 | - |
|
493 | - $btntpl['edit'] = '<a title="[%edit_resource%]" href="index.php?a=27&id=[+id+]" target="main"><i class="fa fa-edit fa-fw"></i></a> '; |
|
494 | - $btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> '; |
|
495 | - |
|
496 | - $output = array(); |
|
497 | - while($ph = $modx->db->getRow($rs)) { |
|
498 | - $docid = $ph['id']; |
|
499 | - $_ = $modx->getUserInfo($ph['editedby']); |
|
500 | - $ph['username'] = $_['username']; |
|
501 | - |
|
502 | - if($ph['deleted'] == 1) { |
|
503 | - $ph['status'] = 'deleted text-danger'; |
|
504 | - } elseif($ph['published'] == 0) { |
|
505 | - $ph['status'] = 'unpublished font-italic text-muted'; |
|
506 | - } else { |
|
507 | - $ph['status'] = 'published'; |
|
508 | - } |
|
509 | - |
|
510 | - if($modx->hasPermission('edit_document')) { |
|
511 | - $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); |
|
512 | - } else { |
|
513 | - $ph['edit_btn'] = ''; |
|
514 | - } |
|
515 | - |
|
516 | - $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; |
|
517 | - $ph['preview_btn'] = str_replace(array( |
|
518 | - '[+id+]', |
|
519 | - '[+preview_disabled+]' |
|
520 | - ), array( |
|
521 | - $docid, |
|
522 | - $preview_disabled |
|
523 | - ), $btntpl['preview_btn']); |
|
524 | - |
|
525 | - if($modx->hasPermission('delete_document')) { |
|
526 | - if($ph['deleted'] == 0) { |
|
527 | - $delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> '; |
|
528 | - } else { |
|
529 | - $delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> '; |
|
530 | - } |
|
531 | - $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); |
|
532 | - } else { |
|
533 | - $ph['delete_btn'] = ''; |
|
534 | - } |
|
535 | - |
|
536 | - if($ph['deleted'] == 1 && $ph['published'] == 0) { |
|
537 | - $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
|
538 | - } elseif($ph['deleted'] == 1 && $ph['published'] == 1) { |
|
539 | - $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
|
540 | - } elseif($ph['deleted'] == 0 && $ph['published'] == 0) { |
|
541 | - $publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
|
542 | - } else { |
|
543 | - $publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
|
544 | - } |
|
545 | - $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); |
|
546 | - |
|
547 | - $ph['info_btn'] = str_replace('[+id+]', $docid, '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"><i class="fa fa-info fa-fw"></i></a>'); |
|
548 | - |
|
549 | - if($ph['longtitle'] == '') { |
|
550 | - $ph['longtitle'] = '(<i>[%not_set%]</i>)'; |
|
551 | - } |
|
552 | - if($ph['description'] == '') { |
|
553 | - $ph['description'] = '(<i>[%not_set%]</i>)'; |
|
554 | - } |
|
555 | - if($ph['introtext'] == '') { |
|
556 | - $ph['introtext'] = '(<i>[%not_set%]</i>)'; |
|
557 | - } |
|
558 | - if($ph['alias'] == '') { |
|
559 | - $ph['alias'] = '(<i>[%not_set%]</i>)'; |
|
560 | - } |
|
561 | - |
|
562 | - $output[] = $modx->parseText($tpl, $ph); |
|
563 | - } |
|
564 | - return implode("\n", $output); |
|
483 | + global $modx; |
|
484 | + |
|
485 | + $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); |
|
486 | + |
|
487 | + if($modx->db->getRecordCount($rs) < 1) { |
|
488 | + return '<tr><td>[%no_activity_message%]</td></tr>'; |
|
489 | + } |
|
490 | + |
|
491 | + $tpl = getRecentInfoRowTpl(); |
|
492 | + |
|
493 | + $btntpl['edit'] = '<a title="[%edit_resource%]" href="index.php?a=27&id=[+id+]" target="main"><i class="fa fa-edit fa-fw"></i></a> '; |
|
494 | + $btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> '; |
|
495 | + |
|
496 | + $output = array(); |
|
497 | + while($ph = $modx->db->getRow($rs)) { |
|
498 | + $docid = $ph['id']; |
|
499 | + $_ = $modx->getUserInfo($ph['editedby']); |
|
500 | + $ph['username'] = $_['username']; |
|
501 | + |
|
502 | + if($ph['deleted'] == 1) { |
|
503 | + $ph['status'] = 'deleted text-danger'; |
|
504 | + } elseif($ph['published'] == 0) { |
|
505 | + $ph['status'] = 'unpublished font-italic text-muted'; |
|
506 | + } else { |
|
507 | + $ph['status'] = 'published'; |
|
508 | + } |
|
509 | + |
|
510 | + if($modx->hasPermission('edit_document')) { |
|
511 | + $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); |
|
512 | + } else { |
|
513 | + $ph['edit_btn'] = ''; |
|
514 | + } |
|
515 | + |
|
516 | + $preview_disabled = ($ph['deleted'] == 1) ? 'disabled' : ''; |
|
517 | + $ph['preview_btn'] = str_replace(array( |
|
518 | + '[+id+]', |
|
519 | + '[+preview_disabled+]' |
|
520 | + ), array( |
|
521 | + $docid, |
|
522 | + $preview_disabled |
|
523 | + ), $btntpl['preview_btn']); |
|
524 | + |
|
525 | + if($modx->hasPermission('delete_document')) { |
|
526 | + if($ph['deleted'] == 0) { |
|
527 | + $delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> '; |
|
528 | + } else { |
|
529 | + $delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> '; |
|
530 | + } |
|
531 | + $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); |
|
532 | + } else { |
|
533 | + $ph['delete_btn'] = ''; |
|
534 | + } |
|
535 | + |
|
536 | + if($ph['deleted'] == 1 && $ph['published'] == 0) { |
|
537 | + $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
|
538 | + } elseif($ph['deleted'] == 1 && $ph['published'] == 1) { |
|
539 | + $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
|
540 | + } elseif($ph['deleted'] == 0 && $ph['published'] == 0) { |
|
541 | + $publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
|
542 | + } else { |
|
543 | + $publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
|
544 | + } |
|
545 | + $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); |
|
546 | + |
|
547 | + $ph['info_btn'] = str_replace('[+id+]', $docid, '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"><i class="fa fa-info fa-fw"></i></a>'); |
|
548 | + |
|
549 | + if($ph['longtitle'] == '') { |
|
550 | + $ph['longtitle'] = '(<i>[%not_set%]</i>)'; |
|
551 | + } |
|
552 | + if($ph['description'] == '') { |
|
553 | + $ph['description'] = '(<i>[%not_set%]</i>)'; |
|
554 | + } |
|
555 | + if($ph['introtext'] == '') { |
|
556 | + $ph['introtext'] = '(<i>[%not_set%]</i>)'; |
|
557 | + } |
|
558 | + if($ph['alias'] == '') { |
|
559 | + $ph['alias'] = '(<i>[%not_set%]</i>)'; |
|
560 | + } |
|
561 | + |
|
562 | + $output[] = $modx->parseText($tpl, $ph); |
|
563 | + } |
|
564 | + return implode("\n", $output); |
|
565 | 565 | } |
566 | 566 | |
567 | 567 | function getRecentInfoRowTpl() { |
568 | - $tpl = ' |
|
568 | + $tpl = ' |
|
569 | 569 | <tr> |
570 | 570 | <td data-toggle="collapse" data-target=".collapse[+id+]" class="text-right"><span class="label label-info">[+id+]</span></td> |
571 | 571 | <td data-toggle="collapse" data-target=".collapse[+id+]"><a class="[+status+]" title="[%edit_resource%]" href="index.php?a=3&id=[+id+]" target="main">[+pagetitle+]</a></td> |
@@ -589,16 +589,16 @@ discard block |
||
589 | 589 | </div> |
590 | 590 | </td> |
591 | 591 | </tr>'; |
592 | - return $tpl; |
|
592 | + return $tpl; |
|
593 | 593 | } |
594 | 594 | |
595 | 595 | // setup icons |
596 | 596 | function wrapIcon($i, $action) { |
597 | - return sprintf('<a href="index.php?a=%s" target="main"><span class="wm_button" style="border:0">%s</span></a>', $action, $i); |
|
597 | + return sprintf('<a href="index.php?a=%s" target="main"><span class="wm_button" style="border:0">%s</span></a>', $action, $i); |
|
598 | 598 | } |
599 | 599 | |
600 | 600 | function getStartUpScript() { |
601 | - $script = ' |
|
601 | + $script = ' |
|
602 | 602 | <script type="text/javascript"> |
603 | 603 | function hideConfigCheckWarning(key) { |
604 | 604 | var xhr = new XMLHttpRequest(); |
@@ -622,5 +622,5 @@ discard block |
||
622 | 622 | })(jQuery); |
623 | 623 | </script> |
624 | 624 | '; |
625 | - return $script; |
|
625 | + return $script; |
|
626 | 626 | } |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | $tpl = array( |
7 | - 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), |
|
8 | - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
9 | - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
10 | - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
11 | - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') |
|
7 | + 'viewForm' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_viewForm.tpl'), |
|
8 | + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
9 | + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
10 | + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
11 | + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl') |
|
12 | 12 | ); |
13 | 13 | |
14 | 14 | /** |
@@ -17,9 +17,9 @@ discard block |
||
17 | 17 | * @return string |
18 | 18 | */ |
19 | 19 | function parsePh($tpl, $ph) { |
20 | - global $modx, $_lang; |
|
21 | - $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
22 | - return $modx->parseText($tpl, $ph); |
|
20 | + global $modx, $_lang; |
|
21 | + $tpl = $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
22 | + return $modx->parseText($tpl, $ph); |
|
23 | 23 | } |
24 | 24 | |
25 | 25 | /** |
@@ -27,11 +27,11 @@ discard block |
||
27 | 27 | * @return string |
28 | 28 | */ |
29 | 29 | function renderViewSwitchButtons($cssId) { |
30 | - global $modx, $_lang, $tpl; |
|
30 | + global $modx, $_lang, $tpl; |
|
31 | 31 | |
32 | - return parsePh($tpl['viewForm'], array( |
|
33 | - 'cssId' => $cssId |
|
34 | - )); |
|
32 | + return parsePh($tpl['viewForm'], array( |
|
33 | + 'cssId' => $cssId |
|
34 | + )); |
|
35 | 35 | } |
36 | 36 | |
37 | 37 | /** |
@@ -40,52 +40,52 @@ discard block |
||
40 | 40 | * @return string |
41 | 41 | */ |
42 | 42 | function createResourceList($resourceTable, $resources) { |
43 | - global $modx, $_lang, $_style, $modx_textdir, $tpl; |
|
43 | + global $modx, $_lang, $_style, $modx_textdir, $tpl; |
|
44 | 44 | |
45 | - $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; |
|
45 | + $items = isset($resources->items[$resourceTable]) ? $resources->items[$resourceTable] : false; |
|
46 | 46 | |
47 | - if( ! is_array($items) || empty($items)) { |
|
48 | - return $_lang['no_results']; |
|
49 | - } |
|
47 | + if( ! is_array($items) || empty($items)) { |
|
48 | + return $_lang['no_results']; |
|
49 | + } |
|
50 | 50 | |
51 | - // Prepare elements- and categories-list |
|
52 | - $elements = array(); |
|
53 | - $categories = array(); |
|
54 | - foreach($items as $row) { |
|
55 | - $catid = $row['catid'] ? $row['catid'] : 0; |
|
56 | - $categories[$catid] = array('name' => stripslashes($row['category'])); |
|
57 | - $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); |
|
58 | - } |
|
51 | + // Prepare elements- and categories-list |
|
52 | + $elements = array(); |
|
53 | + $categories = array(); |
|
54 | + foreach($items as $row) { |
|
55 | + $catid = $row['catid'] ? $row['catid'] : 0; |
|
56 | + $categories[$catid] = array('name' => stripslashes($row['category'])); |
|
57 | + $elements[$catid][] = prepareElementRowPh($row, $resourceTable, $resources); |
|
58 | + } |
|
59 | 59 | |
60 | - // Now render categories / panel-collapse |
|
61 | - $panelGroup = ''; |
|
62 | - foreach($elements as $catid => $elList) { |
|
63 | - // Add panel-heading / category-collapse to output |
|
64 | - $panelGroup .= parsePh($tpl['panelHeading'], array( |
|
65 | - 'tab' => $resourceTable, |
|
66 | - 'category' => $categories[$catid]['name'], |
|
67 | - 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '', |
|
68 | - 'catid' => $catid, |
|
69 | - )); |
|
60 | + // Now render categories / panel-collapse |
|
61 | + $panelGroup = ''; |
|
62 | + foreach($elements as $catid => $elList) { |
|
63 | + // Add panel-heading / category-collapse to output |
|
64 | + $panelGroup .= parsePh($tpl['panelHeading'], array( |
|
65 | + 'tab' => $resourceTable, |
|
66 | + 'category' => $categories[$catid]['name'], |
|
67 | + 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '', |
|
68 | + 'catid' => $catid, |
|
69 | + )); |
|
70 | 70 | |
71 | - // Prepare content for panel-collapse |
|
72 | - $panelCollapse = ''; |
|
73 | - foreach($elList as $el) { |
|
74 | - $panelCollapse .= parsePh($tpl['elementsRow'], $el); |
|
75 | - } |
|
71 | + // Prepare content for panel-collapse |
|
72 | + $panelCollapse = ''; |
|
73 | + foreach($elList as $el) { |
|
74 | + $panelCollapse .= parsePh($tpl['elementsRow'], $el); |
|
75 | + } |
|
76 | 76 | |
77 | - // Add panel-collapse with elements to output |
|
78 | - $panelGroup .= parsePh($tpl['panelCollapse'], array( |
|
79 | - 'tab' => $resourceTable, |
|
80 | - 'catid' => $catid, |
|
81 | - 'wrapper' => $panelCollapse, |
|
82 | - )); |
|
83 | - } |
|
77 | + // Add panel-collapse with elements to output |
|
78 | + $panelGroup .= parsePh($tpl['panelCollapse'], array( |
|
79 | + 'tab' => $resourceTable, |
|
80 | + 'catid' => $catid, |
|
81 | + 'wrapper' => $panelCollapse, |
|
82 | + )); |
|
83 | + } |
|
84 | 84 | |
85 | - return parsePh($tpl['panelGroup'], array( |
|
86 | - 'resourceTable' => $resourceTable, |
|
87 | - 'wrapper' => $panelGroup |
|
88 | - )); |
|
85 | + return parsePh($tpl['panelGroup'], array( |
|
86 | + 'resourceTable' => $resourceTable, |
|
87 | + 'wrapper' => $panelGroup |
|
88 | + )); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -93,54 +93,54 @@ discard block |
||
93 | 93 | * @return string |
94 | 94 | */ |
95 | 95 | function createCombinedView($resources) { |
96 | - global $modx, $_lang, $_style, $modx_textdir; |
|
96 | + global $modx, $_lang, $_style, $modx_textdir; |
|
97 | 97 | |
98 | - $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; |
|
99 | - $types = isset($resources->types) ? $resources->types : false; |
|
100 | - $categories = isset($resources->categories) ? $resources->categories : false; |
|
98 | + $itemsPerCategory = isset($resources->itemsPerCategory) ? $resources->itemsPerCategory : false; |
|
99 | + $types = isset($resources->types) ? $resources->types : false; |
|
100 | + $categories = isset($resources->categories) ? $resources->categories : false; |
|
101 | 101 | |
102 | - if(!$itemsPerCategory) { |
|
103 | - return $_lang['no_results']; |
|
104 | - } |
|
102 | + if(!$itemsPerCategory) { |
|
103 | + return $_lang['no_results']; |
|
104 | + } |
|
105 | 105 | |
106 | - $tpl = array( |
|
107 | - 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
108 | - 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
109 | - 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
110 | - 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), |
|
111 | - ); |
|
106 | + $tpl = array( |
|
107 | + 'panelGroup' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelGroup.tpl'), |
|
108 | + 'panelHeading' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelHeading.tpl'), |
|
109 | + 'panelCollapse' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_panelCollapse.tpl'), |
|
110 | + 'elementsRow' => file_get_contents(MODX_MANAGER_PATH . 'actions/resources/tpl_elementsRow.tpl'), |
|
111 | + ); |
|
112 | 112 | |
113 | - // Easily loop through $itemsPerCategory-Array |
|
114 | - $panelGroup = ''; |
|
115 | - foreach($categories as $catid => $category) { |
|
116 | - // Prepare collapse content / elements-list |
|
117 | - $panelCollapse = ''; |
|
118 | - foreach($itemsPerCategory[$catid] as $el) { |
|
119 | - $resourceTable = $el['type']; |
|
120 | - $ph = prepareElementRowPh($el, $resourceTable, $resources); |
|
121 | - $panelCollapse .= parsePh($tpl['elementsRow'], $ph); |
|
122 | - } |
|
113 | + // Easily loop through $itemsPerCategory-Array |
|
114 | + $panelGroup = ''; |
|
115 | + foreach($categories as $catid => $category) { |
|
116 | + // Prepare collapse content / elements-list |
|
117 | + $panelCollapse = ''; |
|
118 | + foreach($itemsPerCategory[$catid] as $el) { |
|
119 | + $resourceTable = $el['type']; |
|
120 | + $ph = prepareElementRowPh($el, $resourceTable, $resources); |
|
121 | + $panelCollapse .= parsePh($tpl['elementsRow'], $ph); |
|
122 | + } |
|
123 | 123 | |
124 | - // Add panel-heading / button |
|
125 | - $panelGroup .= parsePh($tpl['panelHeading'], array( |
|
126 | - 'tab' => 'categories_list', |
|
127 | - 'category' => $categories[$catid], |
|
128 | - 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '', |
|
129 | - 'catid' => $catid, |
|
130 | - )); |
|
124 | + // Add panel-heading / button |
|
125 | + $panelGroup .= parsePh($tpl['panelHeading'], array( |
|
126 | + 'tab' => 'categories_list', |
|
127 | + 'category' => $categories[$catid], |
|
128 | + 'categoryid' => $catid != '' ? ' <small>(' . $catid . ')</small>' : '', |
|
129 | + 'catid' => $catid, |
|
130 | + )); |
|
131 | 131 | |
132 | - // Add panel |
|
133 | - $panelGroup .= parsePh($tpl['panelCollapse'], array( |
|
134 | - 'tab' => 'categories_list', |
|
135 | - 'catid' => $catid, |
|
136 | - 'wrapper' => $panelCollapse, |
|
137 | - )); |
|
138 | - } |
|
132 | + // Add panel |
|
133 | + $panelGroup .= parsePh($tpl['panelCollapse'], array( |
|
134 | + 'tab' => 'categories_list', |
|
135 | + 'catid' => $catid, |
|
136 | + 'wrapper' => $panelCollapse, |
|
137 | + )); |
|
138 | + } |
|
139 | 139 | |
140 | - return parsePh($tpl['panelGroup'], array( |
|
141 | - 'resourceTable' => 'categories_list', |
|
142 | - 'wrapper' => $panelGroup |
|
143 | - )); |
|
140 | + return parsePh($tpl['panelGroup'], array( |
|
141 | + 'resourceTable' => 'categories_list', |
|
142 | + 'wrapper' => $panelGroup |
|
143 | + )); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
@@ -150,13 +150,13 @@ discard block |
||
150 | 150 | * @return array |
151 | 151 | */ |
152 | 152 | function prepareElementRowPh($row, $resourceTable, $resources) { |
153 | - global $modx, $modx_textdir, $_style, $_lang; |
|
153 | + global $modx, $modx_textdir, $_style, $_lang; |
|
154 | 154 | |
155 | - $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; |
|
155 | + $types = isset($resources->types[$resourceTable]) ? $resources->types[$resourceTable] : false; |
|
156 | 156 | |
157 | - $_lang["confirm_delete"] = $_lang["delete"]; |
|
157 | + $_lang["confirm_delete"] = $_lang["delete"]; |
|
158 | 158 | |
159 | - switch($resourceTable){ |
|
159 | + switch($resourceTable){ |
|
160 | 160 | case 'site_templates': |
161 | 161 | $class = $row['selectable'] ? '' : 'disabledPlugin'; |
162 | 162 | $lockElementType = 1; |
@@ -190,77 +190,77 @@ discard block |
||
190 | 190 | return array(); |
191 | 191 | } |
192 | 192 | |
193 | - // Prepare displaying user-locks |
|
194 | - $lockedByUser = ''; |
|
195 | - $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); |
|
196 | - if($rowLock && $modx->hasPermission('display_locks')) { |
|
197 | - if($rowLock['sid'] == $modx->sid) { |
|
198 | - $title = $modx->parseText($_lang["lock_element_editing"], array( |
|
199 | - 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
200 | - 'lasthit_df' => $rowLock['lasthit_df'] |
|
201 | - )); |
|
202 | - $lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span> '; |
|
203 | - } else { |
|
204 | - $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
|
205 | - 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
206 | - 'username' => $rowLock['username'], |
|
207 | - 'lasthit_df' => $rowLock['lasthit_df'] |
|
208 | - )); |
|
209 | - if($modx->hasPermission('remove_locks')) { |
|
210 | - $lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>'; |
|
211 | - } else { |
|
212 | - $lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>'; |
|
213 | - } |
|
214 | - } |
|
215 | - } |
|
216 | - if($lockedByUser) { |
|
217 | - $lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>'; |
|
218 | - } |
|
193 | + // Prepare displaying user-locks |
|
194 | + $lockedByUser = ''; |
|
195 | + $rowLock = $modx->elementIsLocked($lockElementType, $row['id'], true); |
|
196 | + if($rowLock && $modx->hasPermission('display_locks')) { |
|
197 | + if($rowLock['sid'] == $modx->sid) { |
|
198 | + $title = $modx->parseText($_lang["lock_element_editing"], array( |
|
199 | + 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
200 | + 'lasthit_df' => $rowLock['lasthit_df'] |
|
201 | + )); |
|
202 | + $lockedByUser = '<span title="' . $title . '" class="editResource" style="cursor:context-menu;">' . $_style['tree_preview_resource'] . '</span> '; |
|
203 | + } else { |
|
204 | + $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
|
205 | + 'element_type' => $_lang["lock_element_type_" . $lockElementType], |
|
206 | + 'username' => $rowLock['username'], |
|
207 | + 'lasthit_df' => $rowLock['lasthit_df'] |
|
208 | + )); |
|
209 | + if($modx->hasPermission('remove_locks')) { |
|
210 | + $lockedByUser = '<a href="javascript:;" onclick="unlockElement(' . $lockElementType . ', ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource"><i class="' . $_style['icons_secured'] . '"></i></a>'; |
|
211 | + } else { |
|
212 | + $lockedByUser = '<span title="' . $title . '" class="lockedResource" style="cursor:context-menu;"><i class="' . $_style['icons_secured'] . '"></i></span>'; |
|
213 | + } |
|
214 | + } |
|
215 | + } |
|
216 | + if($lockedByUser) { |
|
217 | + $lockedByUser = '<div class="lockCell">' . $lockedByUser . '</div>'; |
|
218 | + } |
|
219 | 219 | |
220 | - // Caption |
|
221 | - if($resourceTable == 'site_tmplvars') { |
|
222 | - $caption = !empty($row['description']) ? ' ' . $row['caption'] . ' <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption']; |
|
223 | - } else { |
|
224 | - $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; |
|
225 | - } |
|
220 | + // Caption |
|
221 | + if($resourceTable == 'site_tmplvars') { |
|
222 | + $caption = !empty($row['description']) ? ' ' . $row['caption'] . ' <small>(' . $row['description'] . ')</small>' : ' ' . $row['caption']; |
|
223 | + } else { |
|
224 | + $caption = !empty($row['description']) ? ' ' . $row['description'] : ''; |
|
225 | + } |
|
226 | 226 | |
227 | - // Special marks |
|
228 | - $tplInfo = array(); |
|
229 | - if($row['locked']) { |
|
230 | - $tplInfo[] = $_lang['locked']; |
|
231 | - } |
|
232 | - if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { |
|
233 | - $tplInfo[] = $_lang['defaulttemplate_title']; |
|
234 | - } |
|
235 | - $marks = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : ''; |
|
227 | + // Special marks |
|
228 | + $tplInfo = array(); |
|
229 | + if($row['locked']) { |
|
230 | + $tplInfo[] = $_lang['locked']; |
|
231 | + } |
|
232 | + if($row['id'] == $modx->config['default_template'] && $resourceTable == 'site_templates') { |
|
233 | + $tplInfo[] = $_lang['defaulttemplate_title']; |
|
234 | + } |
|
235 | + $marks = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : ''; |
|
236 | 236 | |
237 | - /* row buttons */ |
|
238 | - $buttons = ''; |
|
239 | - if($modx->hasPermission($types['actions']['edit'][1])) { |
|
240 | - $buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>'; |
|
241 | - } |
|
242 | - if($modx->hasPermission($types['actions']['duplicate'][1])) { |
|
243 | - $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>'; |
|
244 | - } |
|
245 | - if($modx->hasPermission($types['actions']['remove'][1])) { |
|
246 | - $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>'; |
|
247 | - } |
|
248 | - $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : ''; |
|
237 | + /* row buttons */ |
|
238 | + $buttons = ''; |
|
239 | + if($modx->hasPermission($types['actions']['edit'][1])) { |
|
240 | + $buttons .= '<li><a title="' . $_lang["edit_resource"] . '" href="index.php?a=' . $types['actions']['edit'][0] . '&id=' . $row['id'] . '"><i class="fa fa-edit fa-fw"></i></a></li>'; |
|
241 | + } |
|
242 | + if($modx->hasPermission($types['actions']['duplicate'][1])) { |
|
243 | + $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_duplicate_record"] . '\')" title="' . $_lang["resource_duplicate"] . '" href="index.php?a=' . $types['actions']['duplicate'][0] . '&id=' . $row['id'] . '"><i class="fa fa-clone fa-fw"></i></a></li>'; |
|
244 | + } |
|
245 | + if($modx->hasPermission($types['actions']['remove'][1])) { |
|
246 | + $buttons .= '<li><a onclick="return confirm(\'' . $_lang["confirm_delete"] . '\')" title="' . $_lang["delete"] . '" href="index.php?a=' . $types['actions']['remove'][0] . '&id=' . $row['id'] . '"><i class="fa fa-trash fa-fw"></i></a></li>'; |
|
247 | + } |
|
248 | + $buttons = $buttons ? '<div class="btnCell"><ul class="elements_buttonbar">' . $buttons . '</ul></div>' : ''; |
|
249 | 249 | |
250 | - $catid = $row['catid'] ? $row['catid'] : 0; |
|
250 | + $catid = $row['catid'] ? $row['catid'] : 0; |
|
251 | 251 | |
252 | - // Placeholders for elements-row |
|
253 | - return array( |
|
254 | - 'class' => $class ? ' class="' . $class . '"' : '', |
|
255 | - 'lockedByUser' => $lockedByUser, |
|
256 | - 'name' => $row['name'], |
|
257 | - 'caption' => $caption, |
|
258 | - 'buttons' => $buttons, |
|
259 | - 'marks' => $marks, |
|
260 | - 'id' => $row['id'], |
|
261 | - 'resourceTable' => $resourceTable, |
|
262 | - 'actionEdit' => $types['actions']['edit'][0], |
|
263 | - 'catid' => $catid, |
|
264 | - 'textdir' => $modx_textdir ? '‏' : '', |
|
265 | - ); |
|
252 | + // Placeholders for elements-row |
|
253 | + return array( |
|
254 | + 'class' => $class ? ' class="' . $class . '"' : '', |
|
255 | + 'lockedByUser' => $lockedByUser, |
|
256 | + 'name' => $row['name'], |
|
257 | + 'caption' => $caption, |
|
258 | + 'buttons' => $buttons, |
|
259 | + 'marks' => $marks, |
|
260 | + 'id' => $row['id'], |
|
261 | + 'resourceTable' => $resourceTable, |
|
262 | + 'actionEdit' => $types['actions']['edit'][0], |
|
263 | + 'catid' => $catid, |
|
264 | + 'textdir' => $modx_textdir ? '‏' : '', |
|
265 | + ); |
|
266 | 266 | } |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | /** |
8 | 8 | * @var array |
9 | 9 | */ |
10 | - public $types = array(); |
|
10 | + public $types = array(); |
|
11 | 11 | /** |
12 | 12 | * @var array |
13 | 13 | */ |
@@ -25,73 +25,73 @@ discard block |
||
25 | 25 | * mgrResources constructor. |
26 | 26 | */ |
27 | 27 | public function __construct() { |
28 | - $this->setTypes(); |
|
29 | - $this->queryItemsFromDB(); |
|
30 | - $this->prepareCategoryArrays(); |
|
31 | - } |
|
28 | + $this->setTypes(); |
|
29 | + $this->queryItemsFromDB(); |
|
30 | + $this->prepareCategoryArrays(); |
|
31 | + } |
|
32 | 32 | |
33 | 33 | /** |
34 | 34 | * @return void |
35 | 35 | */ |
36 | 36 | public function setTypes() { |
37 | - global $_lang; |
|
38 | - $this->types['site_templates'] = array( |
|
39 | - 'title'=>$_lang["manage_templates"], |
|
40 | - 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), |
|
41 | - 'permissions'=>array('new_template','edit_template'), |
|
42 | - 'name'=>'templatename' |
|
43 | - ); |
|
44 | - $this->types['site_tmplvars'] = array( |
|
45 | - 'title'=>$_lang["tmplvars"], |
|
46 | - 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), |
|
47 | - 'permissions'=>array('new_template','edit_template'), |
|
48 | - ); |
|
49 | - $this->types['site_htmlsnippets'] = array( |
|
50 | - 'title'=>$_lang["manage_htmlsnippets"], |
|
51 | - 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), |
|
52 | - 'permissions'=>array('new_chunk','edit_chunk'), |
|
53 | - ); |
|
54 | - $this->types['site_snippets'] = array( |
|
55 | - 'title'=>$_lang["manage_snippets"], |
|
56 | - 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), |
|
57 | - 'permissions'=>array('new_snippet','edit_snippet'), |
|
58 | - ); |
|
59 | - $this->types['site_plugins'] = array( |
|
60 | - 'title'=>$_lang["manage_plugins"], |
|
61 | - 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), |
|
62 | - 'permissions'=>array('new_plugin','edit_plugin'), |
|
63 | - ); |
|
64 | - $this->types['site_modules'] = array( |
|
65 | - 'title'=>$_lang["manage_modules"], |
|
66 | - 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), |
|
67 | - 'permissions'=>array('new_module','edit_module'), |
|
68 | - ); |
|
69 | - } |
|
37 | + global $_lang; |
|
38 | + $this->types['site_templates'] = array( |
|
39 | + 'title'=>$_lang["manage_templates"], |
|
40 | + 'actions'=>array( 'edit'=>array(16,'edit_template'), 'duplicate'=>array(96,'new_template'), 'remove'=>array(21,'delete_template') ), |
|
41 | + 'permissions'=>array('new_template','edit_template'), |
|
42 | + 'name'=>'templatename' |
|
43 | + ); |
|
44 | + $this->types['site_tmplvars'] = array( |
|
45 | + 'title'=>$_lang["tmplvars"], |
|
46 | + 'actions'=>array('edit'=>array(301,'edit_template'), 'duplicate'=>array(304,'edit_template'), 'remove'=>array(303,'edit_template')), |
|
47 | + 'permissions'=>array('new_template','edit_template'), |
|
48 | + ); |
|
49 | + $this->types['site_htmlsnippets'] = array( |
|
50 | + 'title'=>$_lang["manage_htmlsnippets"], |
|
51 | + 'actions'=>array('edit'=>array(78,'edit_chunk'), 'duplicate'=>array(97,'new_chunk'), 'remove'=>array(80,'delete_chunk')), |
|
52 | + 'permissions'=>array('new_chunk','edit_chunk'), |
|
53 | + ); |
|
54 | + $this->types['site_snippets'] = array( |
|
55 | + 'title'=>$_lang["manage_snippets"], |
|
56 | + 'actions'=>array('edit'=>array(22,'edit_snippet'), 'duplicate'=>array(98,'new_snippet'), 'remove'=>array(25,'delete_snippet')), |
|
57 | + 'permissions'=>array('new_snippet','edit_snippet'), |
|
58 | + ); |
|
59 | + $this->types['site_plugins'] = array( |
|
60 | + 'title'=>$_lang["manage_plugins"], |
|
61 | + 'actions'=>array('edit'=>array(102,'edit_plugin'), 'duplicate'=>array(105,'new_plugin'), 'remove'=>array(104,'delete_plugin')), |
|
62 | + 'permissions'=>array('new_plugin','edit_plugin'), |
|
63 | + ); |
|
64 | + $this->types['site_modules'] = array( |
|
65 | + 'title'=>$_lang["manage_modules"], |
|
66 | + 'actions'=>array('edit'=>array(108,'edit_module'), 'duplicate'=>array(111,'new_module'), 'remove'=>array(110,'delete_module')), |
|
67 | + 'permissions'=>array('new_module','edit_module'), |
|
68 | + ); |
|
69 | + } |
|
70 | 70 | |
71 | 71 | /** |
72 | 72 | * @return void |
73 | 73 | */ |
74 | 74 | public function queryItemsFromDB() { |
75 | - foreach($this->types as $resourceTable=>$type) { |
|
76 | - if($this->hasAnyPermissions($type['permissions'])) { |
|
77 | - $nameField = isset($type['name']) ? $type['name'] : 'name'; |
|
78 | - $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); |
|
79 | - } |
|
80 | - } |
|
81 | - } |
|
75 | + foreach($this->types as $resourceTable=>$type) { |
|
76 | + if($this->hasAnyPermissions($type['permissions'])) { |
|
77 | + $nameField = isset($type['name']) ? $type['name'] : 'name'; |
|
78 | + $this->items[$resourceTable] = $this->queryResources($resourceTable, $nameField); |
|
79 | + } |
|
80 | + } |
|
81 | + } |
|
82 | 82 | |
83 | 83 | /** |
84 | 84 | * @param array $permissions |
85 | 85 | * @return bool |
86 | 86 | */ |
87 | 87 | public function hasAnyPermissions($permissions) { |
88 | - global $modx; |
|
88 | + global $modx; |
|
89 | 89 | |
90 | - foreach($permissions as $p) |
|
91 | - if($modx->hasPermission($p)) return true; |
|
90 | + foreach($permissions as $p) |
|
91 | + if($modx->hasPermission($p)) return true; |
|
92 | 92 | |
93 | - return false; |
|
94 | - } |
|
93 | + return false; |
|
94 | + } |
|
95 | 95 | |
96 | 96 | /** |
97 | 97 | * @param string $resourceTable |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * @return array|bool |
100 | 100 | */ |
101 | 101 | public function queryResources($resourceTable, $nameField = 'name') { |
102 | - global $modx, $_lang; |
|
102 | + global $modx, $_lang; |
|
103 | 103 | |
104 | 104 | $allowed = array( |
105 | 105 | 'site_htmlsnippets', |
@@ -107,59 +107,59 @@ discard block |
||
107 | 107 | 'site_plugins', |
108 | 108 | 'site_modules' |
109 | 109 | ); |
110 | - $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : ''; |
|
111 | - |
|
112 | - $tvsql = ''; |
|
113 | - $tvjoin = ''; |
|
114 | - if ($resourceTable === 'site_tmplvars') { |
|
115 | - $tvsql = 'site_tmplvars.caption, '; |
|
116 | - $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); |
|
117 | - $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; |
|
118 | - } |
|
119 | - else $sttfield = ''; |
|
120 | - |
|
121 | - $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : ""; |
|
122 | - |
|
123 | - $rs = $modx->db->select( |
|
124 | - "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", |
|
125 | - $modx->getFullTableName($resourceTable) . " AS {$resourceTable} |
|
110 | + $pluginsql = !empty($resourceTable) && in_array($resourceTable, $allowed) ? $resourceTable . '.disabled, ' : ''; |
|
111 | + |
|
112 | + $tvsql = ''; |
|
113 | + $tvjoin = ''; |
|
114 | + if ($resourceTable === 'site_tmplvars') { |
|
115 | + $tvsql = 'site_tmplvars.caption, '; |
|
116 | + $tvjoin = sprintf('LEFT JOIN %s AS stt ON site_tmplvars.id=stt.tmplvarid GROUP BY site_tmplvars.id,reltpl', $modx->getFullTableName('site_tmplvar_templates')); |
|
117 | + $sttfield = 'IF(stt.templateid,1,0) AS reltpl,'; |
|
118 | + } |
|
119 | + else $sttfield = ''; |
|
120 | + |
|
121 | + $selectableTemplates = $resourceTable === 'site_templates' ? "{$resourceTable}.selectable, " : ""; |
|
122 | + |
|
123 | + $rs = $modx->db->select( |
|
124 | + "{$sttfield} {$pluginsql} {$tvsql} {$resourceTable}.{$nameField} as name, {$resourceTable}.id, {$resourceTable}.description, {$resourceTable}.locked, {$selectableTemplates}IF(isnull(categories.category),'{$_lang['no_category']}',categories.category) as category, categories.id as catid", |
|
125 | + $modx->getFullTableName($resourceTable) . " AS {$resourceTable} |
|
126 | 126 | LEFT JOIN " . $modx->getFullTableName('categories') . " AS categories ON {$resourceTable}.category = categories.id {$tvjoin}", |
127 | - "", |
|
128 | - "category,name" |
|
129 | - ); |
|
130 | - $limit = $modx->db->getRecordCount($rs); |
|
127 | + "", |
|
128 | + "category,name" |
|
129 | + ); |
|
130 | + $limit = $modx->db->getRecordCount($rs); |
|
131 | 131 | |
132 | - if($limit < 1) return false; |
|
132 | + if($limit < 1) return false; |
|
133 | 133 | |
134 | - $result = array(); |
|
135 | - while ($row = $modx->db->getRow($rs)) { |
|
136 | - $result[] = $row; |
|
137 | - } |
|
138 | - return $result; |
|
139 | - } |
|
134 | + $result = array(); |
|
135 | + while ($row = $modx->db->getRow($rs)) { |
|
136 | + $result[] = $row; |
|
137 | + } |
|
138 | + return $result; |
|
139 | + } |
|
140 | 140 | |
141 | 141 | /** |
142 | 142 | * @return void |
143 | 143 | */ |
144 | 144 | public function prepareCategoryArrays() { |
145 | - foreach($this->items as $type=>$items) { |
|
146 | - foreach((array)$items as $item) { |
|
147 | - $catid = $item['catid'] ? $item['catid'] : 0; |
|
148 | - $this->categories[$catid] = $item['category']; |
|
149 | - |
|
150 | - $item['type'] = $type; |
|
151 | - $this->itemsPerCategory[$catid][] = $item; |
|
152 | - } |
|
153 | - } |
|
154 | - |
|
155 | - // Sort categories by name |
|
156 | - natcasesort($this->categories); |
|
157 | - |
|
158 | - // Now sort by name |
|
159 | - foreach($this->itemsPerCategory as $catid=>$items) { |
|
160 | - usort($this->itemsPerCategory[$catid], function ($a, $b) { |
|
161 | - return strcasecmp($a['name'], $b['name']); |
|
162 | - }); |
|
163 | - } |
|
164 | - } |
|
145 | + foreach($this->items as $type=>$items) { |
|
146 | + foreach((array)$items as $item) { |
|
147 | + $catid = $item['catid'] ? $item['catid'] : 0; |
|
148 | + $this->categories[$catid] = $item['category']; |
|
149 | + |
|
150 | + $item['type'] = $type; |
|
151 | + $this->itemsPerCategory[$catid][] = $item; |
|
152 | + } |
|
153 | + } |
|
154 | + |
|
155 | + // Sort categories by name |
|
156 | + natcasesort($this->categories); |
|
157 | + |
|
158 | + // Now sort by name |
|
159 | + foreach($this->itemsPerCategory as $catid=>$items) { |
|
160 | + usort($this->itemsPerCategory[$catid], function ($a, $b) { |
|
161 | + return strcasecmp($a['name'], $b['name']); |
|
162 | + }); |
|
163 | + } |
|
164 | + } |
|
165 | 165 | } |