@@ -1,16 +1,16 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** This file is part of KCFinder project |
| 4 | - * |
|
| 5 | - * @desc Upload calling script |
|
| 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 Upload calling script |
|
| 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 | require "core/autoload.php"; |
| 16 | 16 | $uploader = new uploader($modx); |
@@ -1,15 +1,15 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | $modx->config['enable_filter'] = 1; |
| 3 | 3 | |
| 4 | -$modx->addSnippet('hasPermission','return $modx->hasPermission($key);');
|
|
| 4 | +$modx->addSnippet('hasPermission', 'return $modx->hasPermission($key);');
|
|
| 5 | 5 | |
| 6 | -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'))
|
|
| 6 | +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'))
|
|
| 7 | 7 | $hasAnyPermission = 1; |
| 8 | 8 | else $hasAnyPermission = 0; |
| 9 | -$modx->addSnippet('hasAnyPermission','global $hasAnyPermission; return $hasAnyPermission;');
|
|
| 10 | -$modx->addSnippet('getLoginUserName','return $modx->getLoginUserName();');
|
|
| 9 | +$modx->addSnippet('hasAnyPermission', 'global $hasAnyPermission; return $hasAnyPermission;');
|
|
| 10 | +$modx->addSnippet('getLoginUserName', 'return $modx->getLoginUserName();');
|
|
| 11 | 11 | $code = 'global $_lang;return $_SESSION["nrtotalmessages"] ? sprintf($_lang["welcome_messages"], $_SESSION["nrtotalmessages"], \'<span style="color:red;">\' . $_SESSION["nrnewmessages"] . "</span>") : $_lang["messages_no_messages"];'; |
| 12 | -$modx->addSnippet('getMessageCount',$code);
|
|
| 12 | +$modx->addSnippet('getMessageCount', $code);
|
|
| 13 | 13 | |
| 14 | 14 | // Large Icons |
| 15 | 15 | $_style['icons_backup_large'] = 'fa fa-database fa-fw fa-2x'; |
@@ -3,9 +3,11 @@ |
||
| 3 | 3 | |
| 4 | 4 | $modx->addSnippet('hasPermission','return $modx->hasPermission($key);');
|
| 5 | 5 | |
| 6 | -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'))
|
|
| 7 | - $hasAnyPermission = 1; |
|
| 8 | -else $hasAnyPermission = 0; |
|
| 6 | +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')) { |
|
| 7 | + $hasAnyPermission = 1; |
|
| 8 | +} else { |
|
| 9 | + $hasAnyPermission = 0; |
|
| 10 | +} |
|
| 9 | 11 | $modx->addSnippet('hasAnyPermission','global $hasAnyPermission; return $hasAnyPermission;');
|
| 10 | 12 | $modx->addSnippet('getLoginUserName','return $modx->getLoginUserName();');
|
| 11 | 13 | $code = 'global $_lang;return $_SESSION["nrtotalmessages"] ? sprintf($_lang["welcome_messages"], $_SESSION["nrtotalmessages"], \'<span style="color:red;">\' . $_SESSION["nrnewmessages"] . "</span>") : $_lang["messages_no_messages"];'; |
@@ -7,11 +7,11 @@ discard block |
||
| 7 | 7 | |
| 8 | 8 | $modx->db->connect(); |
| 9 | 9 | |
| 10 | -if (empty ($modx->config)) {
|
|
| 10 | +if (empty ($modx->config)) { |
|
| 11 | 11 | $modx->getSettings(); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | -if (!isset($_SESSION['mgrValidated']) || !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') || ($_SERVER['REQUEST_METHOD'] != 'POST')) {
|
|
| 14 | +if (!isset($_SESSION['mgrValidated']) || !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') || ($_SERVER['REQUEST_METHOD'] != 'POST')) { |
|
| 15 | 15 | $modx->sendErrorPage(); |
| 16 | 16 | } |
| 17 | 17 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | |
| 21 | 21 | $_lang = array(); |
| 22 | 22 | include_once MODX_MANAGER_PATH . '/includes/lang/english.inc.php'; |
| 23 | -if ($modx->config['manager_language'] != 'english') {
|
|
| 23 | +if ($modx->config['manager_language'] != 'english') { |
|
| 24 | 24 | include_once MODX_MANAGER_PATH . '/includes/lang/' . $modx->config['manager_language'] . '.inc.php'; |
| 25 | 25 | } |
| 26 | 26 | include_once MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/style.php'; |
@@ -33,12 +33,12 @@ discard block |
||
| 33 | 33 | // set limit sql query |
| 34 | 34 | $limit = !empty($modx->config['number_of_results']) ? (int) $modx->config['number_of_results'] : 100; |
| 35 | 35 | |
| 36 | -if (isset($action)) {
|
|
| 37 | - switch ($action) {
|
|
| 36 | +if (isset($action)) { |
|
| 37 | + switch ($action) { |
|
| 38 | 38 | |
| 39 | 39 | case '1': {
|
| 40 | 40 | |
| 41 | - switch ($frame) {
|
|
| 41 | + switch ($frame) { |
|
| 42 | 42 | case 'nodes': |
| 43 | 43 | include_once MODX_MANAGER_PATH . '/frames/nodes.php'; |
| 44 | 44 | |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | |
| 53 | 53 | $elements = isset($_REQUEST['elements']) && is_scalar($_REQUEST['elements']) ? htmlentities($_REQUEST['elements']) : ''; |
| 54 | 54 | |
| 55 | - if ($elements) {
|
|
| 55 | + if ($elements) { |
|
| 56 | 56 | $output = ''; |
| 57 | 57 | $items = ''; |
| 58 | 58 | $sql = ''; |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | $sqlLike = $filter ? 'WHERE t1.name LIKE "' . $modx->db->escape($filter) . '%"' : ''; |
| 62 | 62 | $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
| 63 | 63 | |
| 64 | - switch ($elements) {
|
|
| 64 | + switch ($elements) { |
|
| 65 | 65 | case 'element_templates': |
| 66 | 66 | $a = 16; |
| 67 | 67 | $sqlLike = $filter ? 'WHERE t1.templatename LIKE "' . $modx->db->escape($filter) . '%"' : ''; |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | ORDER BY t1.templatename ASC |
| 72 | 72 | ' . $sqlLimit); |
| 73 | 73 | |
| 74 | - if ($modx->hasPermission('new_template')) {
|
|
| 74 | + if ($modx->hasPermission('new_template')) { |
|
| 75 | 75 | $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>' . $_lang['new_template'] . '</a></li>'; |
| 76 | 76 | } |
| 77 | 77 | |
@@ -87,7 +87,7 @@ discard block |
||
| 87 | 87 | ORDER BY t1.name ASC |
| 88 | 88 | ' . $sqlLimit); |
| 89 | 89 | |
| 90 | - if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
|
|
| 90 | + if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
| 91 | 91 | $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>' . $_lang['new_tmplvars'] . '</a></li>'; |
| 92 | 92 | } |
| 93 | 93 | |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | ORDER BY t1.name ASC |
| 102 | 102 | ' . $sqlLimit); |
| 103 | 103 | |
| 104 | - if ($modx->hasPermission('new_chunk')) {
|
|
| 104 | + if ($modx->hasPermission('new_chunk')) { |
|
| 105 | 105 | $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>' . $_lang['new_htmlsnippet'] . '</a></li>'; |
| 106 | 106 | } |
| 107 | 107 | |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | ORDER BY t1.name ASC |
| 116 | 116 | ' . $sqlLimit); |
| 117 | 117 | |
| 118 | - if ($modx->hasPermission('new_snippet')) {
|
|
| 118 | + if ($modx->hasPermission('new_snippet')) { |
|
| 119 | 119 | $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>' . $_lang['new_snippet'] . '</a></li>'; |
| 120 | 120 | } |
| 121 | 121 | |
@@ -129,19 +129,19 @@ discard block |
||
| 129 | 129 | ORDER BY t1.name ASC |
| 130 | 130 | ' . $sqlLimit); |
| 131 | 131 | |
| 132 | - if ($modx->hasPermission('new_plugin')) {
|
|
| 132 | + if ($modx->hasPermission('new_plugin')) { |
|
| 133 | 133 | $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>' . $_lang['new_plugin'] . '</a></li>'; |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | break; |
| 137 | 137 | } |
| 138 | 138 | |
| 139 | - if ($count = $modx->db->getRecordCount($sql)) {
|
|
| 140 | - if ($count == $limit) {
|
|
| 139 | + if ($count = $modx->db->getRecordCount($sql)) { |
|
| 140 | + if ($count == $limit) { |
|
| 141 | 141 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
| 142 | 142 | } |
| 143 | - while ($row = $modx->db->getRow($sql)) {
|
|
| 144 | - if (($row['disabled'] || $row['locked']) && $role != 1) {
|
|
| 143 | + while ($row = $modx->db->getRow($sql)) { |
|
| 144 | + if (($row['disabled'] || $row['locked']) && $role != 1) { |
|
| 145 | 145 | continue; |
| 146 | 146 | } |
| 147 | 147 | |
@@ -149,9 +149,9 @@ discard block |
||
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
| 152 | - if (isset($_REQUEST['filter'])) {
|
|
| 152 | + if (isset($_REQUEST['filter'])) { |
|
| 153 | 153 | $output = $items; |
| 154 | - } else {
|
|
| 154 | + } else { |
|
| 155 | 155 | $output .= $items; |
| 156 | 156 | } |
| 157 | 157 | |
@@ -176,22 +176,22 @@ discard block |
||
| 176 | 176 | ORDER BY t1.username ASC |
| 177 | 177 | ' . $sqlLimit); |
| 178 | 178 | |
| 179 | - if ($modx->hasPermission('new_user')) {
|
|
| 179 | + if ($modx->hasPermission('new_user')) { |
|
| 180 | 180 | $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>' . $_lang['new_user'] . '</a></li>'; |
| 181 | 181 | } |
| 182 | 182 | |
| 183 | - if ($count = $modx->db->getRecordCount($sql)) {
|
|
| 184 | - if ($count == $limit) {
|
|
| 183 | + if ($count = $modx->db->getRecordCount($sql)) { |
|
| 184 | + if ($count == $limit) { |
|
| 185 | 185 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
| 186 | 186 | } |
| 187 | - while ($row = $modx->db->getRow($sql)) {
|
|
| 187 | + while ($row = $modx->db->getRow($sql)) { |
|
| 188 | 188 | $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
|
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | |
| 192 | - if (isset($_REQUEST['filter'])) {
|
|
| 192 | + if (isset($_REQUEST['filter'])) { |
|
| 193 | 193 | $output = $items; |
| 194 | - } else {
|
|
| 194 | + } else { |
|
| 195 | 195 | $output .= $items; |
| 196 | 196 | } |
| 197 | 197 | |
@@ -215,22 +215,22 @@ discard block |
||
| 215 | 215 | ORDER BY t1.username ASC |
| 216 | 216 | ' . $sqlLimit); |
| 217 | 217 | |
| 218 | - if ($modx->hasPermission('new_web_user')) {
|
|
| 218 | + if ($modx->hasPermission('new_web_user')) { |
|
| 219 | 219 | $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>' . $_lang['new_web_user'] . '</a></li>'; |
| 220 | 220 | } |
| 221 | 221 | |
| 222 | - if ($count = $modx->db->getRecordCount($sql)) {
|
|
| 223 | - if ($count == $limit) {
|
|
| 222 | + if ($count = $modx->db->getRecordCount($sql)) { |
|
| 223 | + if ($count == $limit) { |
|
| 224 | 224 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
| 225 | 225 | } |
| 226 | - while ($row = $modx->db->getRow($sql)) {
|
|
| 226 | + while ($row = $modx->db->getRow($sql)) { |
|
| 227 | 227 | $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
|
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | |
| 231 | - if (isset($_REQUEST['filter'])) {
|
|
| 231 | + if (isset($_REQUEST['filter'])) { |
|
| 232 | 232 | $output = $items; |
| 233 | - } else {
|
|
| 233 | + } else { |
|
| 234 | 234 | $output .= $items; |
| 235 | 235 | } |
| 236 | 236 | |
@@ -244,8 +244,8 @@ discard block |
||
| 244 | 244 | $type = isset($_REQUEST['type']) && is_scalar($_REQUEST['type']) ? $modx->db->escape($_REQUEST['type']) : false; |
| 245 | 245 | $contextmenu = ''; |
| 246 | 246 | |
| 247 | - if ($role && $name && $type) {
|
|
| 248 | - switch ($type) {
|
|
| 247 | + if ($role && $name && $type) { |
|
| 248 | + switch ($type) { |
|
| 249 | 249 | case 'Snippet': |
| 250 | 250 | case 'SnippetNoCache': {
|
| 251 | 251 | |
@@ -254,7 +254,7 @@ discard block |
||
| 254 | 254 | WHERE name="' . $name . '" |
| 255 | 255 | LIMIT 1'); |
| 256 | 256 | |
| 257 | - if ($modx->db->getRecordCount($sql)) {
|
|
| 257 | + if ($modx->db->getRecordCount($sql)) { |
|
| 258 | 258 | $row = $modx->db->getRow($sql); |
| 259 | 259 | $contextmenu = array( |
| 260 | 260 | 'header' => array( |
@@ -265,13 +265,13 @@ discard block |
||
| 265 | 265 | 'url' => "index.php?a=22&id=" . $row['id'] |
| 266 | 266 | ) |
| 267 | 267 | ); |
| 268 | - if (!empty($row['description'])) {
|
|
| 268 | + if (!empty($row['description'])) { |
|
| 269 | 269 | $contextmenu['seperator'] = ''; |
| 270 | 270 | $contextmenu['description'] = array( |
| 271 | 271 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
| 272 | 272 | ); |
| 273 | 273 | } |
| 274 | - } else {
|
|
| 274 | + } else { |
|
| 275 | 275 | $contextmenu = array( |
| 276 | 276 | 'header' => array( |
| 277 | 277 | 'innerHTML' => '<i class="fa fa-code"></i> ' . $name |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | WHERE name="' . $name . '" |
| 293 | 293 | LIMIT 1'); |
| 294 | 294 | |
| 295 | - if ($modx->db->getRecordCount($sql)) {
|
|
| 295 | + if ($modx->db->getRecordCount($sql)) { |
|
| 296 | 296 | $row = $modx->db->getRow($sql); |
| 297 | 297 | $contextmenu = array( |
| 298 | 298 | 'header' => array( |
@@ -303,13 +303,13 @@ discard block |
||
| 303 | 303 | 'url' => "index.php?a=78&id=" . $row['id'] |
| 304 | 304 | ) |
| 305 | 305 | ); |
| 306 | - if (!empty($row['description'])) {
|
|
| 306 | + if (!empty($row['description'])) { |
|
| 307 | 307 | $contextmenu['seperator'] = ''; |
| 308 | 308 | $contextmenu['description'] = array( |
| 309 | 309 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
| 310 | 310 | ); |
| 311 | 311 | } |
| 312 | - } else {
|
|
| 312 | + } else { |
|
| 313 | 313 | $contextmenu = array( |
| 314 | 314 | 'header' => array( |
| 315 | 315 | 'innerHTML' => '<i class="fa fa-th-large"></i> ' . $name |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | WHERE name="' . $name . '" |
| 330 | 330 | LIMIT 1'); |
| 331 | 331 | |
| 332 | - if ($modx->db->getRecordCount($sql)) {
|
|
| 332 | + if ($modx->db->getRecordCount($sql)) { |
|
| 333 | 333 | $row = $modx->db->getRow($sql); |
| 334 | 334 | $contextmenu = array( |
| 335 | 335 | 'header' => array( |
@@ -340,20 +340,20 @@ discard block |
||
| 340 | 340 | 'url' => "index.php?a=78&id=" . $row['id'] |
| 341 | 341 | ) |
| 342 | 342 | ); |
| 343 | - if (!empty($row['description'])) {
|
|
| 343 | + if (!empty($row['description'])) { |
|
| 344 | 344 | $contextmenu['seperator'] = ''; |
| 345 | 345 | $contextmenu['description'] = array( |
| 346 | 346 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
| 347 | 347 | ); |
| 348 | 348 | } |
| 349 | - } else {
|
|
| 349 | + } else { |
|
| 350 | 350 | |
| 351 | 351 | $sql = $modx->db->query('SELECT *
|
| 352 | 352 | FROM ' . $modx->getFullTableName('site_snippets') . '
|
| 353 | 353 | WHERE name="' . $name . '" |
| 354 | 354 | LIMIT 1'); |
| 355 | 355 | |
| 356 | - if ($modx->db->getRecordCount($sql)) {
|
|
| 356 | + if ($modx->db->getRecordCount($sql)) { |
|
| 357 | 357 | $row = $modx->db->getRow($sql); |
| 358 | 358 | $contextmenu = array( |
| 359 | 359 | 'header' => array( |
@@ -364,13 +364,13 @@ discard block |
||
| 364 | 364 | 'url' => "index.php?a=22&id=" . $row['id'] |
| 365 | 365 | ) |
| 366 | 366 | ); |
| 367 | - if (!empty($row['description'])) {
|
|
| 367 | + if (!empty($row['description'])) { |
|
| 368 | 368 | $contextmenu['seperator'] = ''; |
| 369 | 369 | $contextmenu['description'] = array( |
| 370 | 370 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
| 371 | 371 | ); |
| 372 | 372 | } |
| 373 | - } else {
|
|
| 373 | + } else { |
|
| 374 | 374 | $contextmenu = array( |
| 375 | 375 | 'header' => array( |
| 376 | 376 | 'innerHTML' => '<i class="fa fa-code"></i> ' . $name |
@@ -432,7 +432,7 @@ discard block |
||
| 432 | 432 | 'alias_visible' |
| 433 | 433 | ); |
| 434 | 434 | |
| 435 | - if (in_array($name, $default_field)) {
|
|
| 435 | + if (in_array($name, $default_field)) { |
|
| 436 | 436 | return; |
| 437 | 437 | } |
| 438 | 438 | |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | WHERE name="' . $name . '" |
| 442 | 442 | LIMIT 1'); |
| 443 | 443 | |
| 444 | - if ($modx->db->getRecordCount($sql)) {
|
|
| 444 | + if ($modx->db->getRecordCount($sql)) { |
|
| 445 | 445 | $row = $modx->db->getRow($sql); |
| 446 | 446 | $contextmenu = array( |
| 447 | 447 | 'header' => array( |
@@ -452,13 +452,13 @@ discard block |
||
| 452 | 452 | 'url' => "index.php?a=301&id=" . $row['id'] |
| 453 | 453 | ) |
| 454 | 454 | ); |
| 455 | - if (!empty($row['description'])) {
|
|
| 455 | + if (!empty($row['description'])) { |
|
| 456 | 456 | $contextmenu['seperator'] = ''; |
| 457 | 457 | $contextmenu['description'] = array( |
| 458 | 458 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
| 459 | 459 | ); |
| 460 | 460 | } |
| 461 | - } else {
|
|
| 461 | + } else { |
|
| 462 | 462 | $contextmenu = array( |
| 463 | 463 | 'header' => array( |
| 464 | 464 | 'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $name |
@@ -483,13 +483,13 @@ discard block |
||
| 483 | 483 | case 'movedocument' : {
|
| 484 | 484 | $json = array(); |
| 485 | 485 | |
| 486 | - if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
|
|
| 486 | + if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
|
| 487 | 487 | $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : ''; |
| 488 | 488 | $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0; |
| 489 | 489 | $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0; |
| 490 | 490 | |
| 491 | 491 | // set parent |
| 492 | - if ($id && $parent >= 0) {
|
|
| 492 | + if ($id && $parent >= 0) { |
|
| 493 | 493 | |
| 494 | 494 | // find older parent |
| 495 | 495 | $parentOld = $modx->db->getValue($modx->db->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id));
|
@@ -500,31 +500,31 @@ discard block |
||
| 500 | 500 | 'new_parent' => $parent, |
| 501 | 501 | ]); |
| 502 | 502 | |
| 503 | - if (is_array($eventOut) && count($eventOut) > 0) {
|
|
| 503 | + if (is_array($eventOut) && count($eventOut) > 0) { |
|
| 504 | 504 | $eventParent = array_pop($eventOut); |
| 505 | 505 | |
| 506 | - if ($eventParent == $parentOld) {
|
|
| 506 | + if ($eventParent == $parentOld) { |
|
| 507 | 507 | $json['errors'] = $_lang['error_movedocument2']; |
| 508 | - } else {
|
|
| 508 | + } else { |
|
| 509 | 509 | $parent = $eventParent; |
| 510 | 510 | } |
| 511 | 511 | } |
| 512 | 512 | |
| 513 | - if (empty($json['errors'])) {
|
|
| 513 | + if (empty($json['errors'])) { |
|
| 514 | 514 | // check privileges user for move docs |
| 515 | - if (!empty($modx->config['tree_show_protected']) && $role != 1) {
|
|
| 515 | + if (!empty($modx->config['tree_show_protected']) && $role != 1) { |
|
| 516 | 516 | $sql = $modx->db->select('*', $modx->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')');
|
| 517 | - if ($modx->db->getRecordCount($sql)) {
|
|
| 517 | + if ($modx->db->getRecordCount($sql)) { |
|
| 518 | 518 | $document_groups = array(); |
| 519 | - while ($row = $modx->db->getRow($sql)) {
|
|
| 519 | + while ($row = $modx->db->getRow($sql)) { |
|
| 520 | 520 | $document_groups[$row['document']]['groups'][] = $row['document_group']; |
| 521 | 521 | } |
| 522 | - foreach ($document_groups as $key => $value) {
|
|
| 523 | - if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) {
|
|
| 522 | + foreach ($document_groups as $key => $value) { |
|
| 523 | + if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) { |
|
| 524 | 524 | $json['errors'] = $_lang["error_no_privileges"]; |
| 525 | 525 | } |
| 526 | 526 | } |
| 527 | - if ($json['errors']) {
|
|
| 527 | + if ($json['errors']) { |
|
| 528 | 528 | header('content-type: application/json');
|
| 529 | 529 | echo json_encode($json, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE); |
| 530 | 530 | break; |
@@ -532,9 +532,9 @@ discard block |
||
| 532 | 532 | } |
| 533 | 533 | } |
| 534 | 534 | |
| 535 | - if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) {
|
|
| 535 | + if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) { |
|
| 536 | 536 | $json['errors'] = $_lang["error_no_privileges"]; |
| 537 | - } else {
|
|
| 537 | + } else { |
|
| 538 | 538 | // set new parent |
| 539 | 539 | $modx->db->update(array( |
| 540 | 540 | 'parent' => $parent |
@@ -544,13 +544,13 @@ discard block |
||
| 544 | 544 | 'isfolder' => 1 |
| 545 | 545 | ), $modx->getFullTableName('site_content'), 'id=' . $parent);
|
| 546 | 546 | |
| 547 | - if ($parent != $parentOld) {
|
|
| 547 | + if ($parent != $parentOld) { |
|
| 548 | 548 | // check children docs and set parent isfolder |
| 549 | - if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) {
|
|
| 549 | + if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) { |
|
| 550 | 550 | $modx->db->update(array( |
| 551 | 551 | 'isfolder' => 1 |
| 552 | 552 | ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
|
| 553 | - } else {
|
|
| 553 | + } else { |
|
| 554 | 554 | $modx->db->update(array( |
| 555 | 555 | 'isfolder' => 0 |
| 556 | 556 | ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
|
@@ -558,16 +558,16 @@ discard block |
||
| 558 | 558 | } |
| 559 | 559 | |
| 560 | 560 | // set menuindex |
| 561 | - if (!empty($menuindex)) {
|
|
| 561 | + if (!empty($menuindex)) { |
|
| 562 | 562 | $menuindex = explode(',', $menuindex);
|
| 563 | - foreach ($menuindex as $key => $value) {
|
|
| 563 | + foreach ($menuindex as $key => $value) { |
|
| 564 | 564 | $modx->db->query('UPDATE ' . $modx->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value);
|
| 565 | 565 | } |
| 566 | - } else {
|
|
| 566 | + } else { |
|
| 567 | 567 | // TODO: max(*) menuindex |
| 568 | 568 | } |
| 569 | 569 | |
| 570 | - if (!$json['errors']) {
|
|
| 570 | + if (!$json['errors']) { |
|
| 571 | 571 | $json['success'] = $_lang["actioncomplete"]; |
| 572 | 572 | |
| 573 | 573 | $modx->invokeEvent('onAfterMoveDocument', [
|
@@ -579,7 +579,7 @@ discard block |
||
| 579 | 579 | } |
| 580 | 580 | } |
| 581 | 581 | } |
| 582 | - } else {
|
|
| 582 | + } else { |
|
| 583 | 583 | $json['errors'] = $_lang["error_no_privileges"]; |
| 584 | 584 | } |
| 585 | 585 | |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | |
| 596 | 596 | $output = !!$modx->elementIsLocked($type, $id, true); |
| 597 | 597 | |
| 598 | - if (!$output) {
|
|
| 598 | + if (!$output) { |
|
| 599 | 599 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
|
| 600 | 600 | $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : '';
|
| 601 | 601 | $sql = ' |
@@ -604,7 +604,7 @@ discard block |
||
| 604 | 604 | LEFT JOIN ' . $modx->getFullTableName('document_groups') . ' dg ON dg.document=sc.id
|
| 605 | 605 | WHERE sc.id=' . $id . ' GROUP BY sc.id'; |
| 606 | 606 | $sql = $modx->db->query($sql); |
| 607 | - if ($modx->db->getRecordCount($sql)) {
|
|
| 607 | + if ($modx->db->getRecordCount($sql)) { |
|
| 608 | 608 | $row = $modx->db->getRow($sql); |
| 609 | 609 | $output = !!$row['locked']; |
| 610 | 610 | } |
@@ -19,11 +19,11 @@ discard block |
||
| 19 | 19 | $modx->loadExtension("ManagerAPI");
|
| 20 | 20 | |
| 21 | 21 | $_lang = array(); |
| 22 | -include_once MODX_MANAGER_PATH . '/includes/lang/english.inc.php'; |
|
| 22 | +include_once MODX_MANAGER_PATH.'/includes/lang/english.inc.php'; |
|
| 23 | 23 | if ($modx->config['manager_language'] != 'english') {
|
| 24 | - include_once MODX_MANAGER_PATH . '/includes/lang/' . $modx->config['manager_language'] . '.inc.php'; |
|
| 24 | + include_once MODX_MANAGER_PATH.'/includes/lang/'.$modx->config['manager_language'].'.inc.php'; |
|
| 25 | 25 | } |
| 26 | -include_once MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/style.php'; |
|
| 26 | +include_once MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/style.php'; |
|
| 27 | 27 | |
| 28 | 28 | $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : ''; |
| 29 | 29 | $frame = isset($_REQUEST['f']) ? $_REQUEST['f'] : ''; |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | |
| 41 | 41 | switch ($frame) {
|
| 42 | 42 | case 'nodes': |
| 43 | - include_once MODX_MANAGER_PATH . '/frames/nodes.php'; |
|
| 43 | + include_once MODX_MANAGER_PATH.'/frames/nodes.php'; |
|
| 44 | 44 | |
| 45 | 45 | break; |
| 46 | 46 | } |
@@ -58,21 +58,21 @@ discard block |
||
| 58 | 58 | $sql = ''; |
| 59 | 59 | $a = ''; |
| 60 | 60 | $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '%*_') : ''; |
| 61 | - $sqlLike = $filter ? 'WHERE t1.name LIKE "' . $modx->db->escape($filter) . '%"' : ''; |
|
| 62 | - $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
|
| 61 | + $sqlLike = $filter ? 'WHERE t1.name LIKE "'.$modx->db->escape($filter).'%"' : ''; |
|
| 62 | + $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit; |
|
| 63 | 63 | |
| 64 | 64 | switch ($elements) {
|
| 65 | 65 | case 'element_templates': |
| 66 | 66 | $a = 16; |
| 67 | - $sqlLike = $filter ? 'WHERE t1.templatename LIKE "' . $modx->db->escape($filter) . '%"' : ''; |
|
| 67 | + $sqlLike = $filter ? 'WHERE t1.templatename LIKE "'.$modx->db->escape($filter).'%"' : ''; |
|
| 68 | 68 | $sql = $modx->db->query('SELECT t1.*, t1.templatename AS name
|
| 69 | - FROM ' . $modx->getFullTableName('site_templates') . ' AS t1
|
|
| 70 | - ' . $sqlLike . ' |
|
| 69 | + FROM ' . $modx->getFullTableName('site_templates').' AS t1
|
|
| 70 | + ' . $sqlLike.' |
|
| 71 | 71 | ORDER BY t1.templatename ASC |
| 72 | 72 | ' . $sqlLimit); |
| 73 | 73 | |
| 74 | 74 | if ($modx->hasPermission('new_template')) {
|
| 75 | - $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>' . $_lang['new_template'] . '</a></li>'; |
|
| 75 | + $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>'.$_lang['new_template'].'</a></li>'; |
|
| 76 | 76 | } |
| 77 | 77 | |
| 78 | 78 | break; |
@@ -80,15 +80,15 @@ discard block |
||
| 80 | 80 | case 'element_tplvars': |
| 81 | 81 | $a = 301; |
| 82 | 82 | $sql = $modx->db->query('SELECT t1.id,t1.name,t1.locked, IF(MIN(t2.tmplvarid),0,1) AS disabled
|
| 83 | - FROM ' . $modx->getFullTableName('site_tmplvars') . ' AS t1
|
|
| 84 | - LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates') . ' AS t2 ON t1.id=t2.tmplvarid
|
|
| 85 | - ' . $sqlLike . ' |
|
| 83 | + FROM ' . $modx->getFullTableName('site_tmplvars').' AS t1
|
|
| 84 | + LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates').' AS t2 ON t1.id=t2.tmplvarid
|
|
| 85 | + ' . $sqlLike.' |
|
| 86 | 86 | GROUP BY t1.id |
| 87 | 87 | ORDER BY t1.name ASC |
| 88 | 88 | ' . $sqlLimit); |
| 89 | 89 | |
| 90 | 90 | if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) {
|
| 91 | - $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>' . $_lang['new_tmplvars'] . '</a></li>'; |
|
| 91 | + $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>'.$_lang['new_tmplvars'].'</a></li>'; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | break; |
@@ -96,13 +96,13 @@ discard block |
||
| 96 | 96 | case 'element_htmlsnippets': |
| 97 | 97 | $a = 78; |
| 98 | 98 | $sql = $modx->db->query('SELECT t1.*
|
| 99 | - FROM ' . $modx->getFullTableName('site_htmlsnippets') . ' AS t1
|
|
| 100 | - ' . $sqlLike . ' |
|
| 99 | + FROM ' . $modx->getFullTableName('site_htmlsnippets').' AS t1
|
|
| 100 | + ' . $sqlLike.' |
|
| 101 | 101 | ORDER BY t1.name ASC |
| 102 | 102 | ' . $sqlLimit); |
| 103 | 103 | |
| 104 | 104 | if ($modx->hasPermission('new_chunk')) {
|
| 105 | - $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>' . $_lang['new_htmlsnippet'] . '</a></li>'; |
|
| 105 | + $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>'.$_lang['new_htmlsnippet'].'</a></li>'; |
|
| 106 | 106 | } |
| 107 | 107 | |
| 108 | 108 | break; |
@@ -110,13 +110,13 @@ discard block |
||
| 110 | 110 | case 'element_snippets': |
| 111 | 111 | $a = 22; |
| 112 | 112 | $sql = $modx->db->query('SELECT t1.*
|
| 113 | - FROM ' . $modx->getFullTableName('site_snippets') . ' AS t1
|
|
| 114 | - ' . $sqlLike . ' |
|
| 113 | + FROM ' . $modx->getFullTableName('site_snippets').' AS t1
|
|
| 114 | + ' . $sqlLike.' |
|
| 115 | 115 | ORDER BY t1.name ASC |
| 116 | 116 | ' . $sqlLimit); |
| 117 | 117 | |
| 118 | 118 | if ($modx->hasPermission('new_snippet')) {
|
| 119 | - $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>' . $_lang['new_snippet'] . '</a></li>'; |
|
| 119 | + $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>'.$_lang['new_snippet'].'</a></li>'; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | break; |
@@ -124,13 +124,13 @@ discard block |
||
| 124 | 124 | case 'element_plugins': |
| 125 | 125 | $a = 102; |
| 126 | 126 | $sql = $modx->db->query('SELECT t1.*
|
| 127 | - FROM ' . $modx->getFullTableName('site_plugins') . ' AS t1
|
|
| 128 | - ' . $sqlLike . ' |
|
| 127 | + FROM ' . $modx->getFullTableName('site_plugins').' AS t1
|
|
| 128 | + ' . $sqlLike.' |
|
| 129 | 129 | ORDER BY t1.name ASC |
| 130 | 130 | ' . $sqlLimit); |
| 131 | 131 | |
| 132 | 132 | if ($modx->hasPermission('new_plugin')) {
|
| 133 | - $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>' . $_lang['new_plugin'] . '</a></li>'; |
|
| 133 | + $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>'.$_lang['new_plugin'].'</a></li>'; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | break; |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | continue; |
| 146 | 146 | } |
| 147 | 147 | |
| 148 | - $items .= '<li class="item ' . ($row['disabled'] ? 'disabled' : '') . ($row['locked'] ? ' locked' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main" data-parent-id="a_76__elements_' . $elements . '">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>' . "\n";
|
|
| 148 | + $items .= '<li class="item '.($row['disabled'] ? 'disabled' : '').($row['locked'] ? ' locked' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main" data-parent-id="a_76__elements_'.$elements.'">'.$row['name'].' <small>('.$row['id'].')</small></a></li>'."\n";
|
|
| 149 | 149 | } |
| 150 | 150 | } |
| 151 | 151 | |
@@ -166,18 +166,18 @@ discard block |
||
| 166 | 166 | $output = ''; |
| 167 | 167 | $items = ''; |
| 168 | 168 | $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : ''; |
| 169 | - $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->db->escape($filter) . '%"' : ''; |
|
| 170 | - $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
|
| 169 | + $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->db->escape($filter).'%"' : ''; |
|
| 170 | + $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit; |
|
| 171 | 171 | |
| 172 | 172 | $sql = $modx->db->query('SELECT t1.*, t1.username AS name, t2.blocked
|
| 173 | - FROM ' . $modx->getFullTableName('manager_users') . ' AS t1
|
|
| 174 | - LEFT JOIN ' . $modx->getFullTableName('user_attributes') . ' AS t2 ON t1.id=t2.internalKey
|
|
| 175 | - ' . $sqlLike . ' |
|
| 173 | + FROM ' . $modx->getFullTableName('manager_users').' AS t1
|
|
| 174 | + LEFT JOIN ' . $modx->getFullTableName('user_attributes').' AS t2 ON t1.id=t2.internalKey
|
|
| 175 | + ' . $sqlLike.' |
|
| 176 | 176 | ORDER BY t1.username ASC |
| 177 | 177 | ' . $sqlLimit); |
| 178 | 178 | |
| 179 | 179 | if ($modx->hasPermission('new_user')) {
|
| 180 | - $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>' . $_lang['new_user'] . '</a></li>'; |
|
| 180 | + $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>'.$_lang['new_user'].'</a></li>'; |
|
| 181 | 181 | } |
| 182 | 182 | |
| 183 | 183 | if ($count = $modx->db->getRecordCount($sql)) {
|
@@ -185,7 +185,7 @@ discard block |
||
| 185 | 185 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
| 186 | 186 | } |
| 187 | 187 | while ($row = $modx->db->getRow($sql)) {
|
| 188 | - $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
|
|
| 188 | + $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.$row['name'].' <small>('.$row['id'].')</small></a></li>';
|
|
| 189 | 189 | } |
| 190 | 190 | } |
| 191 | 191 | |
@@ -205,18 +205,18 @@ discard block |
||
| 205 | 205 | $output = ''; |
| 206 | 206 | $items = ''; |
| 207 | 207 | $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : ''; |
| 208 | - $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->db->escape($filter) . '%"' : ''; |
|
| 209 | - $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
|
| 208 | + $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->db->escape($filter).'%"' : ''; |
|
| 209 | + $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit; |
|
| 210 | 210 | |
| 211 | 211 | $sql = $modx->db->query('SELECT t1.*, t1.username AS name, t2.blocked
|
| 212 | - FROM ' . $modx->getFullTableName('web_users') . ' AS t1
|
|
| 213 | - LEFT JOIN ' . $modx->getFullTableName('web_user_attributes') . ' AS t2 ON t1.id=t2.internalKey
|
|
| 214 | - ' . $sqlLike . ' |
|
| 212 | + FROM ' . $modx->getFullTableName('web_users').' AS t1
|
|
| 213 | + LEFT JOIN ' . $modx->getFullTableName('web_user_attributes').' AS t2 ON t1.id=t2.internalKey
|
|
| 214 | + ' . $sqlLike.' |
|
| 215 | 215 | ORDER BY t1.username ASC |
| 216 | 216 | ' . $sqlLimit); |
| 217 | 217 | |
| 218 | 218 | if ($modx->hasPermission('new_web_user')) {
|
| 219 | - $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>' . $_lang['new_web_user'] . '</a></li>'; |
|
| 219 | + $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>'.$_lang['new_web_user'].'</a></li>'; |
|
| 220 | 220 | } |
| 221 | 221 | |
| 222 | 222 | if ($count = $modx->db->getRecordCount($sql)) {
|
@@ -224,7 +224,7 @@ discard block |
||
| 224 | 224 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
| 225 | 225 | } |
| 226 | 226 | while ($row = $modx->db->getRow($sql)) {
|
| 227 | - $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>';
|
|
| 227 | + $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.$row['name'].' <small>('.$row['id'].')</small></a></li>';
|
|
| 228 | 228 | } |
| 229 | 229 | } |
| 230 | 230 | |
@@ -250,35 +250,35 @@ discard block |
||
| 250 | 250 | case 'SnippetNoCache': {
|
| 251 | 251 | |
| 252 | 252 | $sql = $modx->db->query('SELECT *
|
| 253 | - FROM ' . $modx->getFullTableName('site_snippets') . '
|
|
| 254 | - WHERE name="' . $name . '" |
|
| 253 | + FROM ' . $modx->getFullTableName('site_snippets').'
|
|
| 254 | + WHERE name="' . $name.'" |
|
| 255 | 255 | LIMIT 1'); |
| 256 | 256 | |
| 257 | 257 | if ($modx->db->getRecordCount($sql)) {
|
| 258 | 258 | $row = $modx->db->getRow($sql); |
| 259 | 259 | $contextmenu = array( |
| 260 | 260 | 'header' => array( |
| 261 | - 'innerHTML' => '<i class="fa fa-code"></i> ' . $row['name'] |
|
| 261 | + 'innerHTML' => '<i class="fa fa-code"></i> '.$row['name'] |
|
| 262 | 262 | ), |
| 263 | 263 | 'item' => array( |
| 264 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
| 265 | - 'url' => "index.php?a=22&id=" . $row['id'] |
|
| 264 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
| 265 | + 'url' => "index.php?a=22&id=".$row['id'] |
|
| 266 | 266 | ) |
| 267 | 267 | ); |
| 268 | 268 | if (!empty($row['description'])) {
|
| 269 | 269 | $contextmenu['seperator'] = ''; |
| 270 | 270 | $contextmenu['description'] = array( |
| 271 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
|
| 271 | + 'innerHTML' => '<i class="fa fa-info"></i> '.$row['description'] |
|
| 272 | 272 | ); |
| 273 | 273 | } |
| 274 | 274 | } else {
|
| 275 | 275 | $contextmenu = array( |
| 276 | 276 | 'header' => array( |
| 277 | - 'innerHTML' => '<i class="fa fa-code"></i> ' . $name |
|
| 277 | + 'innerHTML' => '<i class="fa fa-code"></i> '.$name |
|
| 278 | 278 | ), |
| 279 | 279 | 'item' => array( |
| 280 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'], |
|
| 281 | - 'url' => "index.php?a=23&itemname=" . $name |
|
| 280 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'], |
|
| 281 | + 'url' => "index.php?a=23&itemname=".$name |
|
| 282 | 282 | ) |
| 283 | 283 | ); |
| 284 | 284 | } |
@@ -288,35 +288,35 @@ discard block |
||
| 288 | 288 | case 'Chunk' : {
|
| 289 | 289 | |
| 290 | 290 | $sql = $modx->db->query('SELECT *
|
| 291 | - FROM ' . $modx->getFullTableName('site_htmlsnippets') . '
|
|
| 292 | - WHERE name="' . $name . '" |
|
| 291 | + FROM ' . $modx->getFullTableName('site_htmlsnippets').'
|
|
| 292 | + WHERE name="' . $name.'" |
|
| 293 | 293 | LIMIT 1'); |
| 294 | 294 | |
| 295 | 295 | if ($modx->db->getRecordCount($sql)) {
|
| 296 | 296 | $row = $modx->db->getRow($sql); |
| 297 | 297 | $contextmenu = array( |
| 298 | 298 | 'header' => array( |
| 299 | - 'innerHTML' => '<i class="fa fa-th-large"></i> ' . $row['name'] |
|
| 299 | + 'innerHTML' => '<i class="fa fa-th-large"></i> '.$row['name'] |
|
| 300 | 300 | ), |
| 301 | 301 | 'item' => array( |
| 302 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
| 303 | - 'url' => "index.php?a=78&id=" . $row['id'] |
|
| 302 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
| 303 | + 'url' => "index.php?a=78&id=".$row['id'] |
|
| 304 | 304 | ) |
| 305 | 305 | ); |
| 306 | 306 | if (!empty($row['description'])) {
|
| 307 | 307 | $contextmenu['seperator'] = ''; |
| 308 | 308 | $contextmenu['description'] = array( |
| 309 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
|
| 309 | + 'innerHTML' => '<i class="fa fa-info"></i> '.$row['description'] |
|
| 310 | 310 | ); |
| 311 | 311 | } |
| 312 | 312 | } else {
|
| 313 | 313 | $contextmenu = array( |
| 314 | 314 | 'header' => array( |
| 315 | - 'innerHTML' => '<i class="fa fa-th-large"></i> ' . $name |
|
| 315 | + 'innerHTML' => '<i class="fa fa-th-large"></i> '.$name |
|
| 316 | 316 | ), |
| 317 | 317 | 'item' => array( |
| 318 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'], |
|
| 319 | - 'url' => "index.php?a=77&itemname=" . $name |
|
| 318 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'], |
|
| 319 | + 'url' => "index.php?a=77&itemname=".$name |
|
| 320 | 320 | ) |
| 321 | 321 | ); |
| 322 | 322 | } |
@@ -325,8 +325,8 @@ discard block |
||
| 325 | 325 | } |
| 326 | 326 | case 'AttributeValue': {
|
| 327 | 327 | $sql = $modx->db->query('SELECT *
|
| 328 | - FROM ' . $modx->getFullTableName('site_htmlsnippets') . '
|
|
| 329 | - WHERE name="' . $name . '" |
|
| 328 | + FROM ' . $modx->getFullTableName('site_htmlsnippets').'
|
|
| 329 | + WHERE name="' . $name.'" |
|
| 330 | 330 | LIMIT 1'); |
| 331 | 331 | |
| 332 | 332 | if ($modx->db->getRecordCount($sql)) {
|
@@ -336,52 +336,52 @@ discard block |
||
| 336 | 336 | 'innerText' => $row['name'] |
| 337 | 337 | ), |
| 338 | 338 | 'item' => array( |
| 339 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
| 340 | - 'url' => "index.php?a=78&id=" . $row['id'] |
|
| 339 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
| 340 | + 'url' => "index.php?a=78&id=".$row['id'] |
|
| 341 | 341 | ) |
| 342 | 342 | ); |
| 343 | 343 | if (!empty($row['description'])) {
|
| 344 | 344 | $contextmenu['seperator'] = ''; |
| 345 | 345 | $contextmenu['description'] = array( |
| 346 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
|
| 346 | + 'innerHTML' => '<i class="fa fa-info"></i> '.$row['description'] |
|
| 347 | 347 | ); |
| 348 | 348 | } |
| 349 | 349 | } else {
|
| 350 | 350 | |
| 351 | 351 | $sql = $modx->db->query('SELECT *
|
| 352 | - FROM ' . $modx->getFullTableName('site_snippets') . '
|
|
| 353 | - WHERE name="' . $name . '" |
|
| 352 | + FROM ' . $modx->getFullTableName('site_snippets').'
|
|
| 353 | + WHERE name="' . $name.'" |
|
| 354 | 354 | LIMIT 1'); |
| 355 | 355 | |
| 356 | 356 | if ($modx->db->getRecordCount($sql)) {
|
| 357 | 357 | $row = $modx->db->getRow($sql); |
| 358 | 358 | $contextmenu = array( |
| 359 | 359 | 'header' => array( |
| 360 | - 'innerHTML' => '<i class="fa fa-code"></i> ' . $row['name'] |
|
| 360 | + 'innerHTML' => '<i class="fa fa-code"></i> '.$row['name'] |
|
| 361 | 361 | ), |
| 362 | 362 | 'item' => array( |
| 363 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
| 364 | - 'url' => "index.php?a=22&id=" . $row['id'] |
|
| 363 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
| 364 | + 'url' => "index.php?a=22&id=".$row['id'] |
|
| 365 | 365 | ) |
| 366 | 366 | ); |
| 367 | 367 | if (!empty($row['description'])) {
|
| 368 | 368 | $contextmenu['seperator'] = ''; |
| 369 | 369 | $contextmenu['description'] = array( |
| 370 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
|
| 370 | + 'innerHTML' => '<i class="fa fa-info"></i> '.$row['description'] |
|
| 371 | 371 | ); |
| 372 | 372 | } |
| 373 | 373 | } else {
|
| 374 | 374 | $contextmenu = array( |
| 375 | 375 | 'header' => array( |
| 376 | - 'innerHTML' => '<i class="fa fa-code"></i> ' . $name |
|
| 376 | + 'innerHTML' => '<i class="fa fa-code"></i> '.$name |
|
| 377 | 377 | ), |
| 378 | 378 | 'item' => array( |
| 379 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'], |
|
| 380 | - 'url' => "index.php?a=77&itemname=" . $name |
|
| 379 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'], |
|
| 380 | + 'url' => "index.php?a=77&itemname=".$name |
|
| 381 | 381 | ), |
| 382 | 382 | 'item2' => array( |
| 383 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'], |
|
| 384 | - 'url' => "index.php?a=23&itemname=" . $name |
|
| 383 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'], |
|
| 384 | + 'url' => "index.php?a=23&itemname=".$name |
|
| 385 | 385 | ) |
| 386 | 386 | ); |
| 387 | 387 | } |
@@ -437,35 +437,35 @@ discard block |
||
| 437 | 437 | } |
| 438 | 438 | |
| 439 | 439 | $sql = $modx->db->query('SELECT *
|
| 440 | - FROM ' . $modx->getFullTableName('site_tmplvars') . '
|
|
| 441 | - WHERE name="' . $name . '" |
|
| 440 | + FROM ' . $modx->getFullTableName('site_tmplvars').'
|
|
| 441 | + WHERE name="' . $name.'" |
|
| 442 | 442 | LIMIT 1'); |
| 443 | 443 | |
| 444 | 444 | if ($modx->db->getRecordCount($sql)) {
|
| 445 | 445 | $row = $modx->db->getRow($sql); |
| 446 | 446 | $contextmenu = array( |
| 447 | 447 | 'header' => array( |
| 448 | - 'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $row['name'] |
|
| 448 | + 'innerHTML' => '<i class="fa fa-list-alt"></i> '.$row['name'] |
|
| 449 | 449 | ), |
| 450 | 450 | 'item' => array( |
| 451 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
| 452 | - 'url' => "index.php?a=301&id=" . $row['id'] |
|
| 451 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
| 452 | + 'url' => "index.php?a=301&id=".$row['id'] |
|
| 453 | 453 | ) |
| 454 | 454 | ); |
| 455 | 455 | if (!empty($row['description'])) {
|
| 456 | 456 | $contextmenu['seperator'] = ''; |
| 457 | 457 | $contextmenu['description'] = array( |
| 458 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
|
| 458 | + 'innerHTML' => '<i class="fa fa-info"></i> '.$row['description'] |
|
| 459 | 459 | ); |
| 460 | 460 | } |
| 461 | 461 | } else {
|
| 462 | 462 | $contextmenu = array( |
| 463 | 463 | 'header' => array( |
| 464 | - 'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $name |
|
| 464 | + 'innerHTML' => '<i class="fa fa-list-alt"></i> '.$name |
|
| 465 | 465 | ), |
| 466 | 466 | 'item' => array( |
| 467 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_tmplvars'], |
|
| 468 | - 'url' => "index.php?a=300&itemname=" . $name |
|
| 467 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_tmplvars'], |
|
| 468 | + 'url' => "index.php?a=300&itemname=".$name |
|
| 469 | 469 | ) |
| 470 | 470 | ); |
| 471 | 471 | } |
@@ -484,15 +484,15 @@ discard block |
||
| 484 | 484 | $json = array(); |
| 485 | 485 | |
| 486 | 486 | if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) {
|
| 487 | - $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : ''; |
|
| 488 | - $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0; |
|
| 487 | + $id = !empty($_REQUEST['id']) ? (int) $_REQUEST['id'] : ''; |
|
| 488 | + $parent = isset($_REQUEST['parent']) ? (int) $_REQUEST['parent'] : 0; |
|
| 489 | 489 | $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0; |
| 490 | 490 | |
| 491 | 491 | // set parent |
| 492 | 492 | if ($id && $parent >= 0) {
|
| 493 | 493 | |
| 494 | 494 | // find older parent |
| 495 | - $parentOld = $modx->db->getValue($modx->db->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id));
|
|
| 495 | + $parentOld = $modx->db->getValue($modx->db->select('parent', $modx->getFullTableName('site_content'), 'id='.$id));
|
|
| 496 | 496 | |
| 497 | 497 | $eventOut = $modx->invokeEvent('onBeforeMoveDocument', [
|
| 498 | 498 | 'id_document' => $id, |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | if (empty($json['errors'])) {
|
| 514 | 514 | // check privileges user for move docs |
| 515 | 515 | if (!empty($modx->config['tree_show_protected']) && $role != 1) {
|
| 516 | - $sql = $modx->db->select('*', $modx->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')');
|
|
| 516 | + $sql = $modx->db->select('*', $modx->getFullTableName('document_groups'), 'document IN('.$id.','.$parent.','.$parentOld.')');
|
|
| 517 | 517 | if ($modx->db->getRecordCount($sql)) {
|
| 518 | 518 | $document_groups = array(); |
| 519 | 519 | while ($row = $modx->db->getRow($sql)) {
|
@@ -538,22 +538,22 @@ discard block |
||
| 538 | 538 | // set new parent |
| 539 | 539 | $modx->db->update(array( |
| 540 | 540 | 'parent' => $parent |
| 541 | - ), $modx->getFullTableName('site_content'), 'id=' . $id);
|
|
| 541 | + ), $modx->getFullTableName('site_content'), 'id='.$id);
|
|
| 542 | 542 | // set parent isfolder = 1 |
| 543 | 543 | $modx->db->update(array( |
| 544 | 544 | 'isfolder' => 1 |
| 545 | - ), $modx->getFullTableName('site_content'), 'id=' . $parent);
|
|
| 545 | + ), $modx->getFullTableName('site_content'), 'id='.$parent);
|
|
| 546 | 546 | |
| 547 | 547 | if ($parent != $parentOld) {
|
| 548 | 548 | // check children docs and set parent isfolder |
| 549 | - if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) {
|
|
| 549 | + if ($modx->db->getRecordCount($modx->db->select('id', $modx->getFullTableName('site_content'), 'parent='.$parentOld))) {
|
|
| 550 | 550 | $modx->db->update(array( |
| 551 | 551 | 'isfolder' => 1 |
| 552 | - ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
|
|
| 552 | + ), $modx->getFullTableName('site_content'), 'id='.$parentOld);
|
|
| 553 | 553 | } else {
|
| 554 | 554 | $modx->db->update(array( |
| 555 | 555 | 'isfolder' => 0 |
| 556 | - ), $modx->getFullTableName('site_content'), 'id=' . $parentOld);
|
|
| 556 | + ), $modx->getFullTableName('site_content'), 'id='.$parentOld);
|
|
| 557 | 557 | } |
| 558 | 558 | } |
| 559 | 559 | |
@@ -561,7 +561,7 @@ discard block |
||
| 561 | 561 | if (!empty($menuindex)) {
|
| 562 | 562 | $menuindex = explode(',', $menuindex);
|
| 563 | 563 | foreach ($menuindex as $key => $value) {
|
| 564 | - $modx->db->query('UPDATE ' . $modx->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value);
|
|
| 564 | + $modx->db->query('UPDATE '.$modx->getFullTableName('site_content').' SET menuindex='.$key.' WHERE id='.$value);
|
|
| 565 | 565 | } |
| 566 | 566 | } else {
|
| 567 | 567 | // TODO: max(*) menuindex |
@@ -590,19 +590,19 @@ discard block |
||
| 590 | 590 | } |
| 591 | 591 | |
| 592 | 592 | case 'getLockedElements': {
|
| 593 | - $type = isset($_REQUEST['type']) ? (int)$_REQUEST['type'] : 0; |
|
| 594 | - $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
| 593 | + $type = isset($_REQUEST['type']) ? (int) $_REQUEST['type'] : 0; |
|
| 594 | + $id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 595 | 595 | |
| 596 | 596 | $output = !!$modx->elementIsLocked($type, $id, true); |
| 597 | 597 | |
| 598 | 598 | if (!$output) {
|
| 599 | 599 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : '';
|
| 600 | - $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : '';
|
|
| 600 | + $docgrp_cond = $docgrp ? ' OR dg.document_group IN ('.$docgrp.')' : '';
|
|
| 601 | 601 | $sql = ' |
| 602 | - SELECT MAX(IF(1=' . $role . ' OR sc.privatemgr=0' . $docgrp_cond . ', 0, 1)) AS locked |
|
| 603 | - FROM ' . $modx->getFullTableName('site_content') . ' AS sc
|
|
| 604 | - LEFT JOIN ' . $modx->getFullTableName('document_groups') . ' dg ON dg.document=sc.id
|
|
| 605 | - WHERE sc.id=' . $id . ' GROUP BY sc.id'; |
|
| 602 | + SELECT MAX(IF(1=' . $role.' OR sc.privatemgr=0'.$docgrp_cond.', 0, 1)) AS locked |
|
| 603 | + FROM ' . $modx->getFullTableName('site_content').' AS sc
|
|
| 604 | + LEFT JOIN ' . $modx->getFullTableName('document_groups').' dg ON dg.document=sc.id
|
|
| 605 | + WHERE sc.id=' . $id.' GROUP BY sc.id'; |
|
| 606 | 606 | $sql = $modx->db->query($sql); |
| 607 | 607 | if ($modx->db->getRecordCount($sql)) {
|
| 608 | 608 | $row = $modx->db->getRow($sql); |
@@ -11,12 +11,12 @@ discard block |
||
| 11 | 11 | $style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/'; |
| 12 | 12 | $modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php'; |
| 13 | 13 | if(!$modx->config['lang_code']) {
|
| 14 | - global $modx_lang_attribute; |
|
| 15 | - $modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; |
|
| 14 | + global $modx_lang_attribute; |
|
| 15 | + $modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; |
|
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | if($_GET['a'] == 2) {
|
| 19 | - include_once('welcome.php');
|
|
| 19 | + include_once('welcome.php');
|
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | // Favicon |
@@ -274,66 +274,66 @@ discard block |
||
| 274 | 274 | $addnew = 0; |
| 275 | 275 | $run = 0; |
| 276 | 276 | switch($action) {
|
| 277 | - case '3': |
|
| 278 | - case '4': |
|
| 279 | - case '27': |
|
| 280 | - case '72': |
|
| 281 | - if($modx->hasPermission('new_document')) {
|
|
| 282 | - $addnew = 1; |
|
| 283 | - } |
|
| 284 | - break; |
|
| 285 | - case '16': |
|
| 286 | - case '19': |
|
| 287 | - if($modx->hasPermission('new_template')) {
|
|
| 288 | - $addnew = 1; |
|
| 289 | - } |
|
| 290 | - break; |
|
| 291 | - case '300': |
|
| 292 | - case '301': |
|
| 293 | - if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
|
|
| 294 | - $addnew = 1; |
|
| 295 | - } |
|
| 296 | - break; |
|
| 297 | - case '77': |
|
| 298 | - case '78': |
|
| 299 | - if($modx->hasPermission('new_chunk')) {
|
|
| 300 | - $addnew = 1; |
|
| 301 | - } |
|
| 302 | - break; |
|
| 303 | - case '22': |
|
| 304 | - case '23': |
|
| 305 | - if($modx->hasPermission('new_snippet')) {
|
|
| 306 | - $addnew = 1; |
|
| 307 | - } |
|
| 308 | - break; |
|
| 309 | - case '101': |
|
| 310 | - case '102': |
|
| 311 | - if($modx->hasPermission('new_plugin')) {
|
|
| 312 | - $addnew = 1; |
|
| 313 | - } |
|
| 314 | - break; |
|
| 315 | - case '106': |
|
| 316 | - case '107': |
|
| 317 | - case '108': |
|
| 318 | - if($modx->hasPermission('new_module')) {
|
|
| 319 | - $addnew = 1; |
|
| 320 | - } |
|
| 321 | - if($modx->hasPermission('exec_module')) {
|
|
| 322 | - $run = 1; |
|
| 323 | - } |
|
| 324 | - break; |
|
| 325 | - case '88': |
|
| 326 | - if($modx->hasPermission('new_web_user')) {
|
|
| 327 | - $addnew = 1; |
|
| 328 | - } |
|
| 329 | - break; |
|
| 277 | + case '3': |
|
| 278 | + case '4': |
|
| 279 | + case '27': |
|
| 280 | + case '72': |
|
| 281 | + if($modx->hasPermission('new_document')) {
|
|
| 282 | + $addnew = 1; |
|
| 283 | + } |
|
| 284 | + break; |
|
| 285 | + case '16': |
|
| 286 | + case '19': |
|
| 287 | + if($modx->hasPermission('new_template')) {
|
|
| 288 | + $addnew = 1; |
|
| 289 | + } |
|
| 290 | + break; |
|
| 291 | + case '300': |
|
| 292 | + case '301': |
|
| 293 | + if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
|
|
| 294 | + $addnew = 1; |
|
| 295 | + } |
|
| 296 | + break; |
|
| 297 | + case '77': |
|
| 298 | + case '78': |
|
| 299 | + if($modx->hasPermission('new_chunk')) {
|
|
| 300 | + $addnew = 1; |
|
| 301 | + } |
|
| 302 | + break; |
|
| 303 | + case '22': |
|
| 304 | + case '23': |
|
| 305 | + if($modx->hasPermission('new_snippet')) {
|
|
| 306 | + $addnew = 1; |
|
| 307 | + } |
|
| 308 | + break; |
|
| 309 | + case '101': |
|
| 310 | + case '102': |
|
| 311 | + if($modx->hasPermission('new_plugin')) {
|
|
| 312 | + $addnew = 1; |
|
| 313 | + } |
|
| 314 | + break; |
|
| 315 | + case '106': |
|
| 316 | + case '107': |
|
| 317 | + case '108': |
|
| 318 | + if($modx->hasPermission('new_module')) {
|
|
| 319 | + $addnew = 1; |
|
| 320 | + } |
|
| 321 | + if($modx->hasPermission('exec_module')) {
|
|
| 322 | + $run = 1; |
|
| 323 | + } |
|
| 324 | + break; |
|
| 325 | + case '88': |
|
| 326 | + if($modx->hasPermission('new_web_user')) {
|
|
| 327 | + $addnew = 1; |
|
| 328 | + } |
|
| 329 | + break; |
|
| 330 | 330 | } |
| 331 | 331 | |
| 332 | 332 | $disabled = ($action == '19' || $action == '300' || $action == '77' || $action == '23' || $action == '101' || $action == '4' || $action == '72' || $action == '87' || $action == '11' || $action == '107' || $action == '38') ? ' disabled' : ''; |
| 333 | 333 | |
| 334 | 334 | $_style['actionbuttons'] = array( |
| 335 | - 'dynamic' => array( |
|
| 336 | - 'document' => '<div id="actions"> |
|
| 335 | + 'dynamic' => array( |
|
| 336 | + 'document' => '<div id="actions"> |
|
| 337 | 337 | <div class="btn-group"> |
| 338 | 338 | <div class="btn-group"> |
| 339 | 339 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
@@ -348,7 +348,7 @@ discard block |
||
| 348 | 348 | <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option> |
| 349 | 349 | </select> |
| 350 | 350 | </div>' . |
| 351 | - ($addnew ? ' |
|
| 351 | + ($addnew ? ' |
|
| 352 | 352 | <a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();"> |
| 353 | 353 | <i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span> |
| 354 | 354 | </a> |
@@ -364,7 +364,7 @@ discard block |
||
| 364 | 364 | </a> |
| 365 | 365 | </div> |
| 366 | 366 | </div>', |
| 367 | - 'user' => '<div id="actions"> |
|
| 367 | + 'user' => '<div id="actions"> |
|
| 368 | 368 | <div class="btn-group"> |
| 369 | 369 | <div class="btn-group"> |
| 370 | 370 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
@@ -387,7 +387,7 @@ discard block |
||
| 387 | 387 | </a> |
| 388 | 388 | </div> |
| 389 | 389 | </div>', |
| 390 | - 'element' => '<div id="actions"> |
|
| 390 | + 'element' => '<div id="actions"> |
|
| 391 | 391 | <div class="btn-group"> |
| 392 | 392 | <div class="btn-group"> |
| 393 | 393 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
@@ -420,21 +420,21 @@ discard block |
||
| 420 | 420 | ' : '') . ' |
| 421 | 421 | </div> |
| 422 | 422 | </div>', |
| 423 | - 'newmodule' => ($addnew ? '<div id="actions"> |
|
| 423 | + 'newmodule' => ($addnew ? '<div id="actions"> |
|
| 424 | 424 | <div class="btn-group"> |
| 425 | 425 | <a id="newModule" class="btn btn-secondary" href="javascript:;" onclick="actions.new();"> |
| 426 | 426 | <i class="' . $_style["actions_new"] . '"></i><span>' . $_lang['new_module'] . '</span> |
| 427 | 427 | </a> |
| 428 | 428 | </div> |
| 429 | 429 | </div>' : ''), |
| 430 | - 'close' => '<div id="actions"> |
|
| 430 | + 'close' => '<div id="actions"> |
|
| 431 | 431 | <div class="btn-group"> |
| 432 | 432 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.close();"> |
| 433 | 433 | <i class="' . $_style["actions_close"] . '"></i><span>' . $_lang['close'] . '</span> |
| 434 | 434 | </a> |
| 435 | 435 | </div> |
| 436 | 436 | </div>', |
| 437 | - 'save' => '<div id="actions"> |
|
| 437 | + 'save' => '<div id="actions"> |
|
| 438 | 438 | <div class="btn-group"> |
| 439 | 439 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
| 440 | 440 | <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
@@ -444,7 +444,7 @@ discard block |
||
| 444 | 444 | </a> |
| 445 | 445 | </div> |
| 446 | 446 | </div>', |
| 447 | - 'savedelete' => '<div id="actions"> |
|
| 447 | + 'savedelete' => '<div id="actions"> |
|
| 448 | 448 | <div class="btn-group"> |
| 449 | 449 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
| 450 | 450 | <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
@@ -457,14 +457,14 @@ discard block |
||
| 457 | 457 | </a> |
| 458 | 458 | </div> |
| 459 | 459 | </div>', |
| 460 | - 'cancel' => '<div id="actions"> |
|
| 460 | + 'cancel' => '<div id="actions"> |
|
| 461 | 461 | <div class="btn-group"> |
| 462 | 462 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 463 | 463 | <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
| 464 | 464 | </a> |
| 465 | 465 | </div> |
| 466 | 466 | </div>', |
| 467 | - 'canceldelete' => '<div id="actions"> |
|
| 467 | + 'canceldelete' => '<div id="actions"> |
|
| 468 | 468 | <div class="btn-group"> |
| 469 | 469 | <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
| 470 | 470 | <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
@@ -474,11 +474,11 @@ discard block |
||
| 474 | 474 | </a> |
| 475 | 475 | </div> |
| 476 | 476 | </div>', |
| 477 | - ), |
|
| 478 | - 'static' => array( |
|
| 479 | - 'document' => '<div id="actions"> |
|
| 477 | + ), |
|
| 478 | + 'static' => array( |
|
| 479 | + 'document' => '<div id="actions"> |
|
| 480 | 480 | <div class="btn-group">' . |
| 481 | - ($addnew ? ' |
|
| 481 | + ($addnew ? ' |
|
| 482 | 482 | <a class="btn btn-secondary" href="javascript:;" onclick="actions.new();"> |
| 483 | 483 | <i class="' . $_style["icons_new_document"] . '"></i><span>' . $_lang['create_resource_here'] . '</span> |
| 484 | 484 | </a> |
@@ -503,12 +503,12 @@ discard block |
||
| 503 | 503 | </a> |
| 504 | 504 | </div> |
| 505 | 505 | </div>', |
| 506 | - 'cancel' => '<div id="actions"> |
|
| 506 | + 'cancel' => '<div id="actions"> |
|
| 507 | 507 | <div class="btn-group"> |
| 508 | 508 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 509 | 509 | <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
| 510 | 510 | </a> |
| 511 | 511 | </div> |
| 512 | 512 | </div>', |
| 513 | - ) |
|
| 513 | + ) |
|
| 514 | 514 | ); |
@@ -8,19 +8,19 @@ discard block |
||
| 8 | 8 | * Version: 1.1 |
| 9 | 9 | * MODX version: 1.0.3 |
| 10 | 10 | */ |
| 11 | -$style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/'; |
|
| 11 | +$style_path = 'media/style/'.$modx->config['manager_theme'].'/images/'; |
|
| 12 | 12 | $modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php'; |
| 13 | -if(!$modx->config['lang_code']) {
|
|
| 13 | +if (!$modx->config['lang_code']) {
|
|
| 14 | 14 | global $modx_lang_attribute; |
| 15 | 15 | $modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | -if($_GET['a'] == 2) {
|
|
| 18 | +if ($_GET['a'] == 2) {
|
|
| 19 | 19 | include_once('welcome.php');
|
| 20 | 20 | } |
| 21 | 21 | |
| 22 | 22 | // Favicon |
| 23 | -$_style['favicon'] = (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . $modx->config['manager_theme'] . '/images/favicon.ico'); |
|
| 23 | +$_style['favicon'] = (file_exists(MODX_BASE_PATH.'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/'.$modx->config['manager_theme'].'/images/favicon.ico'); |
|
| 24 | 24 | |
| 25 | 25 | //Main Menu |
| 26 | 26 | $_style['menu_search'] = '<i class="fa fa-search"></i>'; |
@@ -99,10 +99,10 @@ discard block |
||
| 99 | 99 | $_style['tree_page_word'] = "<i class='fa fa-file-word-o'></i>"; |
| 100 | 100 | $_style['tree_page_excel'] = "<i class='fa fa-file-excel-o'></i>"; |
| 101 | 101 | |
| 102 | -$_style['tree_minusnode'] = "<i class='fa fa-angle-down'></i>";//$style_path.'tree/angle-down.png'; |
|
| 103 | -$_style['tree_plusnode'] = "<i class='fa fa-angle-right'></i>";//$style_path.'tree/angle-right.png'; |
|
| 102 | +$_style['tree_minusnode'] = "<i class='fa fa-angle-down'></i>"; //$style_path.'tree/angle-down.png'; |
|
| 103 | +$_style['tree_plusnode'] = "<i class='fa fa-angle-right'></i>"; //$style_path.'tree/angle-right.png'; |
|
| 104 | 104 | $_style['tree_weblink'] = $style_path.'tree/link.png'; |
| 105 | -$_style['tree_preview_resource'] = "<i class='fa fa-eye'></i>";//$style_path.'icons/eye.png'; |
|
| 105 | +$_style['tree_preview_resource'] = "<i class='fa fa-eye'></i>"; //$style_path.'icons/eye.png'; |
|
| 106 | 106 | |
| 107 | 107 | $_style['tree_showtree'] = '<i class="fa fa-sitemap"></i>'; |
| 108 | 108 | $_style['tree_working'] = '<i class="fa fa-warning"></i>'; |
@@ -137,8 +137,8 @@ discard block |
||
| 137 | 137 | $_style['icons_edit_document'] = $style_path.'icons/save.png'; |
| 138 | 138 | $_style['icons_delete_document'] = $style_path.'icons/trash.png'; |
| 139 | 139 | //locks |
| 140 | -$_style['icons_preview_resource'] = $style_path.'icons/eye.png';//$style_path.'icons/eye.png'; |
|
| 141 | -$_style['icons_secured'] = "<i class='fa fa-lock'></i>";//$style_path.'icons/lock.png'; |
|
| 140 | +$_style['icons_preview_resource'] = $style_path.'icons/eye.png'; //$style_path.'icons/eye.png'; |
|
| 141 | +$_style['icons_secured'] = "<i class='fa fa-lock'></i>"; //$style_path.'icons/lock.png'; |
|
| 142 | 142 | |
| 143 | 143 | //file manager icons |
| 144 | 144 | $_style['files_save'] = 'fa fa-floppy-o'; |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | $_style['icons_set_parent'] = $style_path.'icons/folder-open.png'; |
| 214 | 214 | |
| 215 | 215 | //modules |
| 216 | -$_style['icons_module'] = 'fa fa-cube'; |
|
| 216 | +$_style['icons_module'] = 'fa fa-cube'; |
|
| 217 | 217 | $_style['icons_modules'] = 'fa fa-cubes'; //$style_path.'icons/modules.png'; |
| 218 | 218 | $_style['icons_run'] = $style_path.'icons/play.png'; |
| 219 | 219 | |
@@ -273,57 +273,57 @@ discard block |
||
| 273 | 273 | $stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : ''; |
| 274 | 274 | $addnew = 0; |
| 275 | 275 | $run = 0; |
| 276 | -switch($action) {
|
|
| 276 | +switch ($action) {
|
|
| 277 | 277 | case '3': |
| 278 | 278 | case '4': |
| 279 | 279 | case '27': |
| 280 | 280 | case '72': |
| 281 | - if($modx->hasPermission('new_document')) {
|
|
| 281 | + if ($modx->hasPermission('new_document')) {
|
|
| 282 | 282 | $addnew = 1; |
| 283 | 283 | } |
| 284 | 284 | break; |
| 285 | 285 | case '16': |
| 286 | 286 | case '19': |
| 287 | - if($modx->hasPermission('new_template')) {
|
|
| 287 | + if ($modx->hasPermission('new_template')) {
|
|
| 288 | 288 | $addnew = 1; |
| 289 | 289 | } |
| 290 | 290 | break; |
| 291 | 291 | case '300': |
| 292 | 292 | case '301': |
| 293 | - if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
|
|
| 293 | + if ($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
|
|
| 294 | 294 | $addnew = 1; |
| 295 | 295 | } |
| 296 | 296 | break; |
| 297 | 297 | case '77': |
| 298 | 298 | case '78': |
| 299 | - if($modx->hasPermission('new_chunk')) {
|
|
| 299 | + if ($modx->hasPermission('new_chunk')) {
|
|
| 300 | 300 | $addnew = 1; |
| 301 | 301 | } |
| 302 | 302 | break; |
| 303 | 303 | case '22': |
| 304 | 304 | case '23': |
| 305 | - if($modx->hasPermission('new_snippet')) {
|
|
| 305 | + if ($modx->hasPermission('new_snippet')) {
|
|
| 306 | 306 | $addnew = 1; |
| 307 | 307 | } |
| 308 | 308 | break; |
| 309 | 309 | case '101': |
| 310 | 310 | case '102': |
| 311 | - if($modx->hasPermission('new_plugin')) {
|
|
| 311 | + if ($modx->hasPermission('new_plugin')) {
|
|
| 312 | 312 | $addnew = 1; |
| 313 | 313 | } |
| 314 | 314 | break; |
| 315 | 315 | case '106': |
| 316 | 316 | case '107': |
| 317 | 317 | case '108': |
| 318 | - if($modx->hasPermission('new_module')) {
|
|
| 318 | + if ($modx->hasPermission('new_module')) {
|
|
| 319 | 319 | $addnew = 1; |
| 320 | 320 | } |
| 321 | - if($modx->hasPermission('exec_module')) {
|
|
| 321 | + if ($modx->hasPermission('exec_module')) {
|
|
| 322 | 322 | $run = 1; |
| 323 | 323 | } |
| 324 | 324 | break; |
| 325 | 325 | case '88': |
| 326 | - if($modx->hasPermission('new_web_user')) {
|
|
| 326 | + if ($modx->hasPermission('new_web_user')) {
|
|
| 327 | 327 | $addnew = 1; |
| 328 | 328 | } |
| 329 | 329 | break; |
@@ -337,30 +337,30 @@ discard block |
||
| 337 | 337 | <div class="btn-group"> |
| 338 | 338 | <div class="btn-group"> |
| 339 | 339 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
| 340 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
| 340 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
| 341 | 341 | </a> |
| 342 | 342 | <span class="btn btn-success plus dropdown-toggle"></span> |
| 343 | 343 | <select id="stay" name="stay"> |
| 344 | 344 | ' . ($addnew ? ' |
| 345 | - <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option> |
|
| 346 | - ' : '') . ' |
|
| 347 | - <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option> |
|
| 348 | - <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option> |
|
| 345 | + <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option> |
|
| 346 | + ' : '').' |
|
| 347 | + <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option> |
|
| 348 | + <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option> |
|
| 349 | 349 | </select> |
| 350 | 350 | </div>' . |
| 351 | 351 | ($addnew ? ' |
| 352 | - <a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();"> |
|
| 353 | - <i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span> |
|
| 352 | + <a id="Button6" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.duplicate();"> |
|
| 353 | + <i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span> |
|
| 354 | 354 | </a> |
| 355 | - ' : '') . ' |
|
| 356 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
| 357 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
| 355 | + ' : '').' |
|
| 356 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
| 357 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
| 358 | 358 | </a> |
| 359 | 359 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 360 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 360 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 361 | 361 | </a> |
| 362 | 362 | <a id="Button4" class="btn btn-secondary" href="javascript:;" onclick="actions.view();"> |
| 363 | - <i class="' . $_style["actions_preview"] . '"></i><span>' . $_lang['preview'] . '</span> |
|
| 363 | + <i class="' . $_style["actions_preview"].'"></i><span>'.$_lang['preview'].'</span> |
|
| 364 | 364 | </a> |
| 365 | 365 | </div> |
| 366 | 366 | </div>', |
@@ -368,22 +368,22 @@ discard block |
||
| 368 | 368 | <div class="btn-group"> |
| 369 | 369 | <div class="btn-group"> |
| 370 | 370 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
| 371 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
| 371 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
| 372 | 372 | </a> |
| 373 | 373 | <span class="btn btn-success plus dropdown-toggle"></span> |
| 374 | 374 | <select id="stay" name="stay"> |
| 375 | 375 | ' . ($addnew ? ' |
| 376 | - <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option> |
|
| 377 | - ' : '') . ' |
|
| 378 | - <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option> |
|
| 379 | - <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option> |
|
| 376 | + <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option> |
|
| 377 | + ' : '').' |
|
| 378 | + <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option> |
|
| 379 | + <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option> |
|
| 380 | 380 | </select> |
| 381 | 381 | </div> |
| 382 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
| 383 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
| 382 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
| 383 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
| 384 | 384 | </a> |
| 385 | 385 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 386 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 386 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 387 | 387 | </a> |
| 388 | 388 | </div> |
| 389 | 389 | </div>', |
@@ -391,86 +391,86 @@ discard block |
||
| 391 | 391 | <div class="btn-group"> |
| 392 | 392 | <div class="btn-group"> |
| 393 | 393 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
| 394 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
| 394 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
| 395 | 395 | </a> |
| 396 | 396 | <span class="btn btn-success plus dropdown-toggle"></span> |
| 397 | 397 | <select id="stay" name="stay"> |
| 398 | 398 | ' . ($addnew ? ' |
| 399 | - <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option> |
|
| 400 | - ' : '') . ' |
|
| 401 | - <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option> |
|
| 402 | - <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option> |
|
| 399 | + <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option> |
|
| 400 | + ' : '').' |
|
| 401 | + <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option> |
|
| 402 | + <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option> |
|
| 403 | 403 | </select> |
| 404 | 404 | </div> |
| 405 | 405 | ' . ($addnew ? ' |
| 406 | - <a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();"> |
|
| 407 | - <i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span> |
|
| 406 | + <a id="Button6" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.duplicate();"> |
|
| 407 | + <i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span> |
|
| 408 | 408 | </a> |
| 409 | - ' : '') . ' |
|
| 410 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
| 411 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
| 409 | + ' : '').' |
|
| 410 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
| 411 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
| 412 | 412 | </a> |
| 413 | 413 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 414 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 414 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 415 | 415 | </a> |
| 416 | 416 | ' . ($run ? ' |
| 417 | - <a id="Button4" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.run();"> |
|
| 418 | - <i class="' . $_style["actions_run"] . '"></i><span>' . $_lang['run_module'] . '</span> |
|
| 417 | + <a id="Button4" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.run();"> |
|
| 418 | + <i class="' . $_style["actions_run"].'"></i><span>'.$_lang['run_module'].'</span> |
|
| 419 | 419 | </a> |
| 420 | - ' : '') . ' |
|
| 420 | + ' : '').' |
|
| 421 | 421 | </div> |
| 422 | 422 | </div>', |
| 423 | 423 | 'newmodule' => ($addnew ? '<div id="actions"> |
| 424 | 424 | <div class="btn-group"> |
| 425 | 425 | <a id="newModule" class="btn btn-secondary" href="javascript:;" onclick="actions.new();"> |
| 426 | - <i class="' . $_style["actions_new"] . '"></i><span>' . $_lang['new_module'] . '</span> |
|
| 426 | + <i class="' . $_style["actions_new"].'"></i><span>'.$_lang['new_module'].'</span> |
|
| 427 | 427 | </a> |
| 428 | 428 | </div> |
| 429 | 429 | </div>' : ''), |
| 430 | 430 | 'close' => '<div id="actions"> |
| 431 | 431 | <div class="btn-group"> |
| 432 | 432 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.close();"> |
| 433 | - <i class="' . $_style["actions_close"] . '"></i><span>' . $_lang['close'] . '</span> |
|
| 433 | + <i class="' . $_style["actions_close"].'"></i><span>'.$_lang['close'].'</span> |
|
| 434 | 434 | </a> |
| 435 | 435 | </div> |
| 436 | 436 | </div>', |
| 437 | 437 | 'save' => '<div id="actions"> |
| 438 | 438 | <div class="btn-group"> |
| 439 | 439 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
| 440 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
| 440 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
| 441 | 441 | </a> |
| 442 | 442 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 443 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 443 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 444 | 444 | </a> |
| 445 | 445 | </div> |
| 446 | 446 | </div>', |
| 447 | 447 | 'savedelete' => '<div id="actions"> |
| 448 | 448 | <div class="btn-group"> |
| 449 | 449 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
| 450 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
| 450 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
| 451 | 451 | </a> |
| 452 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
| 453 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
| 452 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
| 453 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
| 454 | 454 | </a> |
| 455 | 455 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 456 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 456 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 457 | 457 | </a> |
| 458 | 458 | </div> |
| 459 | 459 | </div>', |
| 460 | 460 | 'cancel' => '<div id="actions"> |
| 461 | 461 | <div class="btn-group"> |
| 462 | 462 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 463 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 463 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 464 | 464 | </a> |
| 465 | 465 | </div> |
| 466 | 466 | </div>', |
| 467 | 467 | 'canceldelete' => '<div id="actions"> |
| 468 | 468 | <div class="btn-group"> |
| 469 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
| 470 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
| 469 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
| 470 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
| 471 | 471 | </a> |
| 472 | 472 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 473 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 473 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 474 | 474 | </a> |
| 475 | 475 | </div> |
| 476 | 476 | </div>', |
@@ -480,33 +480,33 @@ discard block |
||
| 480 | 480 | <div class="btn-group">' . |
| 481 | 481 | ($addnew ? ' |
| 482 | 482 | <a class="btn btn-secondary" href="javascript:;" onclick="actions.new();"> |
| 483 | - <i class="' . $_style["icons_new_document"] . '"></i><span>' . $_lang['create_resource_here'] . '</span> |
|
| 483 | + <i class="' . $_style["icons_new_document"].'"></i><span>'.$_lang['create_resource_here'].'</span> |
|
| 484 | 484 | </a> |
| 485 | 485 | <a class="btn btn-secondary" href="javascript:;" onclick="actions.newlink();"> |
| 486 | - <i class="' . $_style["icons_new_weblink"] . '"></i><span>' . $_lang['create_weblink_here'] . '</span> |
|
| 486 | + <i class="' . $_style["icons_new_weblink"].'"></i><span>'.$_lang['create_weblink_here'].'</span> |
|
| 487 | 487 | </a> |
| 488 | - ' : '') . ' |
|
| 488 | + ' : '').' |
|
| 489 | 489 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.edit();"> |
| 490 | - <i class="' . $_style["actions_edit"] . '"></i><span>' . $_lang['edit'] . '</span> |
|
| 490 | + <i class="' . $_style["actions_edit"].'"></i><span>'.$_lang['edit'].'</span> |
|
| 491 | 491 | </a> |
| 492 | 492 | <a id="Button2" class="btn btn-secondary" href="javascript:;" onclick="actions.move();"> |
| 493 | - <i class="' . $_style["actions_move"] . '"></i><span>' . $_lang['move'] . '</span> |
|
| 493 | + <i class="' . $_style["actions_move"].'"></i><span>'.$_lang['move'].'</span> |
|
| 494 | 494 | </a> |
| 495 | 495 | <a id="Button6" class="btn btn-secondary" href="javascript:;" onclick="actions.duplicate();"> |
| 496 | - <i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span> |
|
| 496 | + <i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span> |
|
| 497 | 497 | </a> |
| 498 | 498 | <a id="Button3" class="btn btn-secondary" href="javascript:;" onclick="actions.delete();"> |
| 499 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
| 499 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
| 500 | 500 | </a> |
| 501 | 501 | <a id="Button4" class="btn btn-secondary" href="javascript:;" onclick="actions.view();"> |
| 502 | - <i class="' . $_style["actions_preview"] . '"></i><span>' . $_lang['preview'] . '</span> |
|
| 502 | + <i class="' . $_style["actions_preview"].'"></i><span>'.$_lang['preview'].'</span> |
|
| 503 | 503 | </a> |
| 504 | 504 | </div> |
| 505 | 505 | </div>', |
| 506 | 506 | 'cancel' => '<div id="actions"> |
| 507 | 507 | <div class="btn-group"> |
| 508 | 508 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
| 509 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
| 509 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
| 510 | 510 | </a> |
| 511 | 511 | </div> |
| 512 | 512 | </div>', |
@@ -10,12 +10,12 @@ discard block |
||
| 10 | 10 | */ |
| 11 | 11 | $style_path = 'media/style/' . $modx->config['manager_theme'] . '/images/'; |
| 12 | 12 | $modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php'; |
| 13 | -if(!$modx->config['lang_code']) {
|
|
| 13 | +if(!$modx->config['lang_code']) { |
|
| 14 | 14 | global $modx_lang_attribute; |
| 15 | 15 | $modx->config['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | -if($_GET['a'] == 2) {
|
|
| 18 | +if($_GET['a'] == 2) { |
|
| 19 | 19 | include_once('welcome.php');
|
| 20 | 20 | } |
| 21 | 21 | |
@@ -262,68 +262,68 @@ discard block |
||
| 262 | 262 | |
| 263 | 263 | // actions buttons templates |
| 264 | 264 | $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : ''; |
| 265 | -if (!empty($modx->config['global_tabs']) && !isset($_SESSION['stay'])) {
|
|
| 265 | +if (!empty($modx->config['global_tabs']) && !isset($_SESSION['stay'])) { |
|
| 266 | 266 | $_REQUEST['stay'] = 2; |
| 267 | 267 | } |
| 268 | -if (isset($_REQUEST['stay'])) {
|
|
| 268 | +if (isset($_REQUEST['stay'])) { |
|
| 269 | 269 | $_SESSION['stay'] = $_REQUEST['stay']; |
| 270 | -} else if (isset($_SESSION['stay'])) {
|
|
| 270 | +} else if (isset($_SESSION['stay'])) { |
|
| 271 | 271 | $_REQUEST['stay'] = $_SESSION['stay']; |
| 272 | 272 | } |
| 273 | 273 | $stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : ''; |
| 274 | 274 | $addnew = 0; |
| 275 | 275 | $run = 0; |
| 276 | -switch($action) {
|
|
| 276 | +switch($action) { |
|
| 277 | 277 | case '3': |
| 278 | 278 | case '4': |
| 279 | 279 | case '27': |
| 280 | 280 | case '72': |
| 281 | - if($modx->hasPermission('new_document')) {
|
|
| 281 | + if($modx->hasPermission('new_document')) { |
|
| 282 | 282 | $addnew = 1; |
| 283 | 283 | } |
| 284 | 284 | break; |
| 285 | 285 | case '16': |
| 286 | 286 | case '19': |
| 287 | - if($modx->hasPermission('new_template')) {
|
|
| 287 | + if($modx->hasPermission('new_template')) { |
|
| 288 | 288 | $addnew = 1; |
| 289 | 289 | } |
| 290 | 290 | break; |
| 291 | 291 | case '300': |
| 292 | 292 | case '301': |
| 293 | - if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) {
|
|
| 293 | + if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) { |
|
| 294 | 294 | $addnew = 1; |
| 295 | 295 | } |
| 296 | 296 | break; |
| 297 | 297 | case '77': |
| 298 | 298 | case '78': |
| 299 | - if($modx->hasPermission('new_chunk')) {
|
|
| 299 | + if($modx->hasPermission('new_chunk')) { |
|
| 300 | 300 | $addnew = 1; |
| 301 | 301 | } |
| 302 | 302 | break; |
| 303 | 303 | case '22': |
| 304 | 304 | case '23': |
| 305 | - if($modx->hasPermission('new_snippet')) {
|
|
| 305 | + if($modx->hasPermission('new_snippet')) { |
|
| 306 | 306 | $addnew = 1; |
| 307 | 307 | } |
| 308 | 308 | break; |
| 309 | 309 | case '101': |
| 310 | 310 | case '102': |
| 311 | - if($modx->hasPermission('new_plugin')) {
|
|
| 311 | + if($modx->hasPermission('new_plugin')) { |
|
| 312 | 312 | $addnew = 1; |
| 313 | 313 | } |
| 314 | 314 | break; |
| 315 | 315 | case '106': |
| 316 | 316 | case '107': |
| 317 | 317 | case '108': |
| 318 | - if($modx->hasPermission('new_module')) {
|
|
| 318 | + if($modx->hasPermission('new_module')) { |
|
| 319 | 319 | $addnew = 1; |
| 320 | 320 | } |
| 321 | - if($modx->hasPermission('exec_module')) {
|
|
| 321 | + if($modx->hasPermission('exec_module')) { |
|
| 322 | 322 | $run = 1; |
| 323 | 323 | } |
| 324 | 324 | break; |
| 325 | 325 | case '88': |
| 326 | - if($modx->hasPermission('new_web_user')) {
|
|
| 326 | + if($modx->hasPermission('new_web_user')) { |
|
| 327 | 327 | $addnew = 1; |
| 328 | 328 | } |
| 329 | 329 | break; |
@@ -22,7 +22,8 @@ discard block |
||
| 22 | 22 | NOTE: http://www.w3.org/TR/NOTE-datetime |
| 23 | 23 | \*======================================================================*/ |
| 24 | 24 | |
| 25 | -function parse_w3cdtf ( $date_str ) { |
|
| 25 | +function parse_w3cdtf ( $date_str ) |
|
| 26 | +{ |
|
| 26 | 27 | |
| 27 | 28 | # regex to match wc3dtf |
| 28 | 29 | $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/"; |
@@ -37,8 +38,7 @@ discard block |
||
| 37 | 38 | $offset = 0; |
| 38 | 39 | if ( $match[10] == 'Z' ) { |
| 39 | 40 | # zulu time, aka GMT |
| 40 | - } |
|
| 41 | - else { |
|
| 41 | + } else { |
|
| 42 | 42 | list( $tz_mod, $tz_hour, $tz_min ) = |
| 43 | 43 | array( $match[8], $match[9], $match[10]); |
| 44 | 44 | |
@@ -58,8 +58,7 @@ discard block |
||
| 58 | 58 | } |
| 59 | 59 | $epoch = $epoch + $offset; |
| 60 | 60 | return $epoch; |
| 61 | - } |
|
| 62 | - else { |
|
| 61 | + } else { |
|
| 63 | 62 | return -1; |
| 64 | 63 | } |
| 65 | 64 | } |
@@ -22,35 +22,35 @@ |
||
| 22 | 22 | NOTE: http://www.w3.org/TR/NOTE-datetime |
| 23 | 23 | \*======================================================================*/ |
| 24 | 24 | |
| 25 | -function parse_w3cdtf ( $date_str ) { |
|
| 25 | +function parse_w3cdtf($date_str){ |
|
| 26 | 26 | |
| 27 | 27 | # regex to match wc3dtf |
| 28 | 28 | $pat = "/(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(:(\d{2}))?(?:([-+])(\d{2}):?(\d{2})|(Z))?/"; |
| 29 | 29 | |
| 30 | - if ( preg_match( $pat, $date_str, $match ) ) { |
|
| 31 | - list( $year, $month, $day, $hours, $minutes, $seconds) = |
|
| 32 | - array( $match[1], $match[2], $match[3], $match[4], $match[5], $match[6]); |
|
| 30 | + if (preg_match($pat, $date_str, $match)) { |
|
| 31 | + list($year, $month, $day, $hours, $minutes, $seconds) = |
|
| 32 | + array($match[1], $match[2], $match[3], $match[4], $match[5], $match[6]); |
|
| 33 | 33 | |
| 34 | 34 | # calc epoch for current date assuming GMT |
| 35 | - $epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year); |
|
| 35 | + $epoch = gmmktime($hours, $minutes, $seconds, $month, $day, $year); |
|
| 36 | 36 | |
| 37 | 37 | $offset = 0; |
| 38 | - if ( $match[10] == 'Z' ) { |
|
| 38 | + if ($match[10] == 'Z') { |
|
| 39 | 39 | # zulu time, aka GMT |
| 40 | 40 | } |
| 41 | 41 | else { |
| 42 | - list( $tz_mod, $tz_hour, $tz_min ) = |
|
| 43 | - array( $match[8], $match[9], $match[10]); |
|
| 42 | + list($tz_mod, $tz_hour, $tz_min) = |
|
| 43 | + array($match[8], $match[9], $match[10]); |
|
| 44 | 44 | |
| 45 | 45 | # zero out the variables |
| 46 | - if ( ! $tz_hour ) { $tz_hour = 0; } |
|
| 47 | - if ( ! $tz_min ) { $tz_min = 0; } |
|
| 46 | + if (!$tz_hour) { $tz_hour = 0; } |
|
| 47 | + if (!$tz_min) { $tz_min = 0; } |
|
| 48 | 48 | |
| 49 | - $offset_secs = (($tz_hour*60)+$tz_min)*60; |
|
| 49 | + $offset_secs = (($tz_hour * 60) + $tz_min) * 60; |
|
| 50 | 50 | |
| 51 | 51 | # is timezone ahead of GMT? then subtract offset |
| 52 | 52 | # |
| 53 | - if ( $tz_mod == '+' ) { |
|
| 53 | + if ($tz_mod == '+') { |
|
| 54 | 54 | $offset_secs = $offset_secs * -1; |
| 55 | 55 | } |
| 56 | 56 | |
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -$c = &$settings; |
|
| 3 | +$c = &$settings; |
|
| 4 | 4 | |
| 5 | 5 | $c['site_name'] = 'My MODX Site'; |
| 6 | 6 | $c['site_start'] = 1; |
@@ -65,21 +65,37 @@ |
||
| 65 | 65 | $_['macintosh'] = 'Western European (Mac) - macintosh'; |
| 66 | 66 | $_['Windows-1252'] = 'Western European (Windows) - Windows-1252'; |
| 67 | 67 | |
| 68 | -if($modx_charset == 'euc-jp') $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
| 69 | -elseif($modx_charset == 'shift_jis') $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
| 70 | -elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
| 71 | -elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
| 72 | -elseif($modx_charset == 'EUC-CN') $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
| 73 | -elseif($modx_charset == 'hz-gb-2312') $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
| 74 | -elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
| 75 | -elseif($modx_charset == 'x-Chinese-CNS') $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
| 76 | -elseif($modx_charset == 'x-Chinese-Eten') $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
| 77 | -elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
| 78 | -elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
| 79 | -elseif($modx_charset == 'euc-kr') $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
| 80 | -elseif($modx_charset == 'iso-2022-kr') $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
| 81 | -elseif($modx_charset == 'Johab') $_['Johab'] = 'Korean (Johab) - Johab'; |
|
| 82 | -elseif($modx_charset == 'x-mac-korean') $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
| 68 | +if($modx_charset == 'euc-jp') { |
|
| 69 | + $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
| 70 | +} elseif($modx_charset == 'shift_jis') { |
|
| 71 | + $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
| 72 | +} elseif($modx_charset == 'iso-2022-jp') { |
|
| 73 | + $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
| 74 | +} elseif($modx_charset == 'csISO2022JP') { |
|
| 75 | + $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
| 76 | +} elseif($modx_charset == 'EUC-CN') { |
|
| 77 | + $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
| 78 | +} elseif($modx_charset == 'hz-gb-2312') { |
|
| 79 | + $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
| 80 | +} elseif($modx_charset == 'x-mac-chinesesimp') { |
|
| 81 | + $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
| 82 | +} elseif($modx_charset == 'x-Chinese-CNS') { |
|
| 83 | + $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
| 84 | +} elseif($modx_charset == 'x-Chinese-Eten') { |
|
| 85 | + $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
| 86 | +} elseif($modx_charset == 'x-mac-chinesetrad') { |
|
| 87 | + $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
| 88 | +} elseif($modx_charset == 'ks_c_5601-1987') { |
|
| 89 | + $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
| 90 | +} elseif($modx_charset == 'euc-kr') { |
|
| 91 | + $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
| 92 | +} elseif($modx_charset == 'iso-2022-kr') { |
|
| 93 | + $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
| 94 | +} elseif($modx_charset == 'Johab') { |
|
| 95 | + $_['Johab'] = 'Korean (Johab) - Johab'; |
|
| 96 | +} elseif($modx_charset == 'x-mac-korean') { |
|
| 97 | + $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
| 98 | +} |
|
| 83 | 99 | |
| 84 | 100 | $tpl = '<option value="%s" %s>%s</option>'; |
| 85 | 101 | $options = array(); |
@@ -65,26 +65,26 @@ |
||
| 65 | 65 | $_['macintosh'] = 'Western European (Mac) - macintosh'; |
| 66 | 66 | $_['Windows-1252'] = 'Western European (Windows) - Windows-1252'; |
| 67 | 67 | |
| 68 | -if($modx_charset == 'euc-jp') $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
| 69 | -elseif($modx_charset == 'shift_jis') $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
| 70 | -elseif($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
| 71 | -elseif($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
| 72 | -elseif($modx_charset == 'EUC-CN') $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
| 73 | -elseif($modx_charset == 'hz-gb-2312') $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
| 74 | -elseif($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
| 75 | -elseif($modx_charset == 'x-Chinese-CNS') $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
| 76 | -elseif($modx_charset == 'x-Chinese-Eten') $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
| 77 | -elseif($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
| 78 | -elseif($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
| 79 | -elseif($modx_charset == 'euc-kr') $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
| 80 | -elseif($modx_charset == 'iso-2022-kr') $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
| 81 | -elseif($modx_charset == 'Johab') $_['Johab'] = 'Korean (Johab) - Johab'; |
|
| 82 | -elseif($modx_charset == 'x-mac-korean') $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
| 68 | +if ($modx_charset == 'euc-jp') $_['euc-jp'] = 'Japanese (EUC) - euc-jp'; |
|
| 69 | +elseif ($modx_charset == 'shift_jis') $_['shift_jis'] = 'Japanese (Shift-JIS) - shift_jis'; |
|
| 70 | +elseif ($modx_charset == 'iso-2022-jp') $_['iso-2022-jp'] = 'Japanese (JIS-Allow 1 byte Kana - SO/SI) - iso-2022-jp'; |
|
| 71 | +elseif ($modx_charset == 'csISO2022JP') $_['csISO2022JP'] = 'Japanese (JIS-Allow 1 byte Kana) - csISO2022JP'; |
|
| 72 | +elseif ($modx_charset == 'EUC-CN') $_['EUC-CN'] = 'Chinese Simplified (EUC) - EUC-CN'; |
|
| 73 | +elseif ($modx_charset == 'hz-gb-2312') $_['hz-gb-2312'] = 'Chinese Simplified (HZ) - hz-gb-2312'; |
|
| 74 | +elseif ($modx_charset == 'x-mac-chinesesimp') $_['x-mac-chinesesimp'] = 'Chinese Simplified (Mac) - x-mac-chinesesimp'; |
|
| 75 | +elseif ($modx_charset == 'x-Chinese-CNS') $_['x-Chinese-CNS'] = 'Chinese Traditional (CNS) - x-Chinese-CNS'; |
|
| 76 | +elseif ($modx_charset == 'x-Chinese-Eten') $_['x-Chinese-Eten'] = 'Chinese Traditional (Eten) - x-Chinese-Eten'; |
|
| 77 | +elseif ($modx_charset == 'x-mac-chinesetrad') $_['x-mac-chinesetrad'] = 'Chinese Traditional (Mac) - x-mac-chinesetrad'; |
|
| 78 | +elseif ($modx_charset == 'ks_c_5601-1987') $_['ks_c_5601-1987'] = 'Korean - ks_c_5601-1987'; |
|
| 79 | +elseif ($modx_charset == 'euc-kr') $_['euc-kr'] = 'Korean (EUC) - euc-kr'; |
|
| 80 | +elseif ($modx_charset == 'iso-2022-kr') $_['iso-2022-kr'] = 'Korean (ISO) - iso-2022-kr'; |
|
| 81 | +elseif ($modx_charset == 'Johab') $_['Johab'] = 'Korean (Johab) - Johab'; |
|
| 82 | +elseif ($modx_charset == 'x-mac-korean') $_['x-mac-korean'] = 'Korean (Mac) - x-mac-korean'; |
|
| 83 | 83 | |
| 84 | 84 | $tpl = '<option value="%s" %s>%s</option>'; |
| 85 | 85 | $options = array(); |
| 86 | -foreach($_ as $value=>$label) { |
|
| 87 | - $selected = $value===$modx_charset ? 'selected' : ''; |
|
| 86 | +foreach ($_ as $value=>$label) { |
|
| 87 | + $selected = $value === $modx_charset ? 'selected' : ''; |
|
| 88 | 88 | $options[] = sprintf($tpl, $value, $selected, $label); |
| 89 | 89 | } |
| 90 | 90 | echo implode("\n", $options); |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $modx->setPlaceholder($rvKey, $rvValue); |
| 56 | 56 | } |
| 57 | 57 | $param = $modx->mergePlaceholderContent($param); |
| 58 | - $rs = $modx->db->query("SELECT $param;"); |
|
| 58 | + $rs = $modx->db->query("select $param;"); |
|
| 59 | 59 | $output = $rs; |
| 60 | 60 | break; |
| 61 | 61 | |
@@ -163,7 +163,7 @@ |
||
| 163 | 163 | * |
| 164 | 164 | * @param string $param |
| 165 | 165 | * @param array $tvsArray |
| 166 | - * @return mixed |
|
| 166 | + * @return string |
|
| 167 | 167 | */ |
| 168 | 168 | function parseTvValues($param, $tvsArray) |
| 169 | 169 | { |
@@ -131,8 +131,8 @@ discard block |
||
| 131 | 131 | */ |
| 132 | 132 | function ProcessFile($file) { |
| 133 | 133 | // get the file |
| 134 | - $buffer = @file_get_contents($file); |
|
| 135 | - if ($buffer === false) $buffer = " Could not retrieve document '$file'."; |
|
| 134 | + $buffer = @file_get_contents($file); |
|
| 135 | + if ($buffer === false) $buffer = " Could not retrieve document '$file'."; |
|
| 136 | 136 | return $buffer; |
| 137 | 137 | } |
| 138 | 138 | |
@@ -168,20 +168,20 @@ discard block |
||
| 168 | 168 | function parseTvValues($param, $tvsArray) |
| 169 | 169 | { |
| 170 | 170 | $modx = evolutionCMS(); |
| 171 | - $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray; |
|
| 172 | - if (strpos($param, '[*') !== false) { |
|
| 173 | - $matches = $modx->getTagsFromContent($param, '[*', '*]'); |
|
| 174 | - foreach ($matches[0] as $i=>$match) { |
|
| 175 | - if(isset($tvsArray[ $matches[1][$i] ])) { |
|
| 176 | - if(is_array($tvsArray[ $matches[1][$i] ])) { |
|
| 177 | - $value = $tvsArray[$matches[1][$i]]['value']; |
|
| 178 | - $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; |
|
| 179 | - } else { |
|
| 180 | - $value = $tvsArray[ $matches[1][$i] ]; |
|
| 181 | - } |
|
| 182 | - $param = str_replace($match, $value, $param); |
|
| 183 | - } |
|
| 184 | - } |
|
| 185 | - } |
|
| 186 | - return $param; |
|
| 171 | + $tvsArray = is_array($modx->documentObject) ? array_merge($tvsArray, $modx->documentObject) : $tvsArray; |
|
| 172 | + if (strpos($param, '[*') !== false) { |
|
| 173 | + $matches = $modx->getTagsFromContent($param, '[*', '*]'); |
|
| 174 | + foreach ($matches[0] as $i=>$match) { |
|
| 175 | + if(isset($tvsArray[ $matches[1][$i] ])) { |
|
| 176 | + if(is_array($tvsArray[ $matches[1][$i] ])) { |
|
| 177 | + $value = $tvsArray[$matches[1][$i]]['value']; |
|
| 178 | + $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; |
|
| 179 | + } else { |
|
| 180 | + $value = $tvsArray[ $matches[1][$i] ]; |
|
| 181 | + } |
|
| 182 | + $param = str_replace($match, $value, $param); |
|
| 183 | + } |
|
| 184 | + } |
|
| 185 | + } |
|
| 186 | + return $param; |
|
| 187 | 187 | } |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | * Created by Raymond Irving Feb, 2005 |
| 5 | 5 | */ |
| 6 | 6 | global $BINDINGS; // Array of supported bindings. must be upper case |
| 7 | -$BINDINGS = array ( |
|
| 7 | +$BINDINGS = array( |
|
| 8 | 8 | 'FILE', |
| 9 | 9 | 'CHUNK', |
| 10 | 10 | 'DOCUMENT', |
@@ -22,13 +22,13 @@ discard block |
||
| 22 | 22 | * @param array $tvsArray |
| 23 | 23 | * @return string |
| 24 | 24 | */ |
| 25 | -function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) { |
|
| 25 | +function ProcessTVCommand($value, $name = '', $docid = '', $src = 'docform', $tvsArray = array()){ |
|
| 26 | 26 | $modx = evolutionCMS(); |
| 27 | - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; |
|
| 27 | + $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier; |
|
| 28 | 28 | $nvalue = trim($value); |
| 29 | 29 | if (substr($nvalue, 0, 1) != '@') |
| 30 | 30 | return $value; |
| 31 | - elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { |
|
| 31 | + elseif (isset($modx->config['enable_bindings']) && $modx->config['enable_bindings'] != 1 && $src === 'docform') { |
|
| 32 | 32 | return '@Bindings is disabled.'; |
| 33 | 33 | } |
| 34 | 34 | else { |
@@ -54,8 +54,8 @@ discard block |
||
| 54 | 54 | break; |
| 55 | 55 | |
| 56 | 56 | case "SELECT" : // selects a record from the cms database |
| 57 | - $rt = array (); |
|
| 58 | - $replacementVars = array ( |
|
| 57 | + $rt = array(); |
|
| 58 | + $replacementVars = array( |
|
| 59 | 59 | 'DBASE' => $modx->db->config['dbase'], |
| 60 | 60 | 'PREFIX' => $modx->db->config['table_prefix'] |
| 61 | 61 | ); |
@@ -96,8 +96,8 @@ discard block |
||
| 96 | 96 | break; |
| 97 | 97 | |
| 98 | 98 | case 'DIRECTORY' : |
| 99 | - $files = array (); |
|
| 100 | - $path = $modx->config['base_path'] . $param; |
|
| 99 | + $files = array(); |
|
| 100 | + $path = $modx->config['base_path'].$param; |
|
| 101 | 101 | if (substr($path, -1, 1) != '/') { |
| 102 | 102 | $path .= '/'; |
| 103 | 103 | } |
@@ -129,7 +129,7 @@ discard block |
||
| 129 | 129 | * @param $file |
| 130 | 130 | * @return string |
| 131 | 131 | */ |
| 132 | -function ProcessFile($file) { |
|
| 132 | +function ProcessFile($file){ |
|
| 133 | 133 | // get the file |
| 134 | 134 | $buffer = @file_get_contents($file); |
| 135 | 135 | if ($buffer === false) $buffer = " Could not retrieve document '$file'."; |
@@ -146,12 +146,12 @@ discard block |
||
| 146 | 146 | { |
| 147 | 147 | global $BINDINGS; |
| 148 | 148 | $binding_array = array(); |
| 149 | - foreach($BINDINGS as $cmd) |
|
| 149 | + foreach ($BINDINGS as $cmd) |
|
| 150 | 150 | { |
| 151 | - if(strpos($binding_string,'@'.$cmd)===0) |
|
| 151 | + if (strpos($binding_string, '@'.$cmd) === 0) |
|
| 152 | 152 | { |
| 153 | - $code = substr($binding_string,strlen($cmd)+1); |
|
| 154 | - $binding_array = array($cmd,trim($code)); |
|
| 153 | + $code = substr($binding_string, strlen($cmd) + 1); |
|
| 154 | + $binding_array = array($cmd, trim($code)); |
|
| 155 | 155 | break; |
| 156 | 156 | } |
| 157 | 157 | } |
@@ -172,12 +172,12 @@ discard block |
||
| 172 | 172 | if (strpos($param, '[*') !== false) { |
| 173 | 173 | $matches = $modx->getTagsFromContent($param, '[*', '*]'); |
| 174 | 174 | foreach ($matches[0] as $i=>$match) { |
| 175 | - if(isset($tvsArray[ $matches[1][$i] ])) { |
|
| 176 | - if(is_array($tvsArray[ $matches[1][$i] ])) { |
|
| 175 | + if (isset($tvsArray[$matches[1][$i]])) { |
|
| 176 | + if (is_array($tvsArray[$matches[1][$i]])) { |
|
| 177 | 177 | $value = $tvsArray[$matches[1][$i]]['value']; |
| 178 | 178 | $value = $value === '' ? $tvsArray[$matches[1][$i]]['default_text'] : $value; |
| 179 | 179 | } else { |
| 180 | - $value = $tvsArray[ $matches[1][$i] ]; |
|
| 180 | + $value = $tvsArray[$matches[1][$i]]; |
|
| 181 | 181 | } |
| 182 | 182 | $param = str_replace($match, $value, $param); |
| 183 | 183 | } |
@@ -22,16 +22,16 @@ discard block |
||
| 22 | 22 | * @param array $tvsArray |
| 23 | 23 | * @return string |
| 24 | 24 | */ |
| 25 | -function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) { |
|
| 25 | +function ProcessTVCommand($value, $name = '', $docid = '', $src='docform', $tvsArray = array()) |
|
| 26 | +{ |
|
| 26 | 27 | $modx = evolutionCMS(); |
| 27 | 28 | $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; |
| 28 | 29 | $nvalue = trim($value); |
| 29 | - if (substr($nvalue, 0, 1) != '@') |
|
| 30 | - return $value; |
|
| 31 | - elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { |
|
| 30 | + if (substr($nvalue, 0, 1) != '@') { |
|
| 31 | + return $value; |
|
| 32 | + } elseif(isset($modx->config['enable_bindings']) && $modx->config['enable_bindings']!=1 && $src==='docform') { |
|
| 32 | 33 | return '@Bindings is disabled.'; |
| 33 | - } |
|
| 34 | - else { |
|
| 34 | + } else { |
|
| 35 | 35 | list ($cmd, $param) = ParseCommand($nvalue); |
| 36 | 36 | $cmd = trim($cmd); |
| 37 | 37 | $param = parseTvValues($param, $tvsArray); |
@@ -47,10 +47,11 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | case "DOCUMENT" : // retrieve a document and process it's content |
| 49 | 49 | $rs = $modx->getDocument($param); |
| 50 | - if (is_array($rs)) |
|
| 51 | - $output = $rs['content']; |
|
| 52 | - else |
|
| 53 | - $output = "Unable to locate document $param"; |
|
| 50 | + if (is_array($rs)) { |
|
| 51 | + $output = $rs['content']; |
|
| 52 | + } else { |
|
| 53 | + $output = "Unable to locate document $param"; |
|
| 54 | + } |
|
| 54 | 55 | break; |
| 55 | 56 | |
| 56 | 57 | case "SELECT" : // selects a record from the cms database |
@@ -80,8 +81,10 @@ discard block |
||
| 80 | 81 | |
| 81 | 82 | // Grab document regardless of publish status |
| 82 | 83 | $doc = $modx->getPageInfo($parent_id, 0, 'id,parent,published'); |
| 83 | - if ($doc['parent'] != 0 && !$doc['published']) |
|
| 84 | - continue; // hide unpublished docs if we're not at the top |
|
| 84 | + if ($doc['parent'] != 0 && !$doc['published']) { |
|
| 85 | + continue; |
|
| 86 | + } |
|
| 87 | + // hide unpublished docs if we're not at the top |
|
| 85 | 88 | |
| 86 | 89 | $tv = $modx->getTemplateVar($name, '*', $doc['id'], $doc['published']); |
| 87 | 90 | |
@@ -129,10 +132,13 @@ discard block |
||
| 129 | 132 | * @param $file |
| 130 | 133 | * @return string |
| 131 | 134 | */ |
| 132 | -function ProcessFile($file) { |
|
| 135 | +function ProcessFile($file) |
|
| 136 | +{ |
|
| 133 | 137 | // get the file |
| 134 | 138 | $buffer = @file_get_contents($file); |
| 135 | - if ($buffer === false) $buffer = " Could not retrieve document '$file'."; |
|
| 139 | + if ($buffer === false) { |
|
| 140 | + $buffer = " Could not retrieve document '$file'."; |
|
| 141 | + } |
|
| 136 | 142 | return $buffer; |
| 137 | 143 | } |
| 138 | 144 | |
@@ -146,10 +152,8 @@ discard block |
||
| 146 | 152 | { |
| 147 | 153 | global $BINDINGS; |
| 148 | 154 | $binding_array = array(); |
| 149 | - foreach($BINDINGS as $cmd) |
|
| 150 | - { |
|
| 151 | - if(strpos($binding_string,'@'.$cmd)===0) |
|
| 152 | - { |
|
| 155 | + foreach($BINDINGS as $cmd) { |
|
| 156 | + if(strpos($binding_string,'@'.$cmd)===0) { |
|
| 153 | 157 | $code = substr($binding_string,strlen($cmd)+1); |
| 154 | 158 | $binding_array = array($cmd,trim($code)); |
| 155 | 159 | break; |
@@ -2224,11 +2224,11 @@ discard block |
||
| 2224 | 2224 | if (isset($this->snippetCache[$snip_name])) { |
| 2225 | 2225 | $snippetObject['name'] = $snip_name; |
| 2226 | 2226 | $snippetObject['content'] = $this->snippetCache[$snip_name]; |
| 2227 | - if (isset($this->snippetCache["{$snip_name}Props"])) { |
|
| 2228 | - if (!isset($this->snippetCache["{$snip_name}Props"])) { |
|
| 2229 | - $this->snippetCache["{$snip_name}Props"] = ''; |
|
| 2227 | + if (isset($this->snippetCache["{$snip_name}props"])) { |
|
| 2228 | + if (!isset($this->snippetCache["{$snip_name}props"])) { |
|
| 2229 | + $this->snippetCache["{$snip_name}props"] = ''; |
|
| 2230 | 2230 | } |
| 2231 | - $snippetObject['properties'] = $this->snippetCache["{$snip_name}Props"]; |
|
| 2231 | + $snippetObject['properties'] = $this->snippetCache["{$snip_name}props"]; |
|
| 2232 | 2232 | } |
| 2233 | 2233 | } elseif (substr($snip_name, 0, 1) === '@' && isset($this->pluginEvent[trim($snip_name, '@')])) { |
| 2234 | 2234 | $snippetObject['name'] = trim($snip_name, '@'); |
@@ -2253,7 +2253,7 @@ discard block |
||
| 2253 | 2253 | $snippetObject['content'] = $snip_content; |
| 2254 | 2254 | $snippetObject['properties'] = $snip_prop; |
| 2255 | 2255 | $this->snippetCache[$snip_name] = $snip_content; |
| 2256 | - $this->snippetCache["{$snip_name}Props"] = $snip_prop; |
|
| 2256 | + $this->snippetCache["{$snip_name}props"] = $snip_prop; |
|
| 2257 | 2257 | } |
| 2258 | 2258 | return $snippetObject; |
| 2259 | 2259 | } |
@@ -3569,7 +3569,7 @@ discard block |
||
| 3569 | 3569 | } |
| 3570 | 3570 | // build query |
| 3571 | 3571 | $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
| 3572 | - $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc |
|
| 3572 | + $result = $this->db->select("distinct {$fields}", "{$tblsc} sc |
|
| 3573 | 3573 | LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}"); |
| 3574 | 3574 | $resourceArray = $this->db->makeArray($result); |
| 3575 | 3575 | $this->tmpCache[__FUNCTION__][$cacheKey] = $resourceArray; |
@@ -3606,7 +3606,7 @@ discard block |
||
| 3606 | 3606 | } |
| 3607 | 3607 | // build query |
| 3608 | 3608 | $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
| 3609 | - $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc |
|
| 3609 | + $result = $this->db->select("distinct {$fields}", "{$tblsc} sc |
|
| 3610 | 3610 | LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND sc.published=1 AND sc.deleted=0 AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}"); |
| 3611 | 3611 | $resourceArray = $this->db->makeArray($result); |
| 3612 | 3612 | |
@@ -3662,7 +3662,7 @@ discard block |
||
| 3662 | 3662 | $tblsc = $this->getFullTableName('site_content'); |
| 3663 | 3663 | $tbldg = $this->getFullTableName('document_groups'); |
| 3664 | 3664 | |
| 3665 | - $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc |
|
| 3665 | + $result = $this->db->select("distinct {$fields}", "{$tblsc} sc |
|
| 3666 | 3666 | LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$parentid}' {$published} {$deleted} {$where} AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit); |
| 3667 | 3667 | |
| 3668 | 3668 | $resourceArray = $this->db->makeArray($result); |
@@ -3728,7 +3728,7 @@ discard block |
||
| 3728 | 3728 | $tblsc = $this->getFullTableName('site_content'); |
| 3729 | 3729 | $tbldg = $this->getFullTableName('document_groups'); |
| 3730 | 3730 | |
| 3731 | - $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc |
|
| 3731 | + $result = $this->db->select("distinct {$fields}", "{$tblsc} sc |
|
| 3732 | 3732 | LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (" . implode(',', $ids) . ") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit); |
| 3733 | 3733 | |
| 3734 | 3734 | $resourceArray = $this->db->makeArray($result); |
@@ -4320,7 +4320,7 @@ discard block |
||
| 4320 | 4320 | $template = $doc['content']; |
| 4321 | 4321 | break; |
| 4322 | 4322 | case 'SELECT': |
| 4323 | - $this->db->getValue($this->db->query("SELECT {$template}")); |
|
| 4323 | + $this->db->getValue($this->db->query("select {$template}")); |
|
| 4324 | 4324 | break; |
| 4325 | 4325 | default: |
| 4326 | 4326 | if (!($template = $this->getChunk($tpl))) { |
@@ -701,13 +701,15 @@ discard block |
||
| 701 | 701 | $this->virtualDir = ''; |
| 702 | 702 | } |
| 703 | 703 | |
| 704 | - if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) { /* we got an ID returned, check to make sure it's not an alias */ |
|
| 704 | + if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) { |
|
| 705 | +/* we got an ID returned, check to make sure it's not an alias */ |
|
| 705 | 706 | /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */ |
| 706 | 707 | if ($this->config['use_alias_path'] == 1) { |
| 707 | 708 | if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) { |
| 708 | 709 | $this->documentMethod = 'id'; |
| 709 | 710 | return $q; |
| 710 | - } else { /* not a valid id in terms of virtualDir, treat as alias */ |
|
| 711 | + } else { |
|
| 712 | +/* not a valid id in terms of virtualDir, treat as alias */ |
|
| 711 | 713 | $this->documentMethod = 'alias'; |
| 712 | 714 | return $q; |
| 713 | 715 | } |
@@ -715,7 +717,8 @@ discard block |
||
| 715 | 717 | $this->documentMethod = 'id'; |
| 716 | 718 | return $q; |
| 717 | 719 | } |
| 718 | - } else { /* we didn't get an ID back, so instead we assume it's an alias */ |
|
| 720 | + } else { |
|
| 721 | +/* we didn't get an ID back, so instead we assume it's an alias */ |
|
| 719 | 722 | if ($this->config['friendly_alias_urls'] != 1) { |
| 720 | 723 | $q = $qOrig; |
| 721 | 724 | } |
@@ -745,13 +748,14 @@ discard block |
||
| 745 | 748 | * @param $id |
| 746 | 749 | * @return array|mixed|null|string |
| 747 | 750 | */ |
| 748 | - public function makePageCacheKey($id){ |
|
| 751 | + public function makePageCacheKey($id) |
|
| 752 | + { |
|
| 749 | 753 | $hash = $id; |
| 750 | 754 | $tmp = null; |
| 751 | 755 | $params = array(); |
| 752 | - if(!empty($this->systemCacheKey)){ |
|
| 756 | + if(!empty($this->systemCacheKey)) { |
|
| 753 | 757 | $hash = $this->systemCacheKey; |
| 754 | - }else { |
|
| 758 | + } else { |
|
| 755 | 759 | if (!empty($_GET)) { |
| 756 | 760 | // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID. |
| 757 | 761 | $params = $_GET; |
@@ -760,7 +764,7 @@ discard block |
||
| 760 | 764 | } |
| 761 | 765 | } |
| 762 | 766 | $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params)); |
| 763 | - if (is_array($evtOut) && count($evtOut) > 0){ |
|
| 767 | + if (is_array($evtOut) && count($evtOut) > 0) { |
|
| 764 | 768 | $tmp = array_pop($evtOut); |
| 765 | 769 | } |
| 766 | 770 | return empty($tmp) ? $hash : $tmp; |
@@ -1087,7 +1091,8 @@ discard block |
||
| 1087 | 1091 | $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0"; |
| 1088 | 1092 | $result_pub = $this->db->select( 'id', '[+prefix+]site_content', $where); |
| 1089 | 1093 | $this->db->update($field, '[+prefix+]site_content', $where); |
| 1090 | - if ($this->db->getRecordCount($result_pub) >= 1) { //Event unPublished doc |
|
| 1094 | + if ($this->db->getRecordCount($result_pub) >= 1) { |
|
| 1095 | +//Event unPublished doc |
|
| 1091 | 1096 | while ($row_pub = $this->db->getRow($result_pub)) { |
| 1092 | 1097 | $this->invokeEvent("OnDocUnPublished", array( |
| 1093 | 1098 | "docid" => $row_pub['id'] |
@@ -1100,7 +1105,8 @@ discard block |
||
| 1100 | 1105 | $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1"; |
| 1101 | 1106 | $result_unpub = $this->db->select( 'id', '[+prefix+]site_content', $where); |
| 1102 | 1107 | $this->db->update($field, '[+prefix+]site_content', $where); |
| 1103 | - if ($this->db->getRecordCount($result_unpub) >= 1) { //Event unPublished doc |
|
| 1108 | + if ($this->db->getRecordCount($result_unpub) >= 1) { |
|
| 1109 | +//Event unPublished doc |
|
| 1104 | 1110 | while ($row_unpub = $this->db->getRow($result_unpub)) { |
| 1105 | 1111 | $this->invokeEvent("OnDocUnPublished", array( |
| 1106 | 1112 | "docid" => $row_unpub['id'] |
@@ -1187,10 +1193,18 @@ discard block |
||
| 1187 | 1193 | return array(); |
| 1188 | 1194 | } |
| 1189 | 1195 | $spacer = md5('<<<EVO>>>'); |
| 1190 | - if($left==='{{' && strpos($content,';}}')!==false) $content = str_replace(';}}', sprintf(';}%s}', $spacer),$content); |
|
| 1191 | - if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content); |
|
| 1192 | - if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]', $spacer),$content); |
|
| 1193 | - if($left==='[[' && strpos($content,']]]')!==false) $content = str_replace(']]]', sprintf(']%s]]', $spacer),$content); |
|
| 1196 | + if($left==='{{' && strpos($content,';}}')!==false) { |
|
| 1197 | + $content = str_replace(';}}', sprintf(';}%s}', $spacer),$content); |
|
| 1198 | + } |
|
| 1199 | + if($left==='{{' && strpos($content,'{{}}')!==false) { |
|
| 1200 | + $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content); |
|
| 1201 | + } |
|
| 1202 | + if($left==='[[' && strpos($content,']]]]')!==false) { |
|
| 1203 | + $content = str_replace(']]]]',sprintf(']]%s]]', $spacer),$content); |
|
| 1204 | + } |
|
| 1205 | + if($left==='[[' && strpos($content,']]]')!==false) { |
|
| 1206 | + $content = str_replace(']]]', sprintf(']%s]]', $spacer),$content); |
|
| 1207 | + } |
|
| 1194 | 1208 | |
| 1195 | 1209 | $pos['<![CDATA['] = strpos($content, '<![CDATA['); |
| 1196 | 1210 | $pos[']]>'] = strpos($content, ']]>'); |
@@ -1243,7 +1257,8 @@ discard block |
||
| 1243 | 1257 | } |
| 1244 | 1258 | } |
| 1245 | 1259 | |
| 1246 | - if (!in_array($fetch, $tags)) { // Avoid double Matches |
|
| 1260 | + if (!in_array($fetch, $tags)) { |
|
| 1261 | +// Avoid double Matches |
|
| 1247 | 1262 | $tags[] = $fetch; // Fetch |
| 1248 | 1263 | }; |
| 1249 | 1264 | $fetch = ''; // and reset |
@@ -1261,7 +1276,9 @@ discard block |
||
| 1261 | 1276 | } |
| 1262 | 1277 | } |
| 1263 | 1278 | foreach($tags as $i=>$tag) { |
| 1264 | - if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag); |
|
| 1279 | + if(strpos($tag,$spacer)!==false) { |
|
| 1280 | + $tags[$i] = str_replace($spacer, '', $tag); |
|
| 1281 | + } |
|
| 1265 | 1282 | } |
| 1266 | 1283 | return $tags; |
| 1267 | 1284 | } |
@@ -1301,7 +1318,10 @@ discard block |
||
| 1301 | 1318 | } |
| 1302 | 1319 | |
| 1303 | 1320 | foreach ($matches[1] as $i => $key) { |
| 1304 | - if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content |
|
| 1321 | + if(strpos($key,'[+')!==false) { |
|
| 1322 | + continue; |
|
| 1323 | + } |
|
| 1324 | + // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content |
|
| 1305 | 1325 | if (substr($key, 0, 1) == '#') { |
| 1306 | 1326 | $key = substr($key, 1); |
| 1307 | 1327 | } // remove # for QuickEdit format |
@@ -2026,7 +2046,8 @@ discard block |
||
| 2026 | 2046 | * @return mixed|string |
| 2027 | 2047 | */ |
| 2028 | 2048 | public function _getSGVar($value) |
| 2029 | - { // Get super globals |
|
| 2049 | + { |
|
| 2050 | +// Get super globals |
|
| 2030 | 2051 | $key = $value; |
| 2031 | 2052 | $_ = $this->config['enable_filter']; |
| 2032 | 2053 | $this->config['enable_filter'] = 1; |
@@ -2430,7 +2451,8 @@ discard block |
||
| 2430 | 2451 | if ($this->config['friendly_urls'] == 1) { |
| 2431 | 2452 | $aliases = array(); |
| 2432 | 2453 | if (is_array($this->documentListing)) { |
| 2433 | - foreach ($this->documentListing as $path => $docid) { // This is big Loop on large site! |
|
| 2454 | + foreach ($this->documentListing as $path => $docid) { |
|
| 2455 | +// This is big Loop on large site! |
|
| 2434 | 2456 | $aliases[$docid] = $path; |
| 2435 | 2457 | $isfolder[$docid] = $this->aliasListing[$docid]['isfolder']; |
| 2436 | 2458 | } |
@@ -2463,7 +2485,7 @@ discard block |
||
| 2463 | 2485 | $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0); |
| 2464 | 2486 | $pref = $this->config['friendly_url_prefix']; |
| 2465 | 2487 | $suff = $this->config['friendly_url_suffix']; |
| 2466 | - $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) { |
|
| 2488 | + $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff){ |
|
| 2467 | 2489 | global $modx; |
| 2468 | 2490 | $thealias = $aliases[$m[1]]; |
| 2469 | 2491 | $thefolder = $isfolder[$m[1]]; |
@@ -4239,7 +4261,8 @@ discard block |
||
| 4239 | 4261 | if (isset ($this->snippetCache[$snippetName])) { |
| 4240 | 4262 | $snippet = $this->snippetCache[$snippetName]; |
| 4241 | 4263 | $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : ''; |
| 4242 | - } else { // not in cache so let's check the db |
|
| 4264 | + } else { |
|
| 4265 | +// not in cache so let's check the db |
|
| 4243 | 4266 | $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->db->escape($snippetName) . "' AND ss.disabled=0;"; |
| 4244 | 4267 | $result = $this->db->query($sql); |
| 4245 | 4268 | if ($this->db->getRecordCount($result) == 1) { |
@@ -4740,7 +4763,7 @@ discard block |
||
| 4740 | 4763 | $result = $this->db->makeArray($rs); |
| 4741 | 4764 | |
| 4742 | 4765 | // get default/built-in template variables |
| 4743 | - if(is_array($docRow)){ |
|
| 4766 | + if(is_array($docRow)) { |
|
| 4744 | 4767 | ksort($docRow); |
| 4745 | 4768 | |
| 4746 | 4769 | foreach ($docRow as $key => $value) { |
@@ -5219,12 +5242,16 @@ discard block |
||
| 5219 | 5242 | return ''; |
| 5220 | 5243 | } // nothing to register |
| 5221 | 5244 | if (!is_array($options)) { |
| 5222 | - if (is_bool($options)) // backward compatibility with old plaintext parameter |
|
| 5245 | + if (is_bool($options)) { |
|
| 5246 | + // backward compatibility with old plaintext parameter |
|
| 5223 | 5247 | { |
| 5224 | 5248 | $options = array('plaintext' => $options); |
| 5225 | - } elseif (is_string($options)) // Also allow script name as 2nd param |
|
| 5249 | + } |
|
| 5250 | + } elseif (is_string($options)) { |
|
| 5251 | + // Also allow script name as 2nd param |
|
| 5226 | 5252 | { |
| 5227 | 5253 | $options = array('name' => $options); |
| 5254 | + } |
|
| 5228 | 5255 | } else { |
| 5229 | 5256 | $options = array(); |
| 5230 | 5257 | } |
@@ -5236,7 +5263,8 @@ discard block |
||
| 5236 | 5263 | unset($overwritepos); // probably unnecessary--just making sure |
| 5237 | 5264 | |
| 5238 | 5265 | $useThisVer = true; |
| 5239 | - if (isset($this->loadedjscripts[$key])) { // a matching script was found |
|
| 5266 | + if (isset($this->loadedjscripts[$key])) { |
|
| 5267 | +// a matching script was found |
|
| 5240 | 5268 | // if existing script is a startup script, make sure the candidate is also a startup script |
| 5241 | 5269 | if ($this->loadedjscripts[$key]['startup']) { |
| 5242 | 5270 | $startup = true; |
@@ -5256,7 +5284,8 @@ discard block |
||
| 5256 | 5284 | // overwrite the old script (the position may be important for dependent scripts) |
| 5257 | 5285 | $overwritepos = $this->loadedjscripts[$key]['pos']; |
| 5258 | 5286 | } |
| 5259 | - } else { // Use the original version |
|
| 5287 | + } else { |
|
| 5288 | +// Use the original version |
|
| 5260 | 5289 | if ($startup == true && $this->loadedjscripts[$key]['startup'] == false) { |
| 5261 | 5290 | // need to move the exisiting script to the head |
| 5262 | 5291 | $version = $this->loadedjscripts[$key][$version]; |
@@ -5381,7 +5410,8 @@ discard block |
||
| 5381 | 5410 | } |
| 5382 | 5411 | |
| 5383 | 5412 | $results = null; |
| 5384 | - foreach ($this->pluginEvent[$evtName] as $pluginName) { // start for loop |
|
| 5413 | + foreach ($this->pluginEvent[$evtName] as $pluginName) { |
|
| 5414 | +// start for loop |
|
| 5385 | 5415 | if ($this->dumpPlugins) { |
| 5386 | 5416 | $eventtime = $this->getMicroTime(); |
| 5387 | 5417 | } |
@@ -5929,7 +5959,8 @@ discard block |
||
| 5929 | 5959 | * @return bool |
| 5930 | 5960 | */ |
| 5931 | 5961 | public function isSafeCode($phpcode = '', $safe_functions = '') |
| 5932 | - { // return true or false |
|
| 5962 | + { |
|
| 5963 | +// return true or false |
|
| 5933 | 5964 | if ($safe_functions == '') { |
| 5934 | 5965 | return false; |
| 5935 | 5966 | } |
@@ -6345,7 +6376,7 @@ discard block |
||
| 6345 | 6376 | $args = array_pad(array(), $_, '$var'); |
| 6346 | 6377 | $args = implode(", ", $args); |
| 6347 | 6378 | $modx = &$this; |
| 6348 | - $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) { |
|
| 6379 | + $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val){ |
|
| 6349 | 6380 | $arg = $val['args'][$tmp - 1]; |
| 6350 | 6381 | switch (true) { |
| 6351 | 6382 | case is_null($arg): { |
@@ -276,7 +276,7 @@ discard block |
||
| 276 | 276 | * MODX_MANAGER_PATH."includes/extenders/ex_{$extname}.inc.php" |
| 277 | 277 | * $extname - extension name in lowercase |
| 278 | 278 | * |
| 279 | - * @param $extname |
|
| 279 | + * @param string $extname |
|
| 280 | 280 | * @param bool $reload |
| 281 | 281 | * @return bool |
| 282 | 282 | */ |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | * @param int $count_attempts |
| 320 | 320 | * @param string $type $type |
| 321 | 321 | * @param string $responseCode |
| 322 | - * @return bool|null |
|
| 322 | + * @return false|null |
|
| 323 | 323 | * @global string $base_url |
| 324 | 324 | * @global string $site_url |
| 325 | 325 | */ |
@@ -1021,7 +1021,7 @@ discard block |
||
| 1021 | 1021 | } |
| 1022 | 1022 | |
| 1023 | 1023 | /** |
| 1024 | - * @param $contents |
|
| 1024 | + * @param string $contents |
|
| 1025 | 1025 | * @return mixed |
| 1026 | 1026 | */ |
| 1027 | 1027 | public function RecoveryEscapedTags($contents) |
@@ -1045,7 +1045,7 @@ discard block |
||
| 1045 | 1045 | } |
| 1046 | 1046 | |
| 1047 | 1047 | /** |
| 1048 | - * @param $tstart |
|
| 1048 | + * @param double $tstart |
|
| 1049 | 1049 | * @return array |
| 1050 | 1050 | */ |
| 1051 | 1051 | public function getTimerStats($tstart) |
@@ -1813,7 +1813,7 @@ discard block |
||
| 1813 | 1813 | |
| 1814 | 1814 | /** |
| 1815 | 1815 | * Remove Comment-Tags from output like <!--@- Comment -@--> |
| 1816 | - * @param $content |
|
| 1816 | + * @param string $content |
|
| 1817 | 1817 | * @param string $left |
| 1818 | 1818 | * @param string $right |
| 1819 | 1819 | * @return mixed |
@@ -1986,7 +1986,7 @@ discard block |
||
| 1986 | 1986 | /** |
| 1987 | 1987 | * Run snippets as per the tags in $documentSource and replace the tags with the returned values. |
| 1988 | 1988 | * |
| 1989 | - * @param $content |
|
| 1989 | + * @param string $content |
|
| 1990 | 1990 | * @return string |
| 1991 | 1991 | * @internal param string $documentSource |
| 1992 | 1992 | */ |
@@ -3023,7 +3023,7 @@ discard block |
||
| 3023 | 3023 | |
| 3024 | 3024 | /** |
| 3025 | 3025 | * @param $templateID |
| 3026 | - * @return mixed |
|
| 3026 | + * @return string |
|
| 3027 | 3027 | */ |
| 3028 | 3028 | public function _getTemplateCodeFromDB($templateID) |
| 3029 | 3029 | { |
@@ -3066,7 +3066,7 @@ discard block |
||
| 3066 | 3066 | /** |
| 3067 | 3067 | * @param $id |
| 3068 | 3068 | * @param int $top |
| 3069 | - * @return mixed |
|
| 3069 | + * @return string |
|
| 3070 | 3070 | */ |
| 3071 | 3071 | public function getUltimateParentId($id, $top = 0) |
| 3072 | 3072 | { |
@@ -3397,7 +3397,7 @@ discard block |
||
| 3397 | 3397 | * |
| 3398 | 3398 | * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role |
| 3399 | 3399 | * @param int $id Element- / Resource-id |
| 3400 | - * @return bool |
|
| 3400 | + * @return false|null |
|
| 3401 | 3401 | */ |
| 3402 | 3402 | public function lockElement($type, $id) |
| 3403 | 3403 | { |
@@ -3419,7 +3419,7 @@ discard block |
||
| 3419 | 3419 | * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role |
| 3420 | 3420 | * @param int $id Element- / Resource-id |
| 3421 | 3421 | * @param bool $includeAllUsers true = Deletes not only own user-locks |
| 3422 | - * @return bool |
|
| 3422 | + * @return false|null |
|
| 3423 | 3423 | */ |
| 3424 | 3424 | public function unlockElement($type, $id, $includeAllUsers = false) |
| 3425 | 3425 | { |
@@ -3527,7 +3527,7 @@ discard block |
||
| 3527 | 3527 | * @param array $params |
| 3528 | 3528 | * @param string $msg |
| 3529 | 3529 | * @param array $files |
| 3530 | - * @return mixed |
|
| 3530 | + * @return boolean |
|
| 3531 | 3531 | */ |
| 3532 | 3532 | public function sendmail($params = array(), $msg = '', $files = array()) |
| 3533 | 3533 | { |
@@ -3931,7 +3931,7 @@ discard block |
||
| 3931 | 3931 | * Default: 1 |
| 3932 | 3932 | * @param string $fields List of fields |
| 3933 | 3933 | * Default: id, pagetitle, description, alias |
| 3934 | - * @return boolean|array |
|
| 3934 | + * @return string |
|
| 3935 | 3935 | */ |
| 3936 | 3936 | public function getPageInfo($pageid = -1, $active = 1, $fields = 'id, pagetitle, description, alias') |
| 3937 | 3937 | { |
@@ -4023,7 +4023,7 @@ discard block |
||
| 4023 | 4023 | * |
| 4024 | 4024 | * @param string $type |
| 4025 | 4025 | * @param bool $report |
| 4026 | - * @return bool |
|
| 4026 | + * @return boolean|null |
|
| 4027 | 4027 | */ |
| 4028 | 4028 | public function clearCache($type = '', $report = false) |
| 4029 | 4029 | { |
@@ -4390,7 +4390,7 @@ discard block |
||
| 4390 | 4390 | * - Placeholders prefix. Default: '{'. |
| 4391 | 4391 | * @param string $suffix {string} |
| 4392 | 4392 | * - Placeholders suffix. Default: '}'. |
| 4393 | - * @return bool|mixed|string {string; false} - Parsed chunk or false if $chunkArr is not array. |
|
| 4393 | + * @return false|string {string; false} - Parsed chunk or false if $chunkArr is not array. |
|
| 4394 | 4394 | * - Parsed chunk or false if $chunkArr is not array. |
| 4395 | 4395 | */ |
| 4396 | 4396 | public function parseChunk($chunkName, $chunkArr, $prefix = '{', $suffix = '}') |
@@ -5366,7 +5366,7 @@ discard block |
||
| 5366 | 5366 | * Remove event listener - only for use within the current execution cycle |
| 5367 | 5367 | * |
| 5368 | 5368 | * @param string $evtName |
| 5369 | - * @return boolean |
|
| 5369 | + * @return false|null |
|
| 5370 | 5370 | */ |
| 5371 | 5371 | public function removeEventListener($evtName) |
| 5372 | 5372 | { |
@@ -5390,7 +5390,7 @@ discard block |
||
| 5390 | 5390 | * |
| 5391 | 5391 | * @param string $evtName |
| 5392 | 5392 | * @param array $extParams Parameters available to plugins. Each array key will be the PHP variable name, and the array value will be the variable value. |
| 5393 | - * @return boolean|array |
|
| 5393 | + * @return false|null |
|
| 5394 | 5394 | */ |
| 5395 | 5395 | public function invokeEvent($evtName, $extParams = array()) |
| 5396 | 5396 | { |
@@ -5985,7 +5985,7 @@ discard block |
||
| 5985 | 5985 | |
| 5986 | 5986 | /** |
| 5987 | 5987 | * @param string $str |
| 5988 | - * @return bool|mixed|string |
|
| 5988 | + * @return string |
|
| 5989 | 5989 | */ |
| 5990 | 5990 | public function atBindFileContent($str = '') |
| 5991 | 5991 | { |
@@ -6036,8 +6036,8 @@ discard block |
||
| 6036 | 6036 | } |
| 6037 | 6037 | |
| 6038 | 6038 | /** |
| 6039 | - * @param $str |
|
| 6040 | - * @return bool|string |
|
| 6039 | + * @param string $str |
|
| 6040 | + * @return false|string |
|
| 6041 | 6041 | */ |
| 6042 | 6042 | public function getExtFromFilename($str) |
| 6043 | 6043 | { |
@@ -6065,7 +6065,7 @@ discard block |
||
| 6065 | 6065 | * @param string $text Error message |
| 6066 | 6066 | * @param string $file File where the error was detected |
| 6067 | 6067 | * @param string $line Line number within $file |
| 6068 | - * @return boolean |
|
| 6068 | + * @return boolean|null |
|
| 6069 | 6069 | */ |
| 6070 | 6070 | public function phpError($nr, $text, $file, $line) |
| 6071 | 6071 | { |
@@ -6117,7 +6117,7 @@ discard block |
||
| 6117 | 6117 | * @param string $text |
| 6118 | 6118 | * @param string $line |
| 6119 | 6119 | * @param string $output |
| 6120 | - * @return bool |
|
| 6120 | + * @return null|boolean |
|
| 6121 | 6121 | */ |
| 6122 | 6122 | public function messageQuit($msg = 'unspecified error', $query = '', $is_error = true, $nr = '', $file = '', $source = '', $text = '', $line = '', $output = '') |
| 6123 | 6123 | { |
@@ -6539,7 +6539,7 @@ discard block |
||
| 6539 | 6539 | |
| 6540 | 6540 | /** |
| 6541 | 6541 | * @param string $str |
| 6542 | - * @return bool|mixed|string |
|
| 6542 | + * @return string |
|
| 6543 | 6543 | */ |
| 6544 | 6544 | public function atBindInclude($str = '') |
| 6545 | 6545 | { |
@@ -6590,7 +6590,7 @@ discard block |
||
| 6590 | 6590 | * @param $str |
| 6591 | 6591 | * @param int $flags |
| 6592 | 6592 | * @param string $encode |
| 6593 | - * @return mixed |
|
| 6593 | + * @return string |
|
| 6594 | 6594 | */ |
| 6595 | 6595 | public function htmlspecialchars($str, $flags = ENT_COMPAT, $encode = '') |
| 6596 | 6596 | { |
@@ -6599,7 +6599,7 @@ discard block |
||
| 6599 | 6599 | } |
| 6600 | 6600 | |
| 6601 | 6601 | /** |
| 6602 | - * @param $string |
|
| 6602 | + * @param string $string |
|
| 6603 | 6603 | * @param bool $returnData |
| 6604 | 6604 | * @return bool|mixed |
| 6605 | 6605 | */ |
@@ -6763,7 +6763,7 @@ discard block |
||
| 6763 | 6763 | } |
| 6764 | 6764 | |
| 6765 | 6765 | /** |
| 6766 | - * @return mixed |
|
| 6766 | + * @return string |
|
| 6767 | 6767 | */ |
| 6768 | 6768 | public function getOutput() |
| 6769 | 6769 | { |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | */ |
| 226 | 226 | function __call($method_name, $arguments) |
| 227 | 227 | { |
| 228 | - include_once(MODX_MANAGER_PATH . 'includes/extenders/deprecated.functions.inc.php'); |
|
| 228 | + include_once(MODX_MANAGER_PATH.'includes/extenders/deprecated.functions.inc.php'); |
|
| 229 | 229 | if (method_exists($this->old, $method_name)) { |
| 230 | 230 | $error_type = 1; |
| 231 | 231 | } else { |
@@ -243,12 +243,12 @@ discard block |
||
| 243 | 243 | $info = debug_backtrace(); |
| 244 | 244 | $m[] = $msg; |
| 245 | 245 | if (!empty($this->currentSnippet)) { |
| 246 | - $m[] = 'Snippet - ' . $this->currentSnippet; |
|
| 246 | + $m[] = 'Snippet - '.$this->currentSnippet; |
|
| 247 | 247 | } elseif (!empty($this->event->activePlugin)) { |
| 248 | - $m[] = 'Plugin - ' . $this->event->activePlugin; |
|
| 248 | + $m[] = 'Plugin - '.$this->event->activePlugin; |
|
| 249 | 249 | } |
| 250 | 250 | $m[] = $this->decoded_request_uri; |
| 251 | - $m[] = str_replace('\\', '/', $info[0]['file']) . '(line:' . $info[0]['line'] . ')'; |
|
| 251 | + $m[] = str_replace('\\', '/', $info[0]['file']).'(line:'.$info[0]['line'].')'; |
|
| 252 | 252 | $msg = implode('<br />', $m); |
| 253 | 253 | $this->logEvent(0, $error_type, $msg, $title); |
| 254 | 254 | } |
@@ -265,7 +265,7 @@ discard block |
||
| 265 | 265 | { |
| 266 | 266 | $flag = false; |
| 267 | 267 | if (is_scalar($connector) && !empty($connector) && isset($this->{$connector}) && $this->{$connector} instanceof DBAPI) { |
| 268 | - $flag = (bool)$this->{$connector}->conn; |
|
| 268 | + $flag = (bool) $this->{$connector}->conn; |
|
| 269 | 269 | } |
| 270 | 270 | return $flag; |
| 271 | 271 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | } |
| 293 | 293 | if (!$out && $flag) { |
| 294 | 294 | $extname = trim(str_replace(array('..', '/', '\\'), '', strtolower($extname))); |
| 295 | - $filename = MODX_MANAGER_PATH . "includes/extenders/ex_{$extname}.inc.php"; |
|
| 295 | + $filename = MODX_MANAGER_PATH."includes/extenders/ex_{$extname}.inc.php"; |
|
| 296 | 296 | $out = is_file($filename) ? include $filename : false; |
| 297 | 297 | } |
| 298 | 298 | if ($out && !in_array($extname, $this->extensions)) { |
@@ -309,7 +309,7 @@ discard block |
||
| 309 | 309 | public function getMicroTime() |
| 310 | 310 | { |
| 311 | 311 | list ($usec, $sec) = explode(' ', microtime()); |
| 312 | - return ((float)$usec + (float)$sec); |
|
| 312 | + return ((float) $usec + (float) $sec); |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | /** |
@@ -333,7 +333,7 @@ discard block |
||
| 333 | 333 | // append the redirect count string to the url |
| 334 | 334 | $currentNumberOfRedirects = isset ($_REQUEST['err']) ? $_REQUEST['err'] : 0; |
| 335 | 335 | if ($currentNumberOfRedirects > 3) { |
| 336 | - $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>' . $url . '</i></p>'); |
|
| 336 | + $this->messageQuit('Redirection attempt failed - please ensure the document you\'re trying to redirect to exists. <p>Redirection URL: <i>'.$url.'</i></p>'); |
|
| 337 | 337 | } else { |
| 338 | 338 | $currentNumberOfRedirects += 1; |
| 339 | 339 | if (strpos($url, "?") > 0) { |
@@ -344,9 +344,9 @@ discard block |
||
| 344 | 344 | } |
| 345 | 345 | } |
| 346 | 346 | if ($type == 'REDIRECT_REFRESH') { |
| 347 | - $header = 'Refresh: 0;URL=' . $url; |
|
| 347 | + $header = 'Refresh: 0;URL='.$url; |
|
| 348 | 348 | } elseif ($type == 'REDIRECT_META') { |
| 349 | - $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL=' . $url . '" />'; |
|
| 349 | + $header = '<META HTTP-EQUIV="Refresh" CONTENT="0; URL='.$url.'" />'; |
|
| 350 | 350 | echo $header; |
| 351 | 351 | exit; |
| 352 | 352 | } elseif ($type == 'REDIRECT_HEADER' || empty ($type)) { |
@@ -354,10 +354,10 @@ discard block |
||
| 354 | 354 | global $base_url, $site_url; |
| 355 | 355 | if (substr($url, 0, strlen($base_url)) == $base_url) { |
| 356 | 356 | // append $site_url to make it work with Location: |
| 357 | - $url = $site_url . substr($url, strlen($base_url)); |
|
| 357 | + $url = $site_url.substr($url, strlen($base_url)); |
|
| 358 | 358 | } |
| 359 | 359 | if (strpos($url, "\n") === false) { |
| 360 | - $header = 'Location: ' . $url; |
|
| 360 | + $header = 'Location: '.$url; |
|
| 361 | 361 | } else { |
| 362 | 362 | $this->messageQuit('No newline allowed in redirect url.'); |
| 363 | 363 | } |
@@ -366,7 +366,7 @@ discard block |
||
| 366 | 366 | header($responseCode); |
| 367 | 367 | } |
| 368 | 368 | |
| 369 | - if(!empty($header)) { |
|
| 369 | + if (!empty($header)) { |
|
| 370 | 370 | header($header); |
| 371 | 371 | } |
| 372 | 372 | |
@@ -471,8 +471,8 @@ discard block |
||
| 471 | 471 | |
| 472 | 472 | private function recoverySiteCache() |
| 473 | 473 | { |
| 474 | - $site_cache_dir = MODX_BASE_PATH . $this->getCacheFolder(); |
|
| 475 | - $site_cache_path = $site_cache_dir . 'siteCache.idx.php'; |
|
| 474 | + $site_cache_dir = MODX_BASE_PATH.$this->getCacheFolder(); |
|
| 475 | + $site_cache_path = $site_cache_dir.'siteCache.idx.php'; |
|
| 476 | 476 | |
| 477 | 477 | if (is_file($site_cache_path)) { |
| 478 | 478 | include($site_cache_path); |
@@ -481,7 +481,7 @@ discard block |
||
| 481 | 481 | return; |
| 482 | 482 | } |
| 483 | 483 | |
| 484 | - include_once(MODX_MANAGER_PATH . 'processors/cache_sync.class.processor.php'); |
|
| 484 | + include_once(MODX_MANAGER_PATH.'processors/cache_sync.class.processor.php'); |
|
| 485 | 485 | $cache = new synccache(); |
| 486 | 486 | $cache->setCachepath($site_cache_dir); |
| 487 | 487 | $cache->setReport(false); |
@@ -533,8 +533,8 @@ discard block |
||
| 533 | 533 | $this->invokeEvent("OnBeforeManagerPageInit"); |
| 534 | 534 | } |
| 535 | 535 | |
| 536 | - if (isset ($_SESSION[$usrType . 'UsrConfigSet'])) { |
|
| 537 | - $usrSettings = &$_SESSION[$usrType . 'UsrConfigSet']; |
|
| 536 | + if (isset ($_SESSION[$usrType.'UsrConfigSet'])) { |
|
| 537 | + $usrSettings = &$_SESSION[$usrType.'UsrConfigSet']; |
|
| 538 | 538 | } else { |
| 539 | 539 | if ($usrType == 'web') { |
| 540 | 540 | $from = $tbl_web_user_settings; |
@@ -554,7 +554,7 @@ discard block |
||
| 554 | 554 | $usrSettings[$row['setting_name']] = $row['setting_value']; |
| 555 | 555 | } |
| 556 | 556 | if (isset ($usrType)) { |
| 557 | - $_SESSION[$usrType . 'UsrConfigSet'] = $usrSettings; |
|
| 557 | + $_SESSION[$usrType.'UsrConfigSet'] = $usrSettings; |
|
| 558 | 558 | } // store user settings in session |
| 559 | 559 | } |
| 560 | 560 | } |
@@ -699,10 +699,10 @@ discard block |
||
| 699 | 699 | $suf = $this->config['friendly_url_suffix']; |
| 700 | 700 | $pre = preg_quote($pre, '/'); |
| 701 | 701 | $suf = preg_quote($suf, '/'); |
| 702 | - if ($pre && preg_match('@^' . $pre . '(.*)$@', $q, $_)) { |
|
| 702 | + if ($pre && preg_match('@^'.$pre.'(.*)$@', $q, $_)) { |
|
| 703 | 703 | $q = $_[1]; |
| 704 | 704 | } |
| 705 | - if ($suf && preg_match('@(.*)' . $suf . '$@', $q, $_)) { |
|
| 705 | + if ($suf && preg_match('@(.*)'.$suf.'$@', $q, $_)) { |
|
| 706 | 706 | $q = $_[1]; |
| 707 | 707 | } |
| 708 | 708 | |
@@ -724,7 +724,7 @@ discard block |
||
| 724 | 724 | if (preg_match('@^[1-9][0-9]*$@', $q) && !isset($this->documentListing[$q])) { /* we got an ID returned, check to make sure it's not an alias */ |
| 725 | 725 | /* FS#476 and FS#308: check that id is valid in terms of virtualDir structure */ |
| 726 | 726 | if ($this->config['use_alias_path'] == 1) { |
| 727 | - if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir . '/' . $q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) { |
|
| 727 | + if (($this->virtualDir != '' && !isset($this->documentListing[$this->virtualDir.'/'.$q]) || ($this->virtualDir == '' && !isset($this->documentListing[$q]))) && (($this->virtualDir != '' && isset($this->documentListing[$this->virtualDir]) && in_array($q, $this->getChildIds($this->documentListing[$this->virtualDir], 1))) || ($this->virtualDir == '' && in_array($q, $this->getChildIds(0, 1))))) { |
|
| 728 | 728 | $this->documentMethod = 'id'; |
| 729 | 729 | return $q; |
| 730 | 730 | } else { /* not a valid id in terms of virtualDir, treat as alias */ |
@@ -758,7 +758,7 @@ discard block |
||
| 758 | 758 | */ |
| 759 | 759 | public function getHashFile($key) |
| 760 | 760 | { |
| 761 | - return $this->getCacheFolder() . "docid_" . $key . ".pageCache.php"; |
|
| 761 | + return $this->getCacheFolder()."docid_".$key.".pageCache.php"; |
|
| 762 | 762 | } |
| 763 | 763 | |
| 764 | 764 | /** |
@@ -769,9 +769,9 @@ discard block |
||
| 769 | 769 | $hash = $id; |
| 770 | 770 | $tmp = null; |
| 771 | 771 | $params = array(); |
| 772 | - if(!empty($this->systemCacheKey)){ |
|
| 772 | + if (!empty($this->systemCacheKey)) { |
|
| 773 | 773 | $hash = $this->systemCacheKey; |
| 774 | - }else { |
|
| 774 | + } else { |
|
| 775 | 775 | if (!empty($_GET)) { |
| 776 | 776 | // Sort GET parameters so that the order of parameters on the HTTP request don't affect the generated cache ID. |
| 777 | 777 | $params = $_GET; |
@@ -779,8 +779,8 @@ discard block |
||
| 779 | 779 | $hash .= '_'.md5(http_build_query($params)); |
| 780 | 780 | } |
| 781 | 781 | } |
| 782 | - $evtOut = $this->invokeEvent("OnMakePageCacheKey", array ("hash" => $hash, "id" => $id, 'params' => $params)); |
|
| 783 | - if (is_array($evtOut) && count($evtOut) > 0){ |
|
| 782 | + $evtOut = $this->invokeEvent("OnMakePageCacheKey", array("hash" => $hash, "id" => $id, 'params' => $params)); |
|
| 783 | + if (is_array($evtOut) && count($evtOut) > 0) { |
|
| 784 | 784 | $tmp = array_pop($evtOut); |
| 785 | 785 | } |
| 786 | 786 | return empty($tmp) ? $hash : $tmp; |
@@ -922,12 +922,12 @@ discard block |
||
| 922 | 922 | if ($js = $this->getRegisteredClientStartupScripts()) { |
| 923 | 923 | // change to just before closing </head> |
| 924 | 924 | // $this->documentContent = preg_replace("/(<head[^>]*>)/i", "\\1\n".$js, $this->documentContent); |
| 925 | - $this->documentOutput = preg_replace("/(<\/head>)/i", $js . "\n\\1", $this->documentOutput); |
|
| 925 | + $this->documentOutput = preg_replace("/(<\/head>)/i", $js."\n\\1", $this->documentOutput); |
|
| 926 | 926 | } |
| 927 | 927 | |
| 928 | 928 | // Insert jscripts & html block into template - template must have a </body> tag |
| 929 | 929 | if ($js = $this->getRegisteredClientScripts()) { |
| 930 | - $this->documentOutput = preg_replace("/(<\/body>)/i", $js . "\n\\1", $this->documentOutput); |
|
| 930 | + $this->documentOutput = preg_replace("/(<\/body>)/i", $js."\n\\1", $this->documentOutput); |
|
| 931 | 931 | } |
| 932 | 932 | // End fix by sirlancelot |
| 933 | 933 | |
@@ -938,7 +938,7 @@ discard block |
||
| 938 | 938 | // send out content-type and content-disposition headers |
| 939 | 939 | if (IN_PARSER_MODE == "true") { |
| 940 | 940 | $type = !empty ($this->contentTypes[$this->documentIdentifier]) ? $this->contentTypes[$this->documentIdentifier] : "text/html"; |
| 941 | - header('Content-Type: ' . $type . '; charset=' . $this->config['modx_charset']); |
|
| 941 | + header('Content-Type: '.$type.'; charset='.$this->config['modx_charset']); |
|
| 942 | 942 | // if (($this->documentIdentifier == $this->config['error_page']) || $redirect_error) |
| 943 | 943 | // header('HTTP/1.0 404 Not Found'); |
| 944 | 944 | if (!$this->checkPreview() && $this->documentObject['content_dispo'] == 1) { |
@@ -956,7 +956,7 @@ discard block |
||
| 956 | 956 | $name = preg_replace('|-+|', '-', $name); |
| 957 | 957 | $name = trim($name, '-'); |
| 958 | 958 | } |
| 959 | - $header = 'Content-Disposition: attachment; filename=' . $name; |
|
| 959 | + $header = 'Content-Disposition: attachment; filename='.$name; |
|
| 960 | 960 | header($header); |
| 961 | 961 | } |
| 962 | 962 | } |
@@ -964,7 +964,7 @@ discard block |
||
| 964 | 964 | |
| 965 | 965 | $stats = $this->getTimerStats($this->tstart); |
| 966 | 966 | |
| 967 | - $out =& $this->documentOutput; |
|
| 967 | + $out = & $this->documentOutput; |
|
| 968 | 968 | $out = str_replace("[^q^]", $stats['queries'], $out); |
| 969 | 969 | $out = str_replace("[^qt^]", $stats['queryTime'], $out); |
| 970 | 970 | $out = str_replace("[^p^]", $stats['phpTime'], $out); |
@@ -1003,17 +1003,17 @@ discard block |
||
| 1003 | 1003 | $sc .= sprintf("%s. %s (%s)<br>", $s, $sname, sprintf("%2.2f ms", $t)); // currentSnippet |
| 1004 | 1004 | $tt += $t; |
| 1005 | 1005 | } |
| 1006 | - echo "<fieldset><legend><b>Snippets</b> (" . count($this->snippetsTime) . " / " . sprintf("%2.2f ms", $tt) . ")</legend>{$sc}</fieldset><br />"; |
|
| 1006 | + echo "<fieldset><legend><b>Snippets</b> (".count($this->snippetsTime)." / ".sprintf("%2.2f ms", $tt).")</legend>{$sc}</fieldset><br />"; |
|
| 1007 | 1007 | echo $this->snippetsCode; |
| 1008 | 1008 | } |
| 1009 | 1009 | if ($this->dumpPlugins) { |
| 1010 | 1010 | $ps = ""; |
| 1011 | 1011 | $tt = 0; |
| 1012 | 1012 | foreach ($this->pluginsTime as $s => $t) { |
| 1013 | - $ps .= "$s (" . sprintf("%2.2f ms", $t * 1000) . ")<br>"; |
|
| 1013 | + $ps .= "$s (".sprintf("%2.2f ms", $t * 1000).")<br>"; |
|
| 1014 | 1014 | $tt += $t; |
| 1015 | 1015 | } |
| 1016 | - echo "<fieldset><legend><b>Plugins</b> (" . count($this->pluginsTime) . " / " . sprintf("%2.2f ms", $tt * 1000) . ")</legend>{$ps}</fieldset><br />"; |
|
| 1016 | + echo "<fieldset><legend><b>Plugins</b> (".count($this->pluginsTime)." / ".sprintf("%2.2f ms", $tt * 1000).")</legend>{$ps}</fieldset><br />"; |
|
| 1017 | 1017 | echo $this->pluginsCode; |
| 1018 | 1018 | } |
| 1019 | 1019 | |
@@ -1039,7 +1039,7 @@ discard block |
||
| 1039 | 1039 | $srcTags = explode(',', $tags); |
| 1040 | 1040 | $repTags = array(); |
| 1041 | 1041 | foreach ($srcTags as $tag) { |
| 1042 | - $repTags[] = '\\' . $tag[0] . '\\' . $tag[1]; |
|
| 1042 | + $repTags[] = '\\'.$tag[0].'\\'.$tag[1]; |
|
| 1043 | 1043 | } |
| 1044 | 1044 | return array($srcTags, $repTags); |
| 1045 | 1045 | } |
@@ -1061,7 +1061,7 @@ discard block |
||
| 1061 | 1061 | $stats['phpTime'] = sprintf("%2.4f s", $stats['phpTime']); |
| 1062 | 1062 | $stats['source'] = $this->documentGenerated == 1 ? "database" : "cache"; |
| 1063 | 1063 | $stats['queries'] = isset ($this->executedQueries) ? $this->executedQueries : 0; |
| 1064 | - $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024) . " mb"; |
|
| 1064 | + $stats['phpMemory'] = (memory_get_peak_usage(true) / 1024 / 1024)." mb"; |
|
| 1065 | 1065 | |
| 1066 | 1066 | return $stats; |
| 1067 | 1067 | } |
@@ -1094,7 +1094,7 @@ discard block |
||
| 1094 | 1094 | { |
| 1095 | 1095 | $cacheRefreshTime = 0; |
| 1096 | 1096 | $recent_update = 0; |
| 1097 | - @include(MODX_BASE_PATH . $this->getCacheFolder() . 'sitePublishing.idx.php'); |
|
| 1097 | + @include(MODX_BASE_PATH.$this->getCacheFolder().'sitePublishing.idx.php'); |
|
| 1098 | 1098 | $this->recentUpdate = $recent_update; |
| 1099 | 1099 | |
| 1100 | 1100 | $timeNow = $_SERVER['REQUEST_TIME'] + $this->config['server_offset_time']; |
@@ -1105,7 +1105,7 @@ discard block |
||
| 1105 | 1105 | // now, check for documents that need publishing |
| 1106 | 1106 | $field = array('published' => 1, 'publishedon' => $timeNow); |
| 1107 | 1107 | $where = "pub_date <= {$timeNow} AND pub_date!=0 AND published=0"; |
| 1108 | - $result_pub = $this->db->select( 'id', '[+prefix+]site_content', $where); |
|
| 1108 | + $result_pub = $this->db->select('id', '[+prefix+]site_content', $where); |
|
| 1109 | 1109 | $this->db->update($field, '[+prefix+]site_content', $where); |
| 1110 | 1110 | if ($this->db->getRecordCount($result_pub) >= 1) { //Event unPublished doc |
| 1111 | 1111 | while ($row_pub = $this->db->getRow($result_pub)) { |
@@ -1118,7 +1118,7 @@ discard block |
||
| 1118 | 1118 | // now, check for documents that need un-publishing |
| 1119 | 1119 | $field = array('published' => 0, 'publishedon' => 0); |
| 1120 | 1120 | $where = "unpub_date <= {$timeNow} AND unpub_date!=0 AND published=1"; |
| 1121 | - $result_unpub = $this->db->select( 'id', '[+prefix+]site_content', $where); |
|
| 1121 | + $result_unpub = $this->db->select('id', '[+prefix+]site_content', $where); |
|
| 1122 | 1122 | $this->db->update($field, '[+prefix+]site_content', $where); |
| 1123 | 1123 | if ($this->db->getRecordCount($result_unpub) >= 1) { //Event unPublished doc |
| 1124 | 1124 | while ($row_unpub = $this->db->getRow($result_unpub)) { |
@@ -1164,8 +1164,8 @@ discard block |
||
| 1164 | 1164 | } |
| 1165 | 1165 | |
| 1166 | 1166 | $docObjSerial = serialize($this->documentObject); |
| 1167 | - $cacheContent = $docObjSerial . "<!--__MODxCacheSpliter__-->" . $this->documentContent; |
|
| 1168 | - $page_cache_path = MODX_BASE_PATH . $this->getHashFile($this->cacheKey); |
|
| 1167 | + $cacheContent = $docObjSerial."<!--__MODxCacheSpliter__-->".$this->documentContent; |
|
| 1168 | + $page_cache_path = MODX_BASE_PATH.$this->getHashFile($this->cacheKey); |
|
| 1169 | 1169 | file_put_contents($page_cache_path, "<?php die('Unauthorized access.'); ?>$cacheContent"); |
| 1170 | 1170 | } |
| 1171 | 1171 | } |
@@ -1207,16 +1207,16 @@ discard block |
||
| 1207 | 1207 | return array(); |
| 1208 | 1208 | } |
| 1209 | 1209 | $spacer = md5('<<<EVO>>>'); |
| 1210 | - if($left==='{{' && strpos($content,';}}')!==false) $content = str_replace(';}}', sprintf(';}%s}', $spacer),$content); |
|
| 1211 | - if($left==='{{' && strpos($content,'{{}}')!==false) $content = str_replace('{{}}',sprintf('{%$1s{}%$1s}',$spacer),$content); |
|
| 1212 | - if($left==='[[' && strpos($content,']]]]')!==false) $content = str_replace(']]]]',sprintf(']]%s]]', $spacer),$content); |
|
| 1213 | - if($left==='[[' && strpos($content,']]]')!==false) $content = str_replace(']]]', sprintf(']%s]]', $spacer),$content); |
|
| 1210 | + if ($left === '{{' && strpos($content, ';}}') !== false) $content = str_replace(';}}', sprintf(';}%s}', $spacer), $content); |
|
| 1211 | + if ($left === '{{' && strpos($content, '{{}}') !== false) $content = str_replace('{{}}', sprintf('{%$1s{}%$1s}', $spacer), $content); |
|
| 1212 | + if ($left === '[[' && strpos($content, ']]]]') !== false) $content = str_replace(']]]]', sprintf(']]%s]]', $spacer), $content); |
|
| 1213 | + if ($left === '[[' && strpos($content, ']]]') !== false) $content = str_replace(']]]', sprintf(']%s]]', $spacer), $content); |
|
| 1214 | 1214 | |
| 1215 | 1215 | $pos['<![CDATA['] = strpos($content, '<![CDATA['); |
| 1216 | 1216 | $pos[']]>'] = strpos($content, ']]>'); |
| 1217 | 1217 | |
| 1218 | 1218 | if ($pos['<![CDATA['] !== false && $pos[']]>'] !== false) { |
| 1219 | - $content = substr($content, 0, $pos['<![CDATA[']) . substr($content, $pos[']]>'] + 3); |
|
| 1219 | + $content = substr($content, 0, $pos['<![CDATA[']).substr($content, $pos[']]>'] + 3); |
|
| 1220 | 1220 | } |
| 1221 | 1221 | |
| 1222 | 1222 | $lp = explode($left, $content); |
@@ -1280,8 +1280,8 @@ discard block |
||
| 1280 | 1280 | } |
| 1281 | 1281 | } |
| 1282 | 1282 | } |
| 1283 | - foreach($tags as $i=>$tag) { |
|
| 1284 | - if(strpos($tag,$spacer)!==false) $tags[$i] = str_replace($spacer, '', $tag); |
|
| 1283 | + foreach ($tags as $i=>$tag) { |
|
| 1284 | + if (strpos($tag, $spacer) !== false) $tags[$i] = str_replace($spacer, '', $tag); |
|
| 1285 | 1285 | } |
| 1286 | 1286 | return $tags; |
| 1287 | 1287 | } |
@@ -1321,7 +1321,7 @@ discard block |
||
| 1321 | 1321 | } |
| 1322 | 1322 | |
| 1323 | 1323 | foreach ($matches[1] as $i => $key) { |
| 1324 | - if(strpos($key,'[+')!==false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content |
|
| 1324 | + if (strpos($key, '[+') !== false) continue; // Allow chunk {{chunk?¶m=`xxx`}} with [*tv_name_[+param+]*] as content |
|
| 1325 | 1325 | if (substr($key, 0, 1) == '#') { |
| 1326 | 1326 | $key = substr($key, 1); |
| 1327 | 1327 | } // remove # for QuickEdit format |
@@ -1341,8 +1341,8 @@ discard block |
||
| 1341 | 1341 | } |
| 1342 | 1342 | |
| 1343 | 1343 | if (is_array($value)) { |
| 1344 | - include_once(MODX_MANAGER_PATH . 'includes/tmplvars.format.inc.php'); |
|
| 1345 | - include_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); |
|
| 1344 | + include_once(MODX_MANAGER_PATH.'includes/tmplvars.format.inc.php'); |
|
| 1345 | + include_once(MODX_MANAGER_PATH.'includes/tmplvars.commands.inc.php'); |
|
| 1346 | 1346 | $value = getTVDisplayFormat($value[0], $value[1], $value[2], $value[3], $value[4]); |
| 1347 | 1347 | } |
| 1348 | 1348 | |
@@ -1353,8 +1353,8 @@ discard block |
||
| 1353 | 1353 | |
| 1354 | 1354 | if (strpos($content, $s) !== false) { |
| 1355 | 1355 | $content = str_replace($s, $value, $content); |
| 1356 | - } elseif($this->debug) { |
|
| 1357 | - $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 1356 | + } elseif ($this->debug) { |
|
| 1357 | + $this->addLog('mergeDocumentContent parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 1358 | 1358 | } |
| 1359 | 1359 | } |
| 1360 | 1360 | |
@@ -1521,8 +1521,8 @@ discard block |
||
| 1521 | 1521 | $s = &$matches[0][$i]; |
| 1522 | 1522 | if (strpos($content, $s) !== false) { |
| 1523 | 1523 | $content = str_replace($s, $value, $content); |
| 1524 | - } elseif($this->debug) { |
|
| 1525 | - $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 1524 | + } elseif ($this->debug) { |
|
| 1525 | + $this->addLog('mergeSettingsContent parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 1526 | 1526 | } |
| 1527 | 1527 | } |
| 1528 | 1528 | return $content; |
@@ -1575,7 +1575,7 @@ discard block |
||
| 1575 | 1575 | } |
| 1576 | 1576 | |
| 1577 | 1577 | $value = $this->parseText($value, $params); // parse local scope placeholers for ConditionalTags |
| 1578 | - $value = $this->mergePlaceholderContent($value, $params); // parse page global placeholers |
|
| 1578 | + $value = $this->mergePlaceholderContent($value, $params); // parse page global placeholers |
|
| 1579 | 1579 | if ($this->config['enable_at_syntax']) { |
| 1580 | 1580 | $value = $this->mergeConditionalTagsContent($value); |
| 1581 | 1581 | } |
@@ -1590,8 +1590,8 @@ discard block |
||
| 1590 | 1590 | $s = &$matches[0][$i]; |
| 1591 | 1591 | if (strpos($content, $s) !== false) { |
| 1592 | 1592 | $content = str_replace($s, $value, $content); |
| 1593 | - } elseif($this->debug) { |
|
| 1594 | - $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 1593 | + } elseif ($this->debug) { |
|
| 1594 | + $this->addLog('mergeChunkContent parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 1595 | 1595 | } |
| 1596 | 1596 | } |
| 1597 | 1597 | return $content; |
@@ -1649,8 +1649,8 @@ discard block |
||
| 1649 | 1649 | $s = &$matches[0][$i]; |
| 1650 | 1650 | if (strpos($content, $s) !== false) { |
| 1651 | 1651 | $content = str_replace($s, $value, $content); |
| 1652 | - } elseif($this->debug) { |
|
| 1653 | - $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 1652 | + } elseif ($this->debug) { |
|
| 1653 | + $this->addLog('mergePlaceholderContent parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 1654 | 1654 | } |
| 1655 | 1655 | } |
| 1656 | 1656 | return $content; |
@@ -1674,7 +1674,7 @@ discard block |
||
| 1674 | 1674 | return $content; |
| 1675 | 1675 | } |
| 1676 | 1676 | |
| 1677 | - $sp = '#' . md5('ConditionalTags' . $_SERVER['REQUEST_TIME']) . '#'; |
|
| 1677 | + $sp = '#'.md5('ConditionalTags'.$_SERVER['REQUEST_TIME']).'#'; |
|
| 1678 | 1678 | $content = str_replace(array('<?php', '<?=', '<?', '?>'), array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), $content); |
| 1679 | 1679 | |
| 1680 | 1680 | $pieces = explode('<@IF:', $content); |
@@ -1685,7 +1685,7 @@ discard block |
||
| 1685 | 1685 | } |
| 1686 | 1686 | list($cmd, $text) = explode('>', $split, 2); |
| 1687 | 1687 | $cmd = str_replace("'", "\'", $cmd); |
| 1688 | - $content .= "<?php if(\$this->_parseCTagCMD('" . $cmd . "')): ?>"; |
|
| 1688 | + $content .= "<?php if(\$this->_parseCTagCMD('".$cmd."')): ?>"; |
|
| 1689 | 1689 | $content .= $text; |
| 1690 | 1690 | } |
| 1691 | 1691 | $pieces = explode('<@ELSEIF:', $content); |
@@ -1696,13 +1696,13 @@ discard block |
||
| 1696 | 1696 | } |
| 1697 | 1697 | list($cmd, $text) = explode('>', $split, 2); |
| 1698 | 1698 | $cmd = str_replace("'", "\'", $cmd); |
| 1699 | - $content .= "<?php elseif(\$this->_parseCTagCMD('" . $cmd . "')): ?>"; |
|
| 1699 | + $content .= "<?php elseif(\$this->_parseCTagCMD('".$cmd."')): ?>"; |
|
| 1700 | 1700 | $content .= $text; |
| 1701 | 1701 | } |
| 1702 | 1702 | |
| 1703 | 1703 | $content = str_replace(array('<@ELSE>', '<@ENDIF>'), array('<?php else:?>', '<?php endif;?>'), $content); |
| 1704 | 1704 | ob_start(); |
| 1705 | - $content = eval('?>' . $content); |
|
| 1705 | + $content = eval('?>'.$content); |
|
| 1706 | 1706 | $content = ob_get_clean(); |
| 1707 | 1707 | $content = str_replace(array("{$sp}b", "{$sp}p", "{$sp}s", "{$sp}e"), array('<?php', '<?=', '<?', '?>'), $content); |
| 1708 | 1708 | |
@@ -1827,7 +1827,7 @@ discard block |
||
| 1827 | 1827 | $matches = $this->getTagsFromContent($content, $left, $right); |
| 1828 | 1828 | if (!empty($matches)) { |
| 1829 | 1829 | foreach ($matches[0] as $i => $v) { |
| 1830 | - $addBreakMatches[$i] = $v . "\n"; |
|
| 1830 | + $addBreakMatches[$i] = $v."\n"; |
|
| 1831 | 1831 | } |
| 1832 | 1832 | $content = str_replace($addBreakMatches, '', $content); |
| 1833 | 1833 | if (strpos($content, $left) !== false) { |
@@ -1860,8 +1860,8 @@ discard block |
||
| 1860 | 1860 | $s = &$matches[0][$i]; |
| 1861 | 1861 | if (strpos($content, $s) !== false) { |
| 1862 | 1862 | $content = str_replace($s, $v, $content); |
| 1863 | - } elseif($this->debug) { |
|
| 1864 | - $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 1863 | + } elseif ($this->debug) { |
|
| 1864 | + $this->addLog('ignoreCommentedTagsContent parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 1865 | 1865 | } |
| 1866 | 1866 | } |
| 1867 | 1867 | return $content; |
@@ -1925,7 +1925,7 @@ discard block |
||
| 1925 | 1925 | $msg = ($msg === false) ? 'ob_get_contents() error' : $msg; |
| 1926 | 1926 | $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Plugin', $error_info['message'], $error_info['line'], $msg); |
| 1927 | 1927 | if ($this->isBackend()) { |
| 1928 | - $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>' . $msg . '</p>'); |
|
| 1928 | + $this->event->alert('An error occurred while loading. Please see the event log for more information.<p>'.$msg.'</p>'); |
|
| 1929 | 1929 | } |
| 1930 | 1930 | } |
| 1931 | 1931 | } else { |
@@ -1971,7 +1971,7 @@ discard block |
||
| 1971 | 1971 | $echo = ($echo === false) ? 'ob_get_contents() error' : $echo; |
| 1972 | 1972 | $this->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], 'Snippet', $error_info['message'], $error_info['line'], $echo); |
| 1973 | 1973 | if ($this->isBackend()) { |
| 1974 | - $this->event->alert('An error occurred while loading. Please see the event log for more information<p>' . $echo . $return . '</p>'); |
|
| 1974 | + $this->event->alert('An error occurred while loading. Please see the event log for more information<p>'.$echo.$return.'</p>'); |
|
| 1975 | 1975 | } |
| 1976 | 1976 | } |
| 1977 | 1977 | } |
@@ -1979,7 +1979,7 @@ discard block |
||
| 1979 | 1979 | if (is_array($return) || is_object($return)) { |
| 1980 | 1980 | return $return; |
| 1981 | 1981 | } else { |
| 1982 | - return $echo . $return; |
|
| 1982 | + return $echo.$return; |
|
| 1983 | 1983 | } |
| 1984 | 1984 | } |
| 1985 | 1985 | |
@@ -2017,8 +2017,8 @@ discard block |
||
| 2017 | 2017 | } |
| 2018 | 2018 | if (strpos($content, $s) !== false) { |
| 2019 | 2019 | $content = str_replace($s, $value, $content); |
| 2020 | - } elseif($this->debug) { |
|
| 2021 | - $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 2020 | + } elseif ($this->debug) { |
|
| 2021 | + $this->addLog('evalSnippetsSGVar parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 2022 | 2022 | } |
| 2023 | 2023 | continue; |
| 2024 | 2024 | } |
@@ -2029,8 +2029,8 @@ discard block |
||
| 2029 | 2029 | |
| 2030 | 2030 | if (strpos($content, $s) !== false) { |
| 2031 | 2031 | $content = str_replace($s, $value, $content); |
| 2032 | - } elseif($this->debug) { |
|
| 2033 | - $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 2032 | + } elseif ($this->debug) { |
|
| 2033 | + $this->addLog('evalSnippets parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 2034 | 2034 | } |
| 2035 | 2035 | } |
| 2036 | 2036 | |
@@ -2121,7 +2121,7 @@ discard block |
||
| 2121 | 2121 | $eventtime = sprintf('%2.2f ms', $eventtime * 1000); |
| 2122 | 2122 | $code = str_replace("\t", ' ', $this->htmlspecialchars($value)); |
| 2123 | 2123 | $piece = str_replace("\t", ' ', $this->htmlspecialchars($piece)); |
| 2124 | - $print_r_params = str_replace("\t", ' ', $this->htmlspecialchars('$modx->event->params = ' . print_r($params, true))); |
|
| 2124 | + $print_r_params = str_replace("\t", ' ', $this->htmlspecialchars('$modx->event->params = '.print_r($params, true))); |
|
| 2125 | 2125 | $this->snippetsCode .= sprintf('<fieldset style="margin:1em;"><legend><b>%s</b>(%s)</legend><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">[[%s]]</pre><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">%s</pre><pre style="white-space: pre-wrap;background-color:#fff;width:90%%;">%s</pre></fieldset>', $snippetObject['name'], $eventtime, $piece, $print_r_params, $code); |
| 2126 | 2126 | $this->snippetsTime[] = array('sname' => $key, 'time' => $eventtime); |
| 2127 | 2127 | } |
@@ -2366,7 +2366,7 @@ discard block |
||
| 2366 | 2366 | $rs = $this->db->select('name,snippet,properties', '[+prefix+]site_snippets', $where); |
| 2367 | 2367 | $count = $this->db->getRecordCount($rs); |
| 2368 | 2368 | if (1 < $count) { |
| 2369 | - exit('Error $modx->_getSnippetObject()' . $snip_name); |
|
| 2369 | + exit('Error $modx->_getSnippetObject()'.$snip_name); |
|
| 2370 | 2370 | } |
| 2371 | 2371 | if ($count) { |
| 2372 | 2372 | $row = $this->db->getRow($rs); |
@@ -2392,7 +2392,7 @@ discard block |
||
| 2392 | 2392 | public function toAlias($text) |
| 2393 | 2393 | { |
| 2394 | 2394 | $suff = $this->config['friendly_url_suffix']; |
| 2395 | - return str_replace(array('.xml' . $suff, '.rss' . $suff, '.js' . $suff, '.css' . $suff, '.txt' . $suff, '.json' . $suff, '.pdf' . $suff), array('.xml', '.rss', '.js', '.css', '.txt', '.json', '.pdf'), $text); |
|
| 2395 | + return str_replace(array('.xml'.$suff, '.rss'.$suff, '.js'.$suff, '.css'.$suff, '.txt'.$suff, '.json'.$suff, '.pdf'.$suff), array('.xml', '.rss', '.js', '.css', '.txt', '.json', '.pdf'), $text); |
|
| 2396 | 2396 | } |
| 2397 | 2397 | |
| 2398 | 2398 | /** |
@@ -2424,7 +2424,7 @@ discard block |
||
| 2424 | 2424 | $suff = '/'; |
| 2425 | 2425 | } |
| 2426 | 2426 | |
| 2427 | - $url = ($dir != '' ? $dir . '/' : '') . $pre . $alias . $suff; |
|
| 2427 | + $url = ($dir != '' ? $dir.'/' : '').$pre.$alias.$suff; |
|
| 2428 | 2428 | } |
| 2429 | 2429 | |
| 2430 | 2430 | $evtOut = $this->invokeEvent('OnMakeDocUrl', array( |
@@ -2461,7 +2461,7 @@ discard block |
||
| 2461 | 2461 | preg_match_all('!\[\~([0-9]+)\~\]!ise', $documentSource, $match); |
| 2462 | 2462 | $ids = implode(',', array_unique($match['1'])); |
| 2463 | 2463 | if ($ids) { |
| 2464 | - $res = $this->db->select("id,alias,isfolder,parent,alias_visible", $this->getFullTableName('site_content'), "id IN (" . $ids . ") AND isfolder = '0'"); |
|
| 2464 | + $res = $this->db->select("id,alias,isfolder,parent,alias_visible", $this->getFullTableName('site_content'), "id IN (".$ids.") AND isfolder = '0'"); |
|
| 2465 | 2465 | while ($row = $this->db->getRow($res)) { |
| 2466 | 2466 | if ($this->config['use_alias_path'] == '1' && $row['parent'] != 0) { |
| 2467 | 2467 | $parent = $row['parent']; |
@@ -2472,7 +2472,7 @@ discard block |
||
| 2472 | 2472 | $parent = $this->aliasListing[$parent]['parent']; |
| 2473 | 2473 | } |
| 2474 | 2474 | |
| 2475 | - $aliases[$row['id']] = $path . '/' . $row['alias']; |
|
| 2475 | + $aliases[$row['id']] = $path.'/'.$row['alias']; |
|
| 2476 | 2476 | } else { |
| 2477 | 2477 | $aliases[$row['id']] = $row['alias']; |
| 2478 | 2478 | } |
@@ -2484,7 +2484,7 @@ discard block |
||
| 2484 | 2484 | $isfriendly = ($this->config['friendly_alias_urls'] == 1 ? 1 : 0); |
| 2485 | 2485 | $pref = $this->config['friendly_url_prefix']; |
| 2486 | 2486 | $suff = $this->config['friendly_url_suffix']; |
| 2487 | - $documentSource = preg_replace_callback($in, function ($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) { |
|
| 2487 | + $documentSource = preg_replace_callback($in, function($m) use ($aliases, $isfolder, $isfriendly, $pref, $suff) { |
|
| 2488 | 2488 | global $modx; |
| 2489 | 2489 | $thealias = $aliases[$m[1]]; |
| 2490 | 2490 | $thefolder = $isfolder[$m[1]]; |
@@ -2500,7 +2500,7 @@ discard block |
||
| 2500 | 2500 | |
| 2501 | 2501 | } else { |
| 2502 | 2502 | $in = '!\[\~([0-9]+)\~\]!is'; |
| 2503 | - $out = "index.php?id=" . '\1'; |
|
| 2503 | + $out = "index.php?id=".'\1'; |
|
| 2504 | 2504 | $documentSource = preg_replace($in, $out, $documentSource); |
| 2505 | 2505 | } |
| 2506 | 2506 | |
@@ -2521,7 +2521,7 @@ discard block |
||
| 2521 | 2521 | $scheme = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 'https' : 'http'; |
| 2522 | 2522 | $len_base_url = strlen($this->config['base_url']); |
| 2523 | 2523 | |
| 2524 | - $url_path = $q;//LANG |
|
| 2524 | + $url_path = $q; //LANG |
|
| 2525 | 2525 | |
| 2526 | 2526 | if (substr($url_path, 0, $len_base_url) === $this->config['base_url']) { |
| 2527 | 2527 | $url_path = substr($url_path, $len_base_url); |
@@ -2533,7 +2533,7 @@ discard block |
||
| 2533 | 2533 | $strictURL = substr($strictURL, $len_base_url); |
| 2534 | 2534 | } |
| 2535 | 2535 | $http_host = $_SERVER['HTTP_HOST']; |
| 2536 | - $requestedURL = "{$scheme}://{$http_host}" . '/' . $q; //LANG |
|
| 2536 | + $requestedURL = "{$scheme}://{$http_host}".'/'.$q; //LANG |
|
| 2537 | 2537 | |
| 2538 | 2538 | $site_url = $this->config['site_url']; |
| 2539 | 2539 | $url_query_string = explode('?', $_SERVER['REQUEST_URI']); |
@@ -2551,7 +2551,7 @@ discard block |
||
| 2551 | 2551 | } |
| 2552 | 2552 | if ($this->config['base_url'] != $_SERVER['REQUEST_URI']) { |
| 2553 | 2553 | if (empty($_POST)) { |
| 2554 | - if (($this->config['base_url'] . '?' . $qstring) != $_SERVER['REQUEST_URI']) { |
|
| 2554 | + if (($this->config['base_url'].'?'.$qstring) != $_SERVER['REQUEST_URI']) { |
|
| 2555 | 2555 | $this->sendRedirect($url, 0, 'REDIRECT_HEADER', 'HTTP/1.0 301 Moved Permanently'); |
| 2556 | 2556 | exit(0); |
| 2557 | 2557 | } |
@@ -2610,7 +2610,7 @@ discard block |
||
| 2610 | 2610 | $docgrp = implode(",", $docgrp); |
| 2611 | 2611 | } |
| 2612 | 2612 | // get document |
| 2613 | - $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 2613 | + $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 2614 | 2614 | $rs = $this->db->select('sc.*', "{$tblsc} sc |
| 2615 | 2615 | LEFT JOIN {$tbldg} dg ON dg.document = sc.id", "sc.{$method} = '{$identifier}' AND ({$access})", "", 1); |
| 2616 | 2616 | if ($this->db->getRecordCount($rs) < 1) { |
@@ -2646,9 +2646,9 @@ discard block |
||
| 2646 | 2646 | } |
| 2647 | 2647 | if ($documentObject['template']) { |
| 2648 | 2648 | // load TVs and merge with document - Orig by Apodigm - Docvars |
| 2649 | - $rs = $this->db->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getFullTableName("site_tmplvars") . " tv |
|
| 2650 | - INNER JOIN " . $this->getFullTableName("site_tmplvar_templates") . " tvtpl ON tvtpl.tmplvarid = tv.id |
|
| 2651 | - LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues") . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'"); |
|
| 2649 | + $rs = $this->db->select("tv.*, IF(tvc.value!='',tvc.value,tv.default_text) as value", $this->getFullTableName("site_tmplvars")." tv |
|
| 2650 | + INNER JOIN " . $this->getFullTableName("site_tmplvar_templates")." tvtpl ON tvtpl.tmplvarid = tv.id |
|
| 2651 | + LEFT JOIN " . $this->getFullTableName("site_tmplvar_contentvalues")." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$documentObject['id']}'", "tvtpl.templateid = '{$documentObject['template']}'"); |
|
| 2652 | 2652 | $tmplvars = array(); |
| 2653 | 2653 | while ($row = $this->db->getRow($rs)) { |
| 2654 | 2654 | $tmplvars[$row['name']] = array( |
@@ -2694,7 +2694,7 @@ discard block |
||
| 2694 | 2694 | $st = md5($source); |
| 2695 | 2695 | } |
| 2696 | 2696 | if ($this->dumpSnippets == 1) { |
| 2697 | - $this->snippetsCode .= "<fieldset><legend><b style='color: #821517;'>PARSE PASS " . ($i + 1) . "</b></legend><p>The following snippets (if any) were parsed during this pass.</p>"; |
|
| 2697 | + $this->snippetsCode .= "<fieldset><legend><b style='color: #821517;'>PARSE PASS ".($i + 1)."</b></legend><p>The following snippets (if any) were parsed during this pass.</p>"; |
|
| 2698 | 2698 | } |
| 2699 | 2699 | |
| 2700 | 2700 | // invoke OnParseDocument event |
@@ -2736,7 +2736,7 @@ discard block |
||
| 2736 | 2736 | */ |
| 2737 | 2737 | public function executeParser() |
| 2738 | 2738 | { |
| 2739 | - if(MODX_CLI) { |
|
| 2739 | + if (MODX_CLI) { |
|
| 2740 | 2740 | throw new RuntimeException('Call DocumentParser::executeParser on CLI mode'); |
| 2741 | 2741 | } |
| 2742 | 2742 | |
@@ -2782,7 +2782,7 @@ discard block |
||
| 2782 | 2782 | |
| 2783 | 2783 | // Check use_alias_path and check if $this->virtualDir is set to anything, then parse the path |
| 2784 | 2784 | if ($this->config['use_alias_path'] == 1) { |
| 2785 | - $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir . '/' : '') . $this->documentIdentifier; |
|
| 2785 | + $alias = (strlen($this->virtualDir) > 0 ? $this->virtualDir.'/' : '').$this->documentIdentifier; |
|
| 2786 | 2786 | if (isset($this->documentListing[$alias])) { |
| 2787 | 2787 | $this->documentIdentifier = $this->documentListing[$alias]; |
| 2788 | 2788 | } else { |
@@ -2843,7 +2843,7 @@ discard block |
||
| 2843 | 2843 | } else { |
| 2844 | 2844 | $docAlias = $this->db->escape($this->documentIdentifier); |
| 2845 | 2845 | $rs = $this->db->select('id', $this->getFullTableName('site_content'), "deleted=0 and alias='{$docAlias}'"); |
| 2846 | - $this->documentIdentifier = (int)$this->db->getValue($rs); |
|
| 2846 | + $this->documentIdentifier = (int) $this->db->getValue($rs); |
|
| 2847 | 2847 | } |
| 2848 | 2848 | } |
| 2849 | 2849 | $this->documentMethod = 'id'; |
@@ -2900,7 +2900,7 @@ discard block |
||
| 2900 | 2900 | $_REQUEST[$n] = $_GET[$n] = $v; |
| 2901 | 2901 | } |
| 2902 | 2902 | } |
| 2903 | - $_SERVER['PHP_SELF'] = $this->config['base_url'] . $qp['path']; |
|
| 2903 | + $_SERVER['PHP_SELF'] = $this->config['base_url'].$qp['path']; |
|
| 2904 | 2904 | $this->q = $qp['path']; |
| 2905 | 2905 | return $qp['path']; |
| 2906 | 2906 | } |
@@ -2994,7 +2994,7 @@ discard block |
||
| 2994 | 2994 | $this->sendErrorPage(); |
| 2995 | 2995 | } else { |
| 2996 | 2996 | // Inculde the necessary files to check document permissions |
| 2997 | - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); |
|
| 2997 | + include_once(MODX_MANAGER_PATH.'processors/user_documents_permissions.class.php'); |
|
| 2998 | 2998 | $udperms = new udperms(); |
| 2999 | 2999 | $udperms->user = $this->getLoginUserID(); |
| 3000 | 3000 | $udperms->document = $this->documentIdentifier; |
@@ -3048,7 +3048,7 @@ discard block |
||
| 3048 | 3048 | while ($id && $height--) { |
| 3049 | 3049 | $thisid = $id; |
| 3050 | 3050 | if ($this->config['aliaslistingfolder'] == 1) { |
| 3051 | - $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->db->getValue("SELECT `parent` FROM " . $this->getFullTableName("site_content") . " WHERE `id` = '{$id}' LIMIT 0,1"); |
|
| 3051 | + $id = isset($this->aliasListing[$id]['parent']) ? $this->aliasListing[$id]['parent'] : $this->db->getValue("SELECT `parent` FROM ".$this->getFullTableName("site_content")." WHERE `id` = '{$id}' LIMIT 0,1"); |
|
| 3052 | 3052 | if (!$id || $id == '0') { |
| 3053 | 3053 | break; |
| 3054 | 3054 | } |
@@ -3099,15 +3099,15 @@ discard block |
||
| 3099 | 3099 | |
| 3100 | 3100 | if ($this->config['aliaslistingfolder'] == 1) { |
| 3101 | 3101 | |
| 3102 | - $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (" . $id . ") AND deleted = '0'"); |
|
| 3102 | + $res = $this->db->select("id,alias,isfolder,parent", $this->getFullTableName('site_content'), "parent IN (".$id.") AND deleted = '0'"); |
|
| 3103 | 3103 | $idx = array(); |
| 3104 | 3104 | while ($row = $this->db->getRow($res)) { |
| 3105 | 3105 | $pAlias = ''; |
| 3106 | 3106 | if (isset($this->aliasListing[$row['parent']])) { |
| 3107 | - $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'] . '/' : ''; |
|
| 3108 | - $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'] . '/' : ''; |
|
| 3107 | + $pAlias .= !empty($this->aliasListing[$row['parent']]['path']) ? $this->aliasListing[$row['parent']]['path'].'/' : ''; |
|
| 3108 | + $pAlias .= !empty($this->aliasListing[$row['parent']]['alias']) ? $this->aliasListing[$row['parent']]['alias'].'/' : ''; |
|
| 3109 | 3109 | }; |
| 3110 | - $children[$pAlias . $row['alias']] = $row['id']; |
|
| 3110 | + $children[$pAlias.$row['alias']] = $row['id']; |
|
| 3111 | 3111 | if ($row['isfolder'] == 1) { |
| 3112 | 3112 | $idx[] = $row['id']; |
| 3113 | 3113 | } |
@@ -3139,7 +3139,7 @@ discard block |
||
| 3139 | 3139 | $depth--; |
| 3140 | 3140 | |
| 3141 | 3141 | foreach ($documentMap_cache[$id] as $childId) { |
| 3142 | - $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '') . $this->aliasListing[$childId]['alias']; |
|
| 3142 | + $pkey = (strlen($this->aliasListing[$childId]['path']) ? "{$this->aliasListing[$childId]['path']}/" : '').$this->aliasListing[$childId]['alias']; |
|
| 3143 | 3143 | if (!strlen($pkey)) { |
| 3144 | 3144 | $pkey = "{$childId}"; |
| 3145 | 3145 | } |
@@ -3176,7 +3176,7 @@ discard block |
||
| 3176 | 3176 | $fnc = 'history.back(-1);'; |
| 3177 | 3177 | break; |
| 3178 | 3178 | default: |
| 3179 | - $fnc = "window.location.href='" . addslashes($url) . "';"; |
|
| 3179 | + $fnc = "window.location.href='".addslashes($url)."';"; |
|
| 3180 | 3180 | } |
| 3181 | 3181 | |
| 3182 | 3182 | echo "<html><head> |
@@ -3208,9 +3208,9 @@ discard block |
||
| 3208 | 3208 | $state = 0; |
| 3209 | 3209 | $pms = $_SESSION['mgrPermissions']; |
| 3210 | 3210 | if ($pms) { |
| 3211 | - $state = ((bool)$pms[$pm] === true); |
|
| 3211 | + $state = ((bool) $pms[$pm] === true); |
|
| 3212 | 3212 | } |
| 3213 | - return (int)$state; |
|
| 3213 | + return (int) $state; |
|
| 3214 | 3214 | } |
| 3215 | 3215 | |
| 3216 | 3216 | /** |
@@ -3223,8 +3223,8 @@ discard block |
||
| 3223 | 3223 | */ |
| 3224 | 3224 | public function elementIsLocked($type, $id, $includeThisUser = false) |
| 3225 | 3225 | { |
| 3226 | - $id = (int)$id; |
|
| 3227 | - $type = (int)$type; |
|
| 3226 | + $id = (int) $id; |
|
| 3227 | + $type = (int) $type; |
|
| 3228 | 3228 | if (!$type || !$id) { |
| 3229 | 3229 | return null; |
| 3230 | 3230 | } |
@@ -3274,7 +3274,7 @@ discard block |
||
| 3274 | 3274 | return $lockedElements; |
| 3275 | 3275 | } |
| 3276 | 3276 | |
| 3277 | - $type = (int)$type; |
|
| 3277 | + $type = (int) $type; |
|
| 3278 | 3278 | if (isset($lockedElements[$type])) { |
| 3279 | 3279 | return $lockedElements[$type]; |
| 3280 | 3280 | } else { |
@@ -3291,7 +3291,7 @@ discard block |
||
| 3291 | 3291 | $this->lockedElements = array(); |
| 3292 | 3292 | $this->cleanupExpiredLocks(); |
| 3293 | 3293 | |
| 3294 | - $rs = $this->db->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getFullTableName('active_user_locks') . " ul |
|
| 3294 | + $rs = $this->db->select('sid,internalKey,elementType,elementId,lasthit,username', $this->getFullTableName('active_user_locks')." ul |
|
| 3295 | 3295 | LEFT JOIN {$this->getFullTableName('manager_users')} mu on ul.internalKey = mu.id"); |
| 3296 | 3296 | while ($row = $this->db->getRow($rs)) { |
| 3297 | 3297 | $this->lockedElements[$row['elementType']][$row['elementId']] = array( |
@@ -3314,7 +3314,7 @@ discard block |
||
| 3314 | 3314 | public function cleanupExpiredLocks() |
| 3315 | 3315 | { |
| 3316 | 3316 | // Clean-up active_user_sessions first |
| 3317 | - $timeout = (int)$this->config['session_timeout'] < 2 ? 120 : $this->config['session_timeout'] * 60; // session.js pings every 10min, updateMail() in mainMenu pings every minute, so 2min is minimum |
|
| 3317 | + $timeout = (int) $this->config['session_timeout'] < 2 ? 120 : $this->config['session_timeout'] * 60; // session.js pings every 10min, updateMail() in mainMenu pings every minute, so 2min is minimum |
|
| 3318 | 3318 | $validSessionTimeLimit = $this->time - $timeout; |
| 3319 | 3319 | $this->db->delete($this->getFullTableName('active_user_sessions'), "lasthit < {$validSessionTimeLimit}"); |
| 3320 | 3320 | |
@@ -3327,7 +3327,7 @@ discard block |
||
| 3327 | 3327 | foreach ($rs as $row) { |
| 3328 | 3328 | $userSids[] = $row['sid']; |
| 3329 | 3329 | } |
| 3330 | - $userSids = "'" . implode("','", $userSids) . "'"; |
|
| 3330 | + $userSids = "'".implode("','", $userSids)."'"; |
|
| 3331 | 3331 | $this->db->delete($this->getFullTableName('active_user_locks'), "sid NOT IN({$userSids})"); |
| 3332 | 3332 | } else { |
| 3333 | 3333 | $this->db->delete($this->getFullTableName('active_user_locks')); |
@@ -3411,8 +3411,8 @@ discard block |
||
| 3411 | 3411 | public function lockElement($type, $id) |
| 3412 | 3412 | { |
| 3413 | 3413 | $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0; |
| 3414 | - $type = (int)$type; |
|
| 3415 | - $id = (int)$id; |
|
| 3414 | + $type = (int) $type; |
|
| 3415 | + $id = (int) $id; |
|
| 3416 | 3416 | if (!$type || !$id || !$userId) { |
| 3417 | 3417 | return false; |
| 3418 | 3418 | } |
@@ -3433,8 +3433,8 @@ discard block |
||
| 3433 | 3433 | public function unlockElement($type, $id, $includeAllUsers = false) |
| 3434 | 3434 | { |
| 3435 | 3435 | $userId = $this->isBackend() && $_SESSION['mgrInternalKey'] ? $_SESSION['mgrInternalKey'] : 0; |
| 3436 | - $type = (int)$type; |
|
| 3437 | - $id = (int)$id; |
|
| 3436 | + $type = (int) $type; |
|
| 3437 | + $id = (int) $id; |
|
| 3438 | 3438 | if (!$type || !$id) { |
| 3439 | 3439 | return false; |
| 3440 | 3440 | } |
@@ -3501,8 +3501,8 @@ discard block |
||
| 3501 | 3501 | } |
| 3502 | 3502 | |
| 3503 | 3503 | $usertype = $this->isFrontend() ? 1 : 0; |
| 3504 | - $evtid = (int)$evtid; |
|
| 3505 | - $type = (int)$type; |
|
| 3504 | + $evtid = (int) $evtid; |
|
| 3505 | + $type = (int) $type; |
|
| 3506 | 3506 | |
| 3507 | 3507 | // Types: 1 = information, 2 = warning, 3 = error |
| 3508 | 3508 | if ($type < 1) { |
@@ -3524,8 +3524,8 @@ discard block |
||
| 3524 | 3524 | if (isset($this->config['send_errormail']) && $this->config['send_errormail'] !== '0') { |
| 3525 | 3525 | if ($this->config['send_errormail'] <= $type) { |
| 3526 | 3526 | $this->sendmail(array( |
| 3527 | - 'subject' => 'MODX System Error on ' . $this->config['site_name'], |
|
| 3528 | - 'body' => 'Source: ' . $source . ' - The details of the error could be seen in the MODX system events log.', |
|
| 3527 | + 'subject' => 'MODX System Error on '.$this->config['site_name'], |
|
| 3528 | + 'body' => 'Source: '.$source.' - The details of the error could be seen in the MODX system events log.', |
|
| 3529 | 3529 | 'type' => 'text' |
| 3530 | 3530 | )); |
| 3531 | 3531 | } |
@@ -3573,7 +3573,7 @@ discard block |
||
| 3573 | 3573 | $p['fromname'] = $userinfo['username']; |
| 3574 | 3574 | } |
| 3575 | 3575 | if ($msg === '' && !isset($p['body'])) { |
| 3576 | - $p['body'] = $_SERVER['REQUEST_URI'] . "\n" . $_SERVER['HTTP_USER_AGENT'] . "\n" . $_SERVER['HTTP_REFERER']; |
|
| 3576 | + $p['body'] = $_SERVER['REQUEST_URI']."\n".$_SERVER['HTTP_USER_AGENT']."\n".$_SERVER['HTTP_REFERER']; |
|
| 3577 | 3577 | } elseif (is_string($msg) && 0 < strlen($msg)) { |
| 3578 | 3578 | $p['body'] = $msg; |
| 3579 | 3579 | } |
@@ -3613,8 +3613,8 @@ discard block |
||
| 3613 | 3613 | $files = array(); |
| 3614 | 3614 | } |
| 3615 | 3615 | foreach ($files as $f) { |
| 3616 | - if (file_exists(MODX_BASE_PATH . $f) && is_file(MODX_BASE_PATH . $f) && is_readable(MODX_BASE_PATH . $f)) { |
|
| 3617 | - $this->mail->AddAttachment(MODX_BASE_PATH . $f); |
|
| 3616 | + if (file_exists(MODX_BASE_PATH.$f) && is_file(MODX_BASE_PATH.$f) && is_readable(MODX_BASE_PATH.$f)) { |
|
| 3617 | + $this->mail->AddAttachment(MODX_BASE_PATH.$f); |
|
| 3618 | 3618 | } |
| 3619 | 3619 | } |
| 3620 | 3620 | $rs = $this->mail->send(); |
@@ -3659,7 +3659,7 @@ discard block |
||
| 3659 | 3659 | */ |
| 3660 | 3660 | public function isFrontend() |
| 3661 | 3661 | { |
| 3662 | - return ! $this->isBackend(); |
|
| 3662 | + return !$this->isBackend(); |
|
| 3663 | 3663 | } |
| 3664 | 3664 | |
| 3665 | 3665 | /** |
@@ -3684,14 +3684,14 @@ discard block |
||
| 3684 | 3684 | $tblsc = $this->getFullTableName("site_content"); |
| 3685 | 3685 | $tbldg = $this->getFullTableName("document_groups"); |
| 3686 | 3686 | // modify field names to use sc. table reference |
| 3687 | - $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3688 | - $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3687 | + $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3688 | + $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3689 | 3689 | // get document groups for current user |
| 3690 | 3690 | if ($docgrp = $this->getUserDocGroups()) { |
| 3691 | 3691 | $docgrp = implode(",", $docgrp); |
| 3692 | 3692 | } |
| 3693 | 3693 | // build query |
| 3694 | - $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 3694 | + $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 3695 | 3695 | $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc |
| 3696 | 3696 | LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}"); |
| 3697 | 3697 | $resourceArray = $this->db->makeArray($result); |
@@ -3721,14 +3721,14 @@ discard block |
||
| 3721 | 3721 | $tbldg = $this->getFullTableName("document_groups"); |
| 3722 | 3722 | |
| 3723 | 3723 | // modify field names to use sc. table reference |
| 3724 | - $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3725 | - $sort = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3724 | + $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3725 | + $sort = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3726 | 3726 | // get document groups for current user |
| 3727 | 3727 | if ($docgrp = $this->getUserDocGroups()) { |
| 3728 | 3728 | $docgrp = implode(",", $docgrp); |
| 3729 | 3729 | } |
| 3730 | 3730 | // build query |
| 3731 | - $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 3731 | + $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 3732 | 3732 | $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc |
| 3733 | 3733 | LEFT JOIN {$tbldg} dg on dg.document = sc.id", "sc.parent = '{$id}' AND sc.published=1 AND sc.deleted=0 AND ({$access}) GROUP BY sc.id", "{$sort} {$dir}"); |
| 3734 | 3734 | $resourceArray = $this->db->makeArray($result); |
@@ -3763,16 +3763,16 @@ discard block |
||
| 3763 | 3763 | return $this->tmpCache[__FUNCTION__][$cacheKey]; |
| 3764 | 3764 | } |
| 3765 | 3765 | |
| 3766 | - $published = ($published !== 'all') ? 'AND sc.published = ' . $published : ''; |
|
| 3767 | - $deleted = ($deleted !== 'all') ? 'AND sc.deleted = ' . $deleted : ''; |
|
| 3766 | + $published = ($published !== 'all') ? 'AND sc.published = '.$published : ''; |
|
| 3767 | + $deleted = ($deleted !== 'all') ? 'AND sc.deleted = '.$deleted : ''; |
|
| 3768 | 3768 | |
| 3769 | 3769 | if ($where != '') { |
| 3770 | - $where = 'AND ' . $where; |
|
| 3770 | + $where = 'AND '.$where; |
|
| 3771 | 3771 | } |
| 3772 | 3772 | |
| 3773 | 3773 | // modify field names to use sc. table reference |
| 3774 | - $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3775 | - $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3774 | + $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3775 | + $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3776 | 3776 | |
| 3777 | 3777 | // get document groups for current user |
| 3778 | 3778 | if ($docgrp = $this->getUserDocGroups()) { |
@@ -3780,7 +3780,7 @@ discard block |
||
| 3780 | 3780 | } |
| 3781 | 3781 | |
| 3782 | 3782 | // build query |
| 3783 | - $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')'); |
|
| 3783 | + $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')'); |
|
| 3784 | 3784 | |
| 3785 | 3785 | $tblsc = $this->getFullTableName('site_content'); |
| 3786 | 3786 | $tbldg = $this->getFullTableName('document_groups'); |
@@ -3832,10 +3832,10 @@ discard block |
||
| 3832 | 3832 | return false; |
| 3833 | 3833 | } else { |
| 3834 | 3834 | // modify field names to use sc. table reference |
| 3835 | - $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3836 | - $sort = ($sort == '') ? '' : 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3835 | + $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3836 | + $sort = ($sort == '') ? '' : 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 3837 | 3837 | if ($where != '') { |
| 3838 | - $where = 'AND ' . $where; |
|
| 3838 | + $where = 'AND '.$where; |
|
| 3839 | 3839 | } |
| 3840 | 3840 | |
| 3841 | 3841 | $published = ($published !== 'all') ? "AND sc.published = '{$published}'" : ''; |
@@ -3846,13 +3846,13 @@ discard block |
||
| 3846 | 3846 | $docgrp = implode(',', $docgrp); |
| 3847 | 3847 | } |
| 3848 | 3848 | |
| 3849 | - $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="' . $_SESSION['mgrRole'] . '" OR sc.privatemgr=0') . (!$docgrp ? '' : ' OR dg.document_group IN (' . $docgrp . ')'); |
|
| 3849 | + $access = ($this->isFrontend() ? 'sc.privateweb=0' : '1="'.$_SESSION['mgrRole'].'" OR sc.privatemgr=0').(!$docgrp ? '' : ' OR dg.document_group IN ('.$docgrp.')'); |
|
| 3850 | 3850 | |
| 3851 | 3851 | $tblsc = $this->getFullTableName('site_content'); |
| 3852 | 3852 | $tbldg = $this->getFullTableName('document_groups'); |
| 3853 | 3853 | |
| 3854 | 3854 | $result = $this->db->select("DISTINCT {$fields}", "{$tblsc} sc |
| 3855 | - LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (" . implode(',', $ids) . ") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit); |
|
| 3855 | + LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id IN (".implode(',', $ids).") {$published} {$deleted} {$where}) AND ({$access}) GROUP BY sc.id", ($sort ? "{$sort} {$dir}" : ""), $limit); |
|
| 3856 | 3856 | |
| 3857 | 3857 | $resourceArray = $this->db->makeArray($result); |
| 3858 | 3858 | |
@@ -3957,12 +3957,12 @@ discard block |
||
| 3957 | 3957 | $tbldg = $this->getFullTableName("document_groups"); |
| 3958 | 3958 | $activeSql = $active == 1 ? "AND sc.published=1 AND sc.deleted=0" : ""; |
| 3959 | 3959 | // modify field names to use sc. table reference |
| 3960 | - $fields = 'sc.' . implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3960 | + $fields = 'sc.'.implode(',sc.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 3961 | 3961 | // get document groups for current user |
| 3962 | 3962 | if ($docgrp = $this->getUserDocGroups()) { |
| 3963 | 3963 | $docgrp = implode(",", $docgrp); |
| 3964 | 3964 | } |
| 3965 | - $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0") . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 3965 | + $access = ($this->isFrontend() ? "sc.privateweb=0" : "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0").(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
| 3966 | 3966 | $result = $this->db->select($fields, "{$tblsc} sc LEFT JOIN {$tbldg} dg on dg.document = sc.id", "(sc.id='{$pageid}' {$activeSql}) AND ({$access})", "", 1); |
| 3967 | 3967 | $pageInfo = $this->db->getRow($result); |
| 3968 | 3968 | |
@@ -4009,7 +4009,7 @@ discard block |
||
| 4009 | 4009 | { |
| 4010 | 4010 | if ($this->currentSnippet) { |
| 4011 | 4011 | $tbl = $this->getFullTableName("site_snippets"); |
| 4012 | - $rs = $this->db->select('id', $tbl, "name='" . $this->db->escape($this->currentSnippet) . "'", '', 1); |
|
| 4012 | + $rs = $this->db->select('id', $tbl, "name='".$this->db->escape($this->currentSnippet)."'", '', 1); |
|
| 4013 | 4013 | if ($snippetId = $this->db->getValue($rs)) { |
| 4014 | 4014 | return $snippetId; |
| 4015 | 4015 | } |
@@ -4036,23 +4036,23 @@ discard block |
||
| 4036 | 4036 | */ |
| 4037 | 4037 | public function clearCache($type = '', $report = false) |
| 4038 | 4038 | { |
| 4039 | - $cache_dir = MODX_BASE_PATH . $this->getCacheFolder(); |
|
| 4039 | + $cache_dir = MODX_BASE_PATH.$this->getCacheFolder(); |
|
| 4040 | 4040 | if (is_array($type)) { |
| 4041 | 4041 | foreach ($type as $_) { |
| 4042 | 4042 | $this->clearCache($_, $report); |
| 4043 | 4043 | } |
| 4044 | 4044 | } elseif ($type == 'full') { |
| 4045 | - include_once(MODX_MANAGER_PATH . 'processors/cache_sync.class.processor.php'); |
|
| 4045 | + include_once(MODX_MANAGER_PATH.'processors/cache_sync.class.processor.php'); |
|
| 4046 | 4046 | $sync = new synccache(); |
| 4047 | 4047 | $sync->setCachepath($cache_dir); |
| 4048 | 4048 | $sync->setReport($report); |
| 4049 | 4049 | $sync->emptyCache(); |
| 4050 | 4050 | } elseif (preg_match('@^[1-9][0-9]*$@', $type)) { |
| 4051 | 4051 | $key = ($this->config['cache_type'] == 2) ? $this->makePageCacheKey($type) : $type; |
| 4052 | - $file_name = "docid_" . $key . "_*.pageCache.php"; |
|
| 4053 | - $cache_path = $cache_dir . $file_name; |
|
| 4052 | + $file_name = "docid_".$key."_*.pageCache.php"; |
|
| 4053 | + $cache_path = $cache_dir.$file_name; |
|
| 4054 | 4054 | $files = glob($cache_path); |
| 4055 | - $files[] = $cache_dir . "docid_" . $key . ".pageCache.php"; |
|
| 4055 | + $files[] = $cache_dir."docid_".$key.".pageCache.php"; |
|
| 4056 | 4056 | foreach ($files as $file) { |
| 4057 | 4057 | if (!is_file($file)) { |
| 4058 | 4058 | continue; |
@@ -4060,7 +4060,7 @@ discard block |
||
| 4060 | 4060 | unlink($file); |
| 4061 | 4061 | } |
| 4062 | 4062 | } else { |
| 4063 | - $files = glob($cache_dir . '*'); |
|
| 4063 | + $files = glob($cache_dir.'*'); |
|
| 4064 | 4064 | foreach ($files as $file) { |
| 4065 | 4065 | $name = basename($file); |
| 4066 | 4066 | if (strpos($name, '.pageCache.php') === false) { |
@@ -4129,7 +4129,7 @@ discard block |
||
| 4129 | 4129 | $f_url_suffix = '/'; |
| 4130 | 4130 | } |
| 4131 | 4131 | |
| 4132 | - $alPath = !empty ($al['path']) ? $al['path'] . '/' : ''; |
|
| 4132 | + $alPath = !empty ($al['path']) ? $al['path'].'/' : ''; |
|
| 4133 | 4133 | |
| 4134 | 4134 | if ($al && $al['alias']) { |
| 4135 | 4135 | $alias = $al['alias']; |
@@ -4137,7 +4137,7 @@ discard block |
||
| 4137 | 4137 | |
| 4138 | 4138 | } |
| 4139 | 4139 | |
| 4140 | - $alias = $alPath . $f_url_prefix . $alias . $f_url_suffix; |
|
| 4140 | + $alias = $alPath.$f_url_prefix.$alias.$f_url_suffix; |
|
| 4141 | 4141 | $url = "{$alias}{$args}"; |
| 4142 | 4142 | } else { |
| 4143 | 4143 | $url = "index.php?id={$id}{$args}"; |
@@ -4156,7 +4156,7 @@ discard block |
||
| 4156 | 4156 | } |
| 4157 | 4157 | |
| 4158 | 4158 | //TODO: check to make sure that $site_url incudes the url :port (e.g. :8080) |
| 4159 | - $host = $scheme == 'full' ? $this->config['site_url'] : $scheme . '://' . $_SERVER['HTTP_HOST'] . $host; |
|
| 4159 | + $host = $scheme == 'full' ? $this->config['site_url'] : $scheme.'://'.$_SERVER['HTTP_HOST'].$host; |
|
| 4160 | 4160 | } |
| 4161 | 4161 | |
| 4162 | 4162 | //fix strictUrl by Bumkaka |
@@ -4165,9 +4165,9 @@ discard block |
||
| 4165 | 4165 | } |
| 4166 | 4166 | |
| 4167 | 4167 | if ($this->config['xhtml_urls']) { |
| 4168 | - $url = preg_replace("/&(?!amp;)/", "&", $host . $virtualDir . $url); |
|
| 4168 | + $url = preg_replace("/&(?!amp;)/", "&", $host.$virtualDir.$url); |
|
| 4169 | 4169 | } else { |
| 4170 | - $url = $host . $virtualDir . $url; |
|
| 4170 | + $url = $host.$virtualDir.$url; |
|
| 4171 | 4171 | } |
| 4172 | 4172 | |
| 4173 | 4173 | $evtOut = $this->invokeEvent('OnMakeDocUrl', array( |
@@ -4191,21 +4191,21 @@ discard block |
||
| 4191 | 4191 | if (isset($this->aliasListing[$id])) { |
| 4192 | 4192 | $out = $this->aliasListing[$id]; |
| 4193 | 4193 | } else { |
| 4194 | - $q = $this->db->query("SELECT id,alias,isfolder,parent FROM " . $this->getFullTableName("site_content") . " WHERE id=" . (int)$id); |
|
| 4194 | + $q = $this->db->query("SELECT id,alias,isfolder,parent FROM ".$this->getFullTableName("site_content")." WHERE id=".(int) $id); |
|
| 4195 | 4195 | if ($this->db->getRecordCount($q) == '1') { |
| 4196 | 4196 | $q = $this->db->getRow($q); |
| 4197 | 4197 | $this->aliasListing[$id] = array( |
| 4198 | - 'id' => (int)$q['id'], |
|
| 4198 | + 'id' => (int) $q['id'], |
|
| 4199 | 4199 | 'alias' => $q['alias'] == '' ? $q['id'] : $q['alias'], |
| 4200 | - 'parent' => (int)$q['parent'], |
|
| 4201 | - 'isfolder' => (int)$q['isfolder'], |
|
| 4200 | + 'parent' => (int) $q['parent'], |
|
| 4201 | + 'isfolder' => (int) $q['isfolder'], |
|
| 4202 | 4202 | ); |
| 4203 | 4203 | if ($this->aliasListing[$id]['parent'] > 0) { |
| 4204 | 4204 | //fix alias_path_usage |
| 4205 | 4205 | if ($this->config['use_alias_path'] == '1') { |
| 4206 | 4206 | //&& $tmp['path'] != '' - fix error slash with epty path |
| 4207 | 4207 | $tmp = $this->getAliasListing($this->aliasListing[$id]['parent']); |
| 4208 | - $this->aliasListing[$id]['path'] = $tmp['path'] . ($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '') . $tmp['alias'] : ''); |
|
| 4208 | + $this->aliasListing[$id]['path'] = $tmp['path'].($tmp['alias_visible'] ? (($tmp['parent'] > 0 && $tmp['path'] != '') ? '/' : '').$tmp['alias'] : ''); |
|
| 4209 | 4209 | } else { |
| 4210 | 4210 | $this->aliasListing[$id]['path'] = ''; |
| 4211 | 4211 | } |
@@ -4246,7 +4246,7 @@ discard block |
||
| 4246 | 4246 | $out = array(); |
| 4247 | 4247 | if (empty($this->version) || !is_array($this->version)) { |
| 4248 | 4248 | //include for compatibility modx version < 1.0.10 |
| 4249 | - include MODX_MANAGER_PATH . "includes/version.inc.php"; |
|
| 4249 | + include MODX_MANAGER_PATH."includes/version.inc.php"; |
|
| 4250 | 4250 | $this->version = array(); |
| 4251 | 4251 | $this->version['version'] = isset($modx_version) ? $modx_version : ''; |
| 4252 | 4252 | $this->version['branch'] = isset($modx_branch) ? $modx_branch : ''; |
@@ -4268,18 +4268,18 @@ discard block |
||
| 4268 | 4268 | { |
| 4269 | 4269 | if (isset ($this->snippetCache[$snippetName])) { |
| 4270 | 4270 | $snippet = $this->snippetCache[$snippetName]; |
| 4271 | - $properties = !empty($this->snippetCache[$snippetName . "Props"]) ? $this->snippetCache[$snippetName . "Props"] : ''; |
|
| 4271 | + $properties = !empty($this->snippetCache[$snippetName."Props"]) ? $this->snippetCache[$snippetName."Props"] : ''; |
|
| 4272 | 4272 | } else { // not in cache so let's check the db |
| 4273 | - $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM " . $this->getFullTableName("site_snippets") . " as ss LEFT JOIN " . $this->getFullTableName('site_modules') . " as sm on sm.guid=ss.moduleguid WHERE ss.`name`='" . $this->db->escape($snippetName) . "' AND ss.disabled=0;"; |
|
| 4273 | + $sql = "SELECT ss.`name`, ss.`snippet`, ss.`properties`, sm.properties as `sharedproperties` FROM ".$this->getFullTableName("site_snippets")." as ss LEFT JOIN ".$this->getFullTableName('site_modules')." as sm on sm.guid=ss.moduleguid WHERE ss.`name`='".$this->db->escape($snippetName)."' AND ss.disabled=0;"; |
|
| 4274 | 4274 | $result = $this->db->query($sql); |
| 4275 | 4275 | if ($this->db->getRecordCount($result) == 1) { |
| 4276 | 4276 | $row = $this->db->getRow($result); |
| 4277 | 4277 | $snippet = $this->snippetCache[$snippetName] = $row['snippet']; |
| 4278 | 4278 | $mergedProperties = array_merge($this->parseProperties($row['properties']), $this->parseProperties($row['sharedproperties'])); |
| 4279 | - $properties = $this->snippetCache[$snippetName . "Props"] = json_encode($mergedProperties); |
|
| 4279 | + $properties = $this->snippetCache[$snippetName."Props"] = json_encode($mergedProperties); |
|
| 4280 | 4280 | } else { |
| 4281 | 4281 | $snippet = $this->snippetCache[$snippetName] = "return false;"; |
| 4282 | - $properties = $this->snippetCache[$snippetName . "Props"] = ''; |
|
| 4282 | + $properties = $this->snippetCache[$snippetName."Props"] = ''; |
|
| 4283 | 4283 | } |
| 4284 | 4284 | } |
| 4285 | 4285 | // load default params/properties |
@@ -4379,8 +4379,8 @@ discard block |
||
| 4379 | 4379 | } |
| 4380 | 4380 | if (strpos($tpl, $s) !== false) { |
| 4381 | 4381 | $tpl = str_replace($s, $value, $tpl); |
| 4382 | - } elseif($this->debug) { |
|
| 4383 | - $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'] . $s, 2); |
|
| 4382 | + } elseif ($this->debug) { |
|
| 4383 | + $this->addLog('parseText parse error', $_SERVER['REQUEST_URI'].$s, 2); |
|
| 4384 | 4384 | } |
| 4385 | 4385 | } |
| 4386 | 4386 | |
@@ -4429,7 +4429,7 @@ discard block |
||
| 4429 | 4429 | case 'CODE': |
| 4430 | 4430 | break; |
| 4431 | 4431 | case 'FILE': |
| 4432 | - $template = file_get_contents(MODX_BASE_PATH . $template); |
|
| 4432 | + $template = file_get_contents(MODX_BASE_PATH.$template); |
|
| 4433 | 4433 | break; |
| 4434 | 4434 | case 'CHUNK': |
| 4435 | 4435 | $template = $this->getChunk($template); |
@@ -4462,7 +4462,7 @@ discard block |
||
| 4462 | 4462 | if ($mode !== 'formatOnly' && empty($timestamp)) { |
| 4463 | 4463 | return '-'; |
| 4464 | 4464 | } |
| 4465 | - $timestamp = (int)$timestamp; |
|
| 4465 | + $timestamp = (int) $timestamp; |
|
| 4466 | 4466 | |
| 4467 | 4467 | switch ($this->config['datetime_format']) { |
| 4468 | 4468 | case 'YYYY/mm/dd': |
@@ -4482,7 +4482,7 @@ discard block |
||
| 4482 | 4482 | } |
| 4483 | 4483 | |
| 4484 | 4484 | if (empty($mode)) { |
| 4485 | - $strTime = strftime($dateFormat . " %H:%M:%S", $timestamp); |
|
| 4485 | + $strTime = strftime($dateFormat." %H:%M:%S", $timestamp); |
|
| 4486 | 4486 | } elseif ($mode == 'dateOnly') { |
| 4487 | 4487 | $strTime = strftime($dateFormat, $timestamp); |
| 4488 | 4488 | } elseif ($mode == 'formatOnly') { |
@@ -4536,7 +4536,7 @@ discard block |
||
| 4536 | 4536 | $S = 0; |
| 4537 | 4537 | } |
| 4538 | 4538 | $timeStamp = mktime($H, $M, $S, $m, $d, $Y); |
| 4539 | - $timeStamp = (int)$timeStamp; |
|
| 4539 | + $timeStamp = (int) $timeStamp; |
|
| 4540 | 4540 | return $timeStamp; |
| 4541 | 4541 | } |
| 4542 | 4542 | |
@@ -4578,7 +4578,7 @@ discard block |
||
| 4578 | 4578 | if ($v === 'value') { |
| 4579 | 4579 | unset($_[$i]); |
| 4580 | 4580 | } else { |
| 4581 | - $_[$i] = 'tv.' . $v; |
|
| 4581 | + $_[$i] = 'tv.'.$v; |
|
| 4582 | 4582 | } |
| 4583 | 4583 | } |
| 4584 | 4584 | $fields = implode(',', $_); |
@@ -4587,12 +4587,12 @@ discard block |
||
| 4587 | 4587 | } |
| 4588 | 4588 | |
| 4589 | 4589 | if ($tvsort != '') { |
| 4590 | - $tvsort = 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort)))); |
|
| 4590 | + $tvsort = 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $tvsort)))); |
|
| 4591 | 4591 | } |
| 4592 | 4592 | if ($tvidnames == "*") { |
| 4593 | 4593 | $query = "tv.id<>0"; |
| 4594 | 4594 | } else { |
| 4595 | - $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name") . " IN ('" . implode("','", $tvidnames) . "')"; |
|
| 4595 | + $query = (is_numeric($tvidnames[0]) ? "tv.id" : "tv.name")." IN ('".implode("','", $tvidnames)."')"; |
|
| 4596 | 4596 | } |
| 4597 | 4597 | |
| 4598 | 4598 | $this->getUserDocGroups(); |
@@ -4736,7 +4736,7 @@ discard block |
||
| 4736 | 4736 | return $this->tmpCache[__FUNCTION__][$cacheKey]; |
| 4737 | 4737 | } |
| 4738 | 4738 | |
| 4739 | - if (($idnames != '*' && !is_array($idnames)) || empty($idnames) ) { |
|
| 4739 | + if (($idnames != '*' && !is_array($idnames)) || empty($idnames)) { |
|
| 4740 | 4740 | return false; |
| 4741 | 4741 | } else { |
| 4742 | 4742 | |
@@ -4754,23 +4754,23 @@ discard block |
||
| 4754 | 4754 | } |
| 4755 | 4755 | |
| 4756 | 4756 | // get user defined template variables |
| 4757 | - $fields = ($fields == '') ? 'tv.*' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 4758 | - $sort = ($sort == '') ? '' : 'tv.' . implode(',tv.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 4757 | + $fields = ($fields == '') ? 'tv.*' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $fields)))); |
|
| 4758 | + $sort = ($sort == '') ? '' : 'tv.'.implode(',tv.', array_filter(array_map('trim', explode(',', $sort)))); |
|
| 4759 | 4759 | |
| 4760 | 4760 | if ($idnames == '*') { |
| 4761 | 4761 | $query = 'tv.id<>0'; |
| 4762 | 4762 | } else { |
| 4763 | - $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name') . " IN ('" . implode("','", $idnames) . "')"; |
|
| 4763 | + $query = (is_numeric($idnames[0]) ? 'tv.id' : 'tv.name')." IN ('".implode("','", $idnames)."')"; |
|
| 4764 | 4764 | } |
| 4765 | 4765 | |
| 4766 | - $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars') . " tv |
|
| 4767 | - INNER JOIN " . $this->getFullTableName('site_tmplvar_templates') . " tvtpl ON tvtpl.tmplvarid = tv.id |
|
| 4768 | - LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues') . " tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : "")); |
|
| 4766 | + $rs = $this->db->select("{$fields}, IF(tvc.value != '', tvc.value, tv.default_text) as value", $this->getFullTableName('site_tmplvars')." tv |
|
| 4767 | + INNER JOIN " . $this->getFullTableName('site_tmplvar_templates')." tvtpl ON tvtpl.tmplvarid = tv.id |
|
| 4768 | + LEFT JOIN " . $this->getFullTableName('site_tmplvar_contentvalues')." tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$docid}'", "{$query} AND tvtpl.templateid = '{$docRow['template']}'", ($sort ? "{$sort} {$dir}" : "")); |
|
| 4769 | 4769 | |
| 4770 | 4770 | $result = $this->db->makeArray($rs); |
| 4771 | 4771 | |
| 4772 | 4772 | // get default/built-in template variables |
| 4773 | - if(is_array($docRow)){ |
|
| 4773 | + if (is_array($docRow)) { |
|
| 4774 | 4774 | ksort($docRow); |
| 4775 | 4775 | |
| 4776 | 4776 | foreach ($docRow as $key => $value) { |
@@ -4808,22 +4808,22 @@ discard block |
||
| 4808 | 4808 | */ |
| 4809 | 4809 | public function getTemplateVarOutput($idnames = array(), $docid = '', $published = 1, $sep = '') |
| 4810 | 4810 | { |
| 4811 | - if (is_array($idnames) && empty($idnames) ) { |
|
| 4811 | + if (is_array($idnames) && empty($idnames)) { |
|
| 4812 | 4812 | return false; |
| 4813 | 4813 | } else { |
| 4814 | 4814 | $output = array(); |
| 4815 | 4815 | $vars = ($idnames == '*' || is_array($idnames)) ? $idnames : array($idnames); |
| 4816 | 4816 | |
| 4817 | - $docid = (int)$docid > 0 ? (int)$docid : $this->documentIdentifier; |
|
| 4817 | + $docid = (int) $docid > 0 ? (int) $docid : $this->documentIdentifier; |
|
| 4818 | 4818 | // remove sort for speed |
| 4819 | 4819 | $result = $this->getTemplateVars($vars, '*', $docid, $published, '', ''); |
| 4820 | 4820 | |
| 4821 | 4821 | if ($result == false) { |
| 4822 | 4822 | return false; |
| 4823 | 4823 | } else { |
| 4824 | - $baspath = MODX_MANAGER_PATH . 'includes'; |
|
| 4825 | - include_once $baspath . '/tmplvars.format.inc.php'; |
|
| 4826 | - include_once $baspath . '/tmplvars.commands.inc.php'; |
|
| 4824 | + $baspath = MODX_MANAGER_PATH.'includes'; |
|
| 4825 | + include_once $baspath.'/tmplvars.format.inc.php'; |
|
| 4826 | + include_once $baspath.'/tmplvars.commands.inc.php'; |
|
| 4827 | 4827 | |
| 4828 | 4828 | for ($i = 0; $i < count($result); $i++) { |
| 4829 | 4829 | $row = $result[$i]; |
@@ -4848,7 +4848,7 @@ discard block |
||
| 4848 | 4848 | */ |
| 4849 | 4849 | public function getFullTableName($tbl) |
| 4850 | 4850 | { |
| 4851 | - return $this->db->config['dbase'] . ".`" . $this->db->config['table_prefix'] . $tbl . "`"; |
|
| 4851 | + return $this->db->config['dbase'].".`".$this->db->config['table_prefix'].$tbl."`"; |
|
| 4852 | 4852 | } |
| 4853 | 4853 | |
| 4854 | 4854 | /** |
@@ -4927,7 +4927,7 @@ discard block |
||
| 4927 | 4927 | public function getCachePath() |
| 4928 | 4928 | { |
| 4929 | 4929 | global $base_url; |
| 4930 | - $pth = $base_url . $this->getCacheFolder(); |
|
| 4930 | + $pth = $base_url.$this->getCacheFolder(); |
|
| 4931 | 4931 | return $pth; |
| 4932 | 4932 | } |
| 4933 | 4933 | |
@@ -4979,8 +4979,8 @@ discard block |
||
| 4979 | 4979 | $out = false; |
| 4980 | 4980 | |
| 4981 | 4981 | if (!empty($context)) { |
| 4982 | - if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) { |
|
| 4983 | - $out = $_SESSION[$context . 'InternalKey']; |
|
| 4982 | + if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) { |
|
| 4983 | + $out = $_SESSION[$context.'InternalKey']; |
|
| 4984 | 4984 | } |
| 4985 | 4985 | } else { |
| 4986 | 4986 | switch (true) { |
@@ -5008,8 +5008,8 @@ discard block |
||
| 5008 | 5008 | $out = false; |
| 5009 | 5009 | |
| 5010 | 5010 | if (!empty($context)) { |
| 5011 | - if (is_scalar($context) && isset($_SESSION[$context . 'Validated'])) { |
|
| 5012 | - $out = $_SESSION[$context . 'Shortname']; |
|
| 5011 | + if (is_scalar($context) && isset($_SESSION[$context.'Validated'])) { |
|
| 5012 | + $out = $_SESSION[$context.'Shortname']; |
|
| 5013 | 5013 | } |
| 5014 | 5014 | } else { |
| 5015 | 5015 | switch (true) { |
@@ -5080,8 +5080,8 @@ discard block |
||
| 5080 | 5080 | */ |
| 5081 | 5081 | public function getWebUserInfo($uid) |
| 5082 | 5082 | { |
| 5083 | - $rs = $this->db->select('wu.username, wu.password, wua.*', $this->getFullTableName("web_users") . " wu |
|
| 5084 | - INNER JOIN " . $this->getFullTableName("web_user_attributes") . " wua ON wua.internalkey=wu.id", "wu.id='{$uid}'"); |
|
| 5083 | + $rs = $this->db->select('wu.username, wu.password, wua.*', $this->getFullTableName("web_users")." wu |
|
| 5084 | + INNER JOIN " . $this->getFullTableName("web_user_attributes")." wua ON wua.internalkey=wu.id", "wu.id='{$uid}'"); |
|
| 5085 | 5085 | if ($row = $this->db->getRow($rs)) { |
| 5086 | 5086 | if (!isset($row['usertype']) or !$row["usertype"]) { |
| 5087 | 5087 | $row["usertype"] = "web"; |
@@ -5117,7 +5117,7 @@ discard block |
||
| 5117 | 5117 | } else if (is_array($dg)) { |
| 5118 | 5118 | // resolve ids to names |
| 5119 | 5119 | $dgn = array(); |
| 5120 | - $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (" . implode(",", $dg) . ")"); |
|
| 5120 | + $ds = $this->db->select('name', $this->getFullTableName("documentgroup_names"), "id IN (".implode(",", $dg).")"); |
|
| 5121 | 5121 | while ($row = $this->db->getRow($ds)) { |
| 5122 | 5122 | $dgn[] = $row['name']; |
| 5123 | 5123 | } |
@@ -5145,7 +5145,7 @@ discard block |
||
| 5145 | 5145 | $rt = false; |
| 5146 | 5146 | if ($_SESSION["webValidated"] == 1) { |
| 5147 | 5147 | $tbl = $this->getFullTableName("web_users"); |
| 5148 | - $ds = $this->db->select('id, username, password', $tbl, "id='" . $this->getLoginUserID() . "'"); |
|
| 5148 | + $ds = $this->db->select('id, username, password', $tbl, "id='".$this->getLoginUserID()."'"); |
|
| 5149 | 5149 | if ($row = $this->db->getRow($ds)) { |
| 5150 | 5150 | if ($row["password"] == md5($oldPwd)) { |
| 5151 | 5151 | if (strlen($newPwd) < 6) { |
@@ -5155,7 +5155,7 @@ discard block |
||
| 5155 | 5155 | } else { |
| 5156 | 5156 | $this->db->update(array( |
| 5157 | 5157 | 'password' => $this->db->escape($newPwd), |
| 5158 | - ), $tbl, "id='" . $this->getLoginUserID() . "'"); |
|
| 5158 | + ), $tbl, "id='".$this->getLoginUserID()."'"); |
|
| 5159 | 5159 | // invoke OnWebChangePassword event |
| 5160 | 5160 | $this->invokeEvent("OnWebChangePassword", array( |
| 5161 | 5161 | "userid" => $row["id"], |
@@ -5186,8 +5186,8 @@ discard block |
||
| 5186 | 5186 | // check cache |
| 5187 | 5187 | $grpNames = isset ($_SESSION['webUserGroupNames']) ? $_SESSION['webUserGroupNames'] : false; |
| 5188 | 5188 | if (!is_array($grpNames)) { |
| 5189 | - $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names") . " wgn |
|
| 5190 | - INNER JOIN " . $this->getFullTableName("web_groups") . " wg ON wg.webgroup=wgn.id AND wg.webuser='" . $this->getLoginUserID() . "'"); |
|
| 5189 | + $rs = $this->db->select('wgn.name', $this->getFullTableName("webgroup_names")." wgn |
|
| 5190 | + INNER JOIN " . $this->getFullTableName("web_groups")." wg ON wg.webgroup=wgn.id AND wg.webuser='".$this->getLoginUserID()."'"); |
|
| 5191 | 5191 | $grpNames = $this->db->getColumn("name", $rs); |
| 5192 | 5192 | // save to cache |
| 5193 | 5193 | $_SESSION['webUserGroupNames'] = $grpNames; |
@@ -5220,7 +5220,7 @@ discard block |
||
| 5220 | 5220 | if (strpos(strtolower($src), "<style") !== false || strpos(strtolower($src), "<link") !== false) { |
| 5221 | 5221 | $this->sjscripts[$nextpos] = $src; |
| 5222 | 5222 | } else { |
| 5223 | - $this->sjscripts[$nextpos] = "\t" . '<link rel="stylesheet" type="text/css" href="' . $src . '" ' . ($media ? 'media="' . $media . '" ' : '') . '/>'; |
|
| 5223 | + $this->sjscripts[$nextpos] = "\t".'<link rel="stylesheet" type="text/css" href="'.$src.'" '.($media ? 'media="'.$media.'" ' : '').'/>'; |
|
| 5224 | 5224 | } |
| 5225 | 5225 | } |
| 5226 | 5226 | |
@@ -5299,7 +5299,7 @@ discard block |
||
| 5299 | 5299 | } |
| 5300 | 5300 | |
| 5301 | 5301 | if ($useThisVer && $plaintext != true && (strpos(strtolower($src), "<script") === false)) { |
| 5302 | - $src = "\t" . '<script type="text/javascript" src="' . $src . '"></script>'; |
|
| 5302 | + $src = "\t".'<script type="text/javascript" src="'.$src.'"></script>'; |
|
| 5303 | 5303 | } |
| 5304 | 5304 | if ($startup) { |
| 5305 | 5305 | $pos = isset($overwritepos) ? $overwritepos : max(array_merge(array(0), array_keys($this->sjscripts))) + 1; |
@@ -5446,7 +5446,7 @@ discard block |
||
| 5446 | 5446 | $eventtime = $this->getMicroTime() - $eventtime; |
| 5447 | 5447 | $this->pluginsCode .= sprintf('<fieldset><legend><b>%s / %s</b> (%2.2f ms)</legend>', $evtName, $pluginName, $eventtime * 1000); |
| 5448 | 5448 | foreach ($parameter as $k => $v) { |
| 5449 | - $this->pluginsCode .= "{$k} => " . print_r($v, true) . '<br>'; |
|
| 5449 | + $this->pluginsCode .= "{$k} => ".print_r($v, true).'<br>'; |
|
| 5450 | 5450 | } |
| 5451 | 5451 | $this->pluginsCode .= '</fieldset><br />'; |
| 5452 | 5452 | $this->pluginsTime["{$evtName} / {$pluginName}"] += $eventtime; |
@@ -5474,13 +5474,13 @@ discard block |
||
| 5474 | 5474 | $plugin = array(); |
| 5475 | 5475 | if (isset ($this->pluginCache[$pluginName])) { |
| 5476 | 5476 | $pluginCode = $this->pluginCache[$pluginName]; |
| 5477 | - $pluginProperties = isset($this->pluginCache[$pluginName . "Props"]) ? $this->pluginCache[$pluginName . "Props"] : ''; |
|
| 5477 | + $pluginProperties = isset($this->pluginCache[$pluginName."Props"]) ? $this->pluginCache[$pluginName."Props"] : ''; |
|
| 5478 | 5478 | } else { |
| 5479 | 5479 | $pluginName = $this->db->escape($pluginName); |
| 5480 | 5480 | $result = $this->db->select('name, plugincode, properties', $this->getFullTableName("site_plugins"), "name='{$pluginName}' AND disabled=0"); |
| 5481 | 5481 | if ($row = $this->db->getRow($result)) { |
| 5482 | 5482 | $pluginCode = $this->pluginCache[$row['name']] = $row['plugincode']; |
| 5483 | - $pluginProperties = $this->pluginCache[$row['name'] . "Props"] = $row['properties']; |
|
| 5483 | + $pluginProperties = $this->pluginCache[$row['name']."Props"] = $row['properties']; |
|
| 5484 | 5484 | } else { |
| 5485 | 5485 | $pluginCode = $this->pluginCache[$pluginName] = "return false;"; |
| 5486 | 5486 | $pluginProperties = ''; |
@@ -5583,7 +5583,7 @@ discard block |
||
| 5583 | 5583 | public function parseDocBlockFromFile($element_dir, $filename, $escapeValues = false) |
| 5584 | 5584 | { |
| 5585 | 5585 | $params = array(); |
| 5586 | - $fullpath = $element_dir . '/' . $filename; |
|
| 5586 | + $fullpath = $element_dir.'/'.$filename; |
|
| 5587 | 5587 | if (is_readable($fullpath)) { |
| 5588 | 5588 | $tpl = @fopen($fullpath, "r"); |
| 5589 | 5589 | if ($tpl) { |
@@ -5750,8 +5750,8 @@ discard block |
||
| 5750 | 5750 | $ph = array('site_url' => MODX_SITE_URL); |
| 5751 | 5751 | $regexUrl = "/((http|https|ftp|ftps)\:\/\/[^\/]+(\/[^\s]+[^,.?!:;\s])?)/"; |
| 5752 | 5752 | $regexEmail = '#([0-9a-z]([-_.]?[0-9a-z])*@[0-9a-z]([-.]?[0-9a-z])*\\.[a-wyz][a-z](fo|g|l|m|mes|o|op|pa|ro|seum|t|u|v|z)?)#i'; |
| 5753 | - $emailSubject = isset($parsed['name']) ? '?subject=' . $parsed['name'] : ''; |
|
| 5754 | - $emailSubject .= isset($parsed['version']) ? ' v' . $parsed['version'] : ''; |
|
| 5753 | + $emailSubject = isset($parsed['name']) ? '?subject='.$parsed['name'] : ''; |
|
| 5754 | + $emailSubject .= isset($parsed['version']) ? ' v'.$parsed['version'] : ''; |
|
| 5755 | 5755 | foreach ($parsed as $key => $val) { |
| 5756 | 5756 | if (is_array($val)) { |
| 5757 | 5757 | foreach ($val as $key2 => $val2) { |
@@ -5760,7 +5760,7 @@ discard block |
||
| 5760 | 5760 | $val2 = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val2); |
| 5761 | 5761 | } |
| 5762 | 5762 | if (preg_match($regexEmail, $val2, $url)) { |
| 5763 | - $val2 = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val2); |
|
| 5763 | + $val2 = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val2); |
|
| 5764 | 5764 | } |
| 5765 | 5765 | $parsed[$key][$key2] = $val2; |
| 5766 | 5766 | } |
@@ -5770,7 +5770,7 @@ discard block |
||
| 5770 | 5770 | $val = preg_replace($regexUrl, "<a href=\"{$url[0]}\" target=\"_blank\">{$url[0]}</a> ", $val); |
| 5771 | 5771 | } |
| 5772 | 5772 | if (preg_match($regexEmail, $val, $url)) { |
| 5773 | - $val = preg_replace($regexEmail, '<a href="mailto:\\1' . $emailSubject . '">\\1</a>', $val); |
|
| 5773 | + $val = preg_replace($regexEmail, '<a href="mailto:\\1'.$emailSubject.'">\\1</a>', $val); |
|
| 5774 | 5774 | } |
| 5775 | 5775 | $parsed[$key] = $val; |
| 5776 | 5776 | } |
@@ -5784,32 +5784,32 @@ discard block |
||
| 5784 | 5784 | ); |
| 5785 | 5785 | |
| 5786 | 5786 | $nl = "\n"; |
| 5787 | - $list = isset($parsed['logo']) ? '<img src="' . $this->config['base_url'] . ltrim($parsed['logo'], "/") . '" style="float:right;max-width:100px;height:auto;" />' . $nl : ''; |
|
| 5788 | - $list .= '<p>' . $nl; |
|
| 5789 | - $list .= isset($parsed['name']) ? '<strong>' . $parsed['name'] . '</strong><br/>' . $nl : ''; |
|
| 5790 | - $list .= isset($parsed['description']) ? $parsed['description'] . $nl : ''; |
|
| 5791 | - $list .= '</p><br/>' . $nl; |
|
| 5792 | - $list .= isset($parsed['version']) ? '<p><strong>' . $_lang['version'] . ':</strong> ' . $parsed['version'] . '</p>' . $nl : ''; |
|
| 5793 | - $list .= isset($parsed['license']) ? '<p><strong>' . $_lang['license'] . ':</strong> ' . $parsed['license'] . '</p>' . $nl : ''; |
|
| 5794 | - $list .= isset($parsed['lastupdate']) ? '<p><strong>' . $_lang['last_update'] . ':</strong> ' . $parsed['lastupdate'] . '</p>' . $nl : ''; |
|
| 5795 | - $list .= '<br/>' . $nl; |
|
| 5787 | + $list = isset($parsed['logo']) ? '<img src="'.$this->config['base_url'].ltrim($parsed['logo'], "/").'" style="float:right;max-width:100px;height:auto;" />'.$nl : ''; |
|
| 5788 | + $list .= '<p>'.$nl; |
|
| 5789 | + $list .= isset($parsed['name']) ? '<strong>'.$parsed['name'].'</strong><br/>'.$nl : ''; |
|
| 5790 | + $list .= isset($parsed['description']) ? $parsed['description'].$nl : ''; |
|
| 5791 | + $list .= '</p><br/>'.$nl; |
|
| 5792 | + $list .= isset($parsed['version']) ? '<p><strong>'.$_lang['version'].':</strong> '.$parsed['version'].'</p>'.$nl : ''; |
|
| 5793 | + $list .= isset($parsed['license']) ? '<p><strong>'.$_lang['license'].':</strong> '.$parsed['license'].'</p>'.$nl : ''; |
|
| 5794 | + $list .= isset($parsed['lastupdate']) ? '<p><strong>'.$_lang['last_update'].':</strong> '.$parsed['lastupdate'].'</p>'.$nl : ''; |
|
| 5795 | + $list .= '<br/>'.$nl; |
|
| 5796 | 5796 | $first = true; |
| 5797 | 5797 | foreach ($arrayParams as $param => $label) { |
| 5798 | 5798 | if (isset($parsed[$param])) { |
| 5799 | 5799 | if ($first) { |
| 5800 | - $list .= '<p><strong>' . $_lang['references'] . '</strong></p>' . $nl; |
|
| 5801 | - $list .= '<ul class="docBlockList">' . $nl; |
|
| 5800 | + $list .= '<p><strong>'.$_lang['references'].'</strong></p>'.$nl; |
|
| 5801 | + $list .= '<ul class="docBlockList">'.$nl; |
|
| 5802 | 5802 | $first = false; |
| 5803 | 5803 | } |
| 5804 | - $list .= ' <li><strong>' . $label . '</strong>' . $nl; |
|
| 5805 | - $list .= ' <ul>' . $nl; |
|
| 5804 | + $list .= ' <li><strong>'.$label.'</strong>'.$nl; |
|
| 5805 | + $list .= ' <ul>'.$nl; |
|
| 5806 | 5806 | foreach ($parsed[$param] as $val) { |
| 5807 | - $list .= ' <li>' . $val . '</li>' . $nl; |
|
| 5807 | + $list .= ' <li>'.$val.'</li>'.$nl; |
|
| 5808 | 5808 | } |
| 5809 | - $list .= ' </ul></li>' . $nl; |
|
| 5809 | + $list .= ' </ul></li>'.$nl; |
|
| 5810 | 5810 | } |
| 5811 | 5811 | } |
| 5812 | - $list .= !$first ? '</ul>' . $nl : ''; |
|
| 5812 | + $list .= !$first ? '</ul>'.$nl : ''; |
|
| 5813 | 5813 | |
| 5814 | 5814 | return $list; |
| 5815 | 5815 | } |
@@ -5885,7 +5885,7 @@ discard block |
||
| 5885 | 5885 | */ |
| 5886 | 5886 | public function addSnippet($name, $phpCode) |
| 5887 | 5887 | { |
| 5888 | - $this->snippetCache['#' . $name] = $phpCode; |
|
| 5888 | + $this->snippetCache['#'.$name] = $phpCode; |
|
| 5889 | 5889 | } |
| 5890 | 5890 | |
| 5891 | 5891 | /** |
@@ -5894,7 +5894,7 @@ discard block |
||
| 5894 | 5894 | */ |
| 5895 | 5895 | public function addChunk($name, $text) |
| 5896 | 5896 | { |
| 5897 | - $this->chunkCache['#' . $name] = $text; |
|
| 5897 | + $this->chunkCache['#'.$name] = $text; |
|
| 5898 | 5898 | } |
| 5899 | 5899 | |
| 5900 | 5900 | /** |
@@ -5930,7 +5930,7 @@ discard block |
||
| 5930 | 5930 | } |
| 5931 | 5931 | |
| 5932 | 5932 | if (!$isSafe) { |
| 5933 | - $msg = $phpcode . "\n" . $this->currentSnippet . "\n" . print_r($_SERVER, true); |
|
| 5933 | + $msg = $phpcode."\n".$this->currentSnippet."\n".print_r($_SERVER, true); |
|
| 5934 | 5934 | $title = sprintf('Unknown eval was executed (%s)', $this->htmlspecialchars(substr(trim($phpcode), 0, 50))); |
| 5935 | 5935 | $this->messageQuit($title, '', true, '', '', 'Parser', $msg); |
| 5936 | 5936 | return; |
@@ -5944,7 +5944,7 @@ discard block |
||
| 5944 | 5944 | return 'array()'; |
| 5945 | 5945 | } |
| 5946 | 5946 | |
| 5947 | - $output = $echo . $return; |
|
| 5947 | + $output = $echo.$return; |
|
| 5948 | 5948 | modx_sanitize_gpc($output); |
| 5949 | 5949 | return $this->htmlspecialchars($output); // Maybe, all html tags are dangerous |
| 5950 | 5950 | } |
@@ -5962,8 +5962,8 @@ discard block |
||
| 5962 | 5962 | |
| 5963 | 5963 | $safe = explode(',', $safe_functions); |
| 5964 | 5964 | |
| 5965 | - $phpcode = rtrim($phpcode, ';') . ';'; |
|
| 5966 | - $tokens = token_get_all('<?php ' . $phpcode); |
|
| 5965 | + $phpcode = rtrim($phpcode, ';').';'; |
|
| 5966 | + $tokens = token_get_all('<?php '.$phpcode); |
|
| 5967 | 5967 | foreach ($tokens as $i => $token) { |
| 5968 | 5968 | if (!is_array($token)) { |
| 5969 | 5969 | continue; |
@@ -5999,7 +5999,7 @@ discard block |
||
| 5999 | 5999 | public function atBindFileContent($str = '') |
| 6000 | 6000 | { |
| 6001 | 6001 | |
| 6002 | - $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'] . 'files/', ''); |
|
| 6002 | + $search_path = array('assets/tvs/', 'assets/chunks/', 'assets/templates/', $this->config['rb_base_url'].'files/', ''); |
|
| 6003 | 6003 | |
| 6004 | 6004 | if (stripos($str, '@FILE') !== 0) { |
| 6005 | 6005 | return $str; |
@@ -6022,7 +6022,7 @@ discard block |
||
| 6022 | 6022 | $errorMsg = sprintf("Could not retrieve string '%s'.", $str); |
| 6023 | 6023 | |
| 6024 | 6024 | foreach ($search_path as $path) { |
| 6025 | - $file_path = MODX_BASE_PATH . $path . $str; |
|
| 6025 | + $file_path = MODX_BASE_PATH.$path.$str; |
|
| 6026 | 6026 | if (strpos($file_path, MODX_MANAGER_PATH) === 0) { |
| 6027 | 6027 | return $errorMsg; |
| 6028 | 6028 | } elseif (is_file($file_path)) { |
@@ -6036,7 +6036,7 @@ discard block |
||
| 6036 | 6036 | return $errorMsg; |
| 6037 | 6037 | } |
| 6038 | 6038 | |
| 6039 | - $content = (string)file_get_contents($file_path); |
|
| 6039 | + $content = (string) file_get_contents($file_path); |
|
| 6040 | 6040 | if ($content === false) { |
| 6041 | 6041 | return $errorMsg; |
| 6042 | 6042 | } |
@@ -6149,22 +6149,22 @@ discard block |
||
| 6149 | 6149 | |
| 6150 | 6150 | $version = isset ($GLOBALS['modx_version']) ? $GLOBALS['modx_version'] : ''; |
| 6151 | 6151 | $release_date = isset ($GLOBALS['release_date']) ? $GLOBALS['release_date'] : ''; |
| 6152 | - $request_uri = "http://" . $_SERVER['HTTP_HOST'] . ($_SERVER["SERVER_PORT"] == 80 ? "" : (":" . $_SERVER["SERVER_PORT"])) . $_SERVER['REQUEST_URI']; |
|
| 6152 | + $request_uri = "http://".$_SERVER['HTTP_HOST'].($_SERVER["SERVER_PORT"] == 80 ? "" : (":".$_SERVER["SERVER_PORT"])).$_SERVER['REQUEST_URI']; |
|
| 6153 | 6153 | $request_uri = $this->htmlspecialchars($request_uri, ENT_QUOTES, $this->config['modx_charset']); |
| 6154 | 6154 | $ua = $this->htmlspecialchars($_SERVER['HTTP_USER_AGENT'], ENT_QUOTES, $this->config['modx_charset']); |
| 6155 | 6155 | $referer = $this->htmlspecialchars($_SERVER['HTTP_REFERER'], ENT_QUOTES, $this->config['modx_charset']); |
| 6156 | 6156 | if ($is_error) { |
| 6157 | 6157 | $str = '<h2 style="color:red">« Evo Parse Error »</h2>'; |
| 6158 | 6158 | if ($msg != 'PHP Parse Error') { |
| 6159 | - $str .= '<h3 style="color:red">' . $msg . '</h3>'; |
|
| 6159 | + $str .= '<h3 style="color:red">'.$msg.'</h3>'; |
|
| 6160 | 6160 | } |
| 6161 | 6161 | } else { |
| 6162 | 6162 | $str = '<h2 style="color:#003399">« Evo Debug/ stop message »</h2>'; |
| 6163 | - $str .= '<h3 style="color:#003399">' . $msg . '</h3>'; |
|
| 6163 | + $str .= '<h3 style="color:#003399">'.$msg.'</h3>'; |
|
| 6164 | 6164 | } |
| 6165 | 6165 | |
| 6166 | 6166 | if (!empty ($query)) { |
| 6167 | - $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">SQL > <span id="sqlHolder">' . $query . '</span></div>'; |
|
| 6167 | + $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">SQL > <span id="sqlHolder">'.$query.'</span></div>'; |
|
| 6168 | 6168 | } |
| 6169 | 6169 | |
| 6170 | 6170 | $errortype = array( |
@@ -6187,13 +6187,13 @@ discard block |
||
| 6187 | 6187 | |
| 6188 | 6188 | if (!empty($nr) || !empty($file)) { |
| 6189 | 6189 | if ($text != '') { |
| 6190 | - $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : ' . $text . '</div>'; |
|
| 6190 | + $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">Error : '.$text.'</div>'; |
|
| 6191 | 6191 | } |
| 6192 | 6192 | if ($output != '') { |
| 6193 | - $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">' . $output . '</div>'; |
|
| 6193 | + $str .= '<div style="font-weight:bold;border:1px solid #ccc;padding:8px;color:#333;background-color:#ffffcd;margin-bottom:15px;">'.$output.'</div>'; |
|
| 6194 | 6194 | } |
| 6195 | 6195 | if ($nr !== '') { |
| 6196 | - $table[] = array('ErrorType[num]', $errortype [$nr] . "[" . $nr . "]"); |
|
| 6196 | + $table[] = array('ErrorType[num]', $errortype [$nr]."[".$nr."]"); |
|
| 6197 | 6197 | } |
| 6198 | 6198 | if ($file) { |
| 6199 | 6199 | $table[] = array('File', $file); |
@@ -6213,7 +6213,7 @@ discard block |
||
| 6213 | 6213 | } |
| 6214 | 6214 | |
| 6215 | 6215 | if (!empty($this->event->activePlugin)) { |
| 6216 | - $table[] = array('Current Plugin', $this->event->activePlugin . '(' . $this->event->name . ')'); |
|
| 6216 | + $table[] = array('Current Plugin', $this->event->activePlugin.'('.$this->event->name.')'); |
|
| 6217 | 6217 | } |
| 6218 | 6218 | |
| 6219 | 6219 | $str .= $MakeTable->create($table, array('Error information', '')); |
@@ -6223,17 +6223,17 @@ discard block |
||
| 6223 | 6223 | $table[] = array('REQUEST_URI', $request_uri); |
| 6224 | 6224 | |
| 6225 | 6225 | if ($this->manager->action) { |
| 6226 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
| 6226 | + include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php'); |
|
| 6227 | 6227 | global $action_list; |
| 6228 | 6228 | $actionName = (isset($action_list[$this->manager->action])) ? " - {$action_list[$this->manager->action]}" : ''; |
| 6229 | 6229 | |
| 6230 | - $table[] = array('Manager action', $this->manager->action . $actionName); |
|
| 6230 | + $table[] = array('Manager action', $this->manager->action.$actionName); |
|
| 6231 | 6231 | } |
| 6232 | 6232 | |
| 6233 | 6233 | if (preg_match('@^[0-9]+@', $this->documentIdentifier)) { |
| 6234 | 6234 | $resource = $this->getDocumentObject('id', $this->documentIdentifier); |
| 6235 | 6235 | $url = $this->makeUrl($this->documentIdentifier, '', '', 'full'); |
| 6236 | - $table[] = array('Resource', '[' . $this->documentIdentifier . '] <a href="' . $url . '" target="_blank">' . $resource['pagetitle'] . '</a>'); |
|
| 6236 | + $table[] = array('Resource', '['.$this->documentIdentifier.'] <a href="'.$url.'" target="_blank">'.$resource['pagetitle'].'</a>'); |
|
| 6237 | 6237 | } |
| 6238 | 6238 | $table[] = array('Referer', $referer); |
| 6239 | 6239 | $table[] = array('User Agent', $ua); |
@@ -6254,7 +6254,7 @@ discard block |
||
| 6254 | 6254 | |
| 6255 | 6255 | $mem = memory_get_peak_usage(true); |
| 6256 | 6256 | $total_mem = $mem - $this->mstart; |
| 6257 | - $total_mem = ($total_mem / 1024 / 1024) . ' mb'; |
|
| 6257 | + $total_mem = ($total_mem / 1024 / 1024).' mb'; |
|
| 6258 | 6258 | |
| 6259 | 6259 | $queryTime = $this->queryTime; |
| 6260 | 6260 | $phpTime = $totalTime - $queryTime; |
@@ -6275,18 +6275,18 @@ discard block |
||
| 6275 | 6275 | $str .= $this->get_backtrace(debug_backtrace()); |
| 6276 | 6276 | // Log error |
| 6277 | 6277 | if (!empty($this->currentSnippet)) { |
| 6278 | - $source = 'Snippet - ' . $this->currentSnippet; |
|
| 6278 | + $source = 'Snippet - '.$this->currentSnippet; |
|
| 6279 | 6279 | } elseif (!empty($this->event->activePlugin)) { |
| 6280 | - $source = 'Plugin - ' . $this->event->activePlugin; |
|
| 6280 | + $source = 'Plugin - '.$this->event->activePlugin; |
|
| 6281 | 6281 | } elseif ($source !== '') { |
| 6282 | - $source = 'Parser - ' . $source; |
|
| 6282 | + $source = 'Parser - '.$source; |
|
| 6283 | 6283 | } elseif ($query !== '') { |
| 6284 | 6284 | $source = 'SQL Query'; |
| 6285 | 6285 | } else { |
| 6286 | 6286 | $source = 'Parser'; |
| 6287 | 6287 | } |
| 6288 | 6288 | if ($msg) { |
| 6289 | - $source .= ' / ' . $msg; |
|
| 6289 | + $source .= ' / '.$msg; |
|
| 6290 | 6290 | } |
| 6291 | 6291 | if (isset($actionName) && !empty($actionName)) { |
| 6292 | 6292 | $source .= $actionName; |
@@ -6318,12 +6318,12 @@ discard block |
||
| 6318 | 6318 | |
| 6319 | 6319 | // Display error |
| 6320 | 6320 | if (isset($_SESSION['mgrValidated'])) { |
| 6321 | - echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><head><title>EVO Content Manager ' . $version . ' » ' . $release_date . '</title> |
|
| 6321 | + echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><head><title>EVO Content Manager '.$version.' » '.$release_date.'</title> |
|
| 6322 | 6322 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 6323 | - <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'] . 'media/style/' . $this->config['manager_theme'] . '/style.css" /> |
|
| 6323 | + <link rel="stylesheet" type="text/css" href="' . $this->config['site_manager_url'].'media/style/'.$this->config['manager_theme'].'/style.css" /> |
|
| 6324 | 6324 | <style type="text/css">body { padding:10px; } td {font:inherit;}</style> |
| 6325 | 6325 | </head><body> |
| 6326 | - ' . $str . '</body></html>'; |
|
| 6326 | + ' . $str.'</body></html>'; |
|
| 6327 | 6327 | |
| 6328 | 6328 | } else { |
| 6329 | 6329 | echo 'Error'; |
@@ -6361,7 +6361,7 @@ discard block |
||
| 6361 | 6361 | switch ($val['type']) { |
| 6362 | 6362 | case '->': |
| 6363 | 6363 | case '::': |
| 6364 | - $functionName = $val['function'] = $val['class'] . $val['type'] . $val['function']; |
|
| 6364 | + $functionName = $val['function'] = $val['class'].$val['type'].$val['function']; |
|
| 6365 | 6365 | break; |
| 6366 | 6366 | default: |
| 6367 | 6367 | $functionName = $val['function']; |
@@ -6371,7 +6371,7 @@ discard block |
||
| 6371 | 6371 | $args = array_pad(array(), $_, '$var'); |
| 6372 | 6372 | $args = implode(", ", $args); |
| 6373 | 6373 | $modx = &$this; |
| 6374 | - $args = preg_replace_callback('/\$var/', function () use ($modx, &$tmp, $val) { |
|
| 6374 | + $args = preg_replace_callback('/\$var/', function() use ($modx, &$tmp, $val) { |
|
| 6375 | 6375 | $arg = $val['args'][$tmp - 1]; |
| 6376 | 6376 | switch (true) { |
| 6377 | 6377 | case is_null($arg): { |
@@ -6383,7 +6383,7 @@ discard block |
||
| 6383 | 6383 | break; |
| 6384 | 6384 | } |
| 6385 | 6385 | case is_scalar($arg): { |
| 6386 | - $out = strlen($arg) > 20 ? 'string $var' . $tmp : ("'" . $this->htmlspecialchars(str_replace("'", "\\'", $arg)) . "'"); |
|
| 6386 | + $out = strlen($arg) > 20 ? 'string $var'.$tmp : ("'".$this->htmlspecialchars(str_replace("'", "\\'", $arg))."'"); |
|
| 6387 | 6387 | break; |
| 6388 | 6388 | } |
| 6389 | 6389 | case is_bool($arg): { |
@@ -6391,23 +6391,23 @@ discard block |
||
| 6391 | 6391 | break; |
| 6392 | 6392 | } |
| 6393 | 6393 | case is_array($arg): { |
| 6394 | - $out = 'array $var' . $tmp; |
|
| 6394 | + $out = 'array $var'.$tmp; |
|
| 6395 | 6395 | break; |
| 6396 | 6396 | } |
| 6397 | 6397 | case is_object($arg): { |
| 6398 | - $out = get_class($arg) . ' $var' . $tmp; |
|
| 6398 | + $out = get_class($arg).' $var'.$tmp; |
|
| 6399 | 6399 | break; |
| 6400 | 6400 | } |
| 6401 | 6401 | default: { |
| 6402 | - $out = '$var' . $tmp; |
|
| 6402 | + $out = '$var'.$tmp; |
|
| 6403 | 6403 | } |
| 6404 | 6404 | } |
| 6405 | 6405 | $tmp++; |
| 6406 | 6406 | return $out; |
| 6407 | 6407 | }, $args); |
| 6408 | 6408 | $line = array( |
| 6409 | - "<strong>" . $functionName . "</strong>(" . $args . ")", |
|
| 6410 | - $path . " on line " . $val['line'] |
|
| 6409 | + "<strong>".$functionName."</strong>(".$args.")", |
|
| 6410 | + $path." on line ".$val['line'] |
|
| 6411 | 6411 | ); |
| 6412 | 6412 | $table[] = array(implode("<br />", $line)); |
| 6413 | 6413 | } |
@@ -6448,7 +6448,7 @@ discard block |
||
| 6448 | 6448 | $alias = strip_tags($alias); // strip HTML |
| 6449 | 6449 | $alias = preg_replace('/[^\.A-Za-z0-9 _-]/', '', $alias); // strip non-alphanumeric characters |
| 6450 | 6450 | $alias = preg_replace('/\s+/', '-', $alias); // convert white-space to dash |
| 6451 | - $alias = preg_replace('/-+/', '-', $alias); // convert multiple dashes to one |
|
| 6451 | + $alias = preg_replace('/-+/', '-', $alias); // convert multiple dashes to one |
|
| 6452 | 6452 | $alias = trim($alias, '-'); // trim excess |
| 6453 | 6453 | return $alias; |
| 6454 | 6454 | } |
@@ -6464,7 +6464,7 @@ discard block |
||
| 6464 | 6464 | $precisions = count($sizes) - 1; |
| 6465 | 6465 | foreach ($sizes as $unit => $bytes) { |
| 6466 | 6466 | if ($size >= $bytes) { |
| 6467 | - return number_format($size / $bytes, $precisions) . ' ' . $unit; |
|
| 6467 | + return number_format($size / $bytes, $precisions).' '.$unit; |
|
| 6468 | 6468 | } |
| 6469 | 6469 | $precisions--; |
| 6470 | 6470 | } |
@@ -6568,10 +6568,10 @@ discard block |
||
| 6568 | 6568 | |
| 6569 | 6569 | if (strpos($str, MODX_MANAGER_PATH) === 0) { |
| 6570 | 6570 | return false; |
| 6571 | - } elseif (is_file(MODX_BASE_PATH . $str)) { |
|
| 6572 | - $file_path = MODX_BASE_PATH . $str; |
|
| 6573 | - } elseif (is_file(MODX_BASE_PATH . "{$tpl_dir}{$str}")) { |
|
| 6574 | - $file_path = MODX_BASE_PATH . $tpl_dir . $str; |
|
| 6571 | + } elseif (is_file(MODX_BASE_PATH.$str)) { |
|
| 6572 | + $file_path = MODX_BASE_PATH.$str; |
|
| 6573 | + } elseif (is_file(MODX_BASE_PATH."{$tpl_dir}{$str}")) { |
|
| 6574 | + $file_path = MODX_BASE_PATH.$tpl_dir.$str; |
|
| 6575 | 6575 | } else { |
| 6576 | 6576 | return false; |
| 6577 | 6577 | } |
@@ -6697,7 +6697,7 @@ discard block |
||
| 6697 | 6697 | $title = 'no title'; |
| 6698 | 6698 | } |
| 6699 | 6699 | if (is_array($msg)) { |
| 6700 | - $msg = '<pre>' . print_r($msg, true) . '</pre>'; |
|
| 6700 | + $msg = '<pre>'.print_r($msg, true).'</pre>'; |
|
| 6701 | 6701 | } elseif ($msg === '') { |
| 6702 | 6702 | $msg = $_SERVER['REQUEST_URI']; |
| 6703 | 6703 | } |
@@ -6742,7 +6742,7 @@ discard block |
||
| 6742 | 6742 | if (is_array($SystemAlertMsgQueque)) { |
| 6743 | 6743 | $title = ''; |
| 6744 | 6744 | if ($this->name && $this->activePlugin) { |
| 6745 | - $title = "<div><b>" . $this->activePlugin . "</b> - <span style='color:maroon;'>" . $this->name . "</span></div>"; |
|
| 6745 | + $title = "<div><b>".$this->activePlugin."</b> - <span style='color:maroon;'>".$this->name."</span></div>"; |
|
| 6746 | 6746 | } |
| 6747 | 6747 | $SystemAlertMsgQueque[] = "$title<div style='margin-left:10px;margin-top:3px;'>$msg</div>"; |
| 6748 | 6748 | } |