@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('save_password')) { |
@@ -10,11 +10,11 @@ discard block |
||
| 10 | 10 | $pass1 = $_POST['pass1']; |
| 11 | 11 | $pass2 = $_POST['pass2']; |
| 12 | 12 | |
| 13 | -if ($pass1!=$pass2) { |
|
| 13 | +if ($pass1 != $pass2) { |
|
| 14 | 14 | $modx->webAlertAndQuit("Passwords don't match!"); |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | -if (strlen($pass1)<6) { |
|
| 17 | +if (strlen($pass1) < 6) { |
|
| 18 | 18 | $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -32,5 +32,5 @@ discard block |
||
| 32 | 32 | 'userpassword' => $pass1 |
| 33 | 33 | )); |
| 34 | 34 | |
| 35 | -$header="Location: index.php?a=2"; |
|
| 35 | +$header = "Location: index.php?a=2"; |
|
| 36 | 36 | header($header); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | |
@@ -15,8 +15,8 @@ discard block |
||
| 15 | 15 | header($header); |
| 16 | 16 | } else { |
| 17 | 17 | // Remove single locks via AJAX / window.onbeforeunload |
| 18 | - $type = (int)$_GET['type']; |
|
| 19 | - $id = (int)$_GET['id']; |
|
| 18 | + $type = (int) $_GET['type']; |
|
| 19 | + $id = (int) $_GET['id']; |
|
| 20 | 20 | $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button |
| 21 | 21 | if ($type && $id) { |
| 22 | 22 | $modx->unlockElement($type, $id, $includeAllUsers); |
@@ -276,19 +276,19 @@ |
||
| 276 | 276 | |
| 277 | 277 | // invoke OnBeforeDocFormSave event |
| 278 | 278 | switch ($modx->config['docid_incrmnt_method']) { |
| 279 | - case '1': |
|
| 280 | - $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
|
| 281 | - $where = "T1.id IS NULL"; |
|
| 282 | - $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL"); |
|
| 283 | - $id = $modx->db->getValue($rs); |
|
| 279 | + case '1': |
|
| 280 | + $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
|
| 281 | + $where = "T1.id IS NULL"; |
|
| 282 | + $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL"); |
|
| 283 | + $id = $modx->db->getValue($rs); |
|
| 284 | + break; |
|
| 285 | + case '2': |
|
| 286 | + $rs = $modx->db->select('MAX(id)+1', $tbl_site_content); |
|
| 287 | + $id = $modx->db->getValue($rs); |
|
| 284 | 288 | break; |
| 285 | - case '2': |
|
| 286 | - $rs = $modx->db->select('MAX(id)+1', $tbl_site_content); |
|
| 287 | - $id = $modx->db->getValue($rs); |
|
| 288 | - break; |
|
| 289 | 289 | |
| 290 | - default: |
|
| 291 | - $id = ''; |
|
| 290 | + default: |
|
| 291 | + $id = ''; |
|
| 292 | 292 | } |
| 293 | 293 | |
| 294 | 294 | $modx->invokeEvent("OnBeforeDocFormSave", array( |
@@ -36,10 +36,10 @@ discard block |
||
| 36 | 36 | $aliasvisible = $_POST['alias_visible']; |
| 37 | 37 | |
| 38 | 38 | /************* webber ********/ |
| 39 | -$sd = isset($_POST['dir']) ? '&dir=' . $_POST['dir'] : '&dir=DESC'; |
|
| 40 | -$sb = isset($_POST['sort']) ? '&sort=' . $_POST['sort'] : '&sort=pub_date'; |
|
| 41 | -$pg = isset($_POST['page']) ? '&page=' . (int) $_POST['page'] : ''; |
|
| 42 | -$add_path = $sd . $sb . $pg; |
|
| 39 | +$sd = isset($_POST['dir']) ? '&dir='.$_POST['dir'] : '&dir=DESC'; |
|
| 40 | +$sb = isset($_POST['sort']) ? '&sort='.$_POST['sort'] : '&sort=pub_date'; |
|
| 41 | +$pg = isset($_POST['page']) ? '&page='.(int) $_POST['page'] : ''; |
|
| 42 | +$add_path = $sd.$sb.$pg; |
|
| 43 | 43 | |
| 44 | 44 | |
| 45 | 45 | |
@@ -193,15 +193,15 @@ discard block |
||
| 193 | 193 | INNER JOIN {$tbl_site_tmplvar_templates} AS tvtpl ON tvtpl.tmplvarid = tv.id |
| 194 | 194 | LEFT JOIN {$tbl_site_tmplvar_contentvalues} AS tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$id}' |
| 195 | 195 | LEFT JOIN {$tbl_site_tmplvar_access} AS tva ON tva.tmplvarid=tv.id", |
| 196 | - "tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)" . ((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)") . ")", |
|
| 196 | + "tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)".((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)").")", |
|
| 197 | 197 | "tv.rank" |
| 198 | 198 | ); |
| 199 | 199 | while ($row = $modx->db->getRow($rs)) { |
| 200 | 200 | $tmplvar = ''; |
| 201 | 201 | switch ($row['type']) { |
| 202 | 202 | case 'url': |
| 203 | - $tmplvar = $_POST["tv" . $row['id']]; |
|
| 204 | - if ($_POST["tv" . $row['id'] . '_prefix'] != '--') { |
|
| 203 | + $tmplvar = $_POST["tv".$row['id']]; |
|
| 204 | + if ($_POST["tv".$row['id'].'_prefix'] != '--') { |
|
| 205 | 205 | $tmplvar = str_replace(array( |
| 206 | 206 | "feed://", |
| 207 | 207 | "ftp://", |
@@ -209,23 +209,23 @@ discard block |
||
| 209 | 209 | "https://", |
| 210 | 210 | "mailto:" |
| 211 | 211 | ), "", $tmplvar); |
| 212 | - $tmplvar = $_POST["tv" . $row['id'] . '_prefix'] . $tmplvar; |
|
| 212 | + $tmplvar = $_POST["tv".$row['id'].'_prefix'].$tmplvar; |
|
| 213 | 213 | } |
| 214 | 214 | break; |
| 215 | 215 | case 'file': |
| 216 | - $tmplvar = $_POST["tv" . $row['id']]; |
|
| 216 | + $tmplvar = $_POST["tv".$row['id']]; |
|
| 217 | 217 | break; |
| 218 | 218 | default: |
| 219 | - if (is_array($_POST["tv" . $row['id']])) { |
|
| 219 | + if (is_array($_POST["tv".$row['id']])) { |
|
| 220 | 220 | // handles checkboxes & multiple selects elements |
| 221 | 221 | $feature_insert = array(); |
| 222 | - $lst = $_POST["tv" . $row['id']]; |
|
| 222 | + $lst = $_POST["tv".$row['id']]; |
|
| 223 | 223 | while (list($featureValue, $feature_item) = each($lst)) { |
| 224 | 224 | $feature_insert[count($feature_insert)] = $feature_item; |
| 225 | 225 | } |
| 226 | 226 | $tmplvar = implode("||", $feature_insert); |
| 227 | 227 | } else { |
| 228 | - $tmplvar = $_POST["tv" . $row['id']]; |
|
| 228 | + $tmplvar = $_POST["tv".$row['id']]; |
|
| 229 | 229 | } |
| 230 | 230 | break; |
| 231 | 231 | } |
@@ -253,7 +253,7 @@ discard block |
||
| 253 | 253 | // check to see if the user is allowed to save the document in the place he wants to save it in |
| 254 | 254 | if ($use_udperms == 1) { |
| 255 | 255 | if ($existingDocument['parent'] != $parent) { |
| 256 | - include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
| 256 | + include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
| 257 | 257 | $udperms = new udperms(); |
| 258 | 258 | $udperms->user = $modx->getLoginUserID(); |
| 259 | 259 | $udperms->document = $parent; |
@@ -369,11 +369,11 @@ discard block |
||
| 369 | 369 | foreach ($document_groups as $value_pair) { |
| 370 | 370 | // first, split the pair (this is a new document, so ignore the second value |
| 371 | 371 | list($group) = explode(',', $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list) |
| 372 | - $new_groups[] = '(' . (int) $group . ',' . $key . ')'; |
|
| 372 | + $new_groups[] = '('.(int) $group.','.$key.')'; |
|
| 373 | 373 | } |
| 374 | 374 | $saved = true; |
| 375 | 375 | if (!empty($new_groups)) { |
| 376 | - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', $new_groups)); |
|
| 376 | + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $new_groups)); |
|
| 377 | 377 | } |
| 378 | 378 | } else { |
| 379 | 379 | $isManager = $modx->hasPermission('access_permissions'); |
@@ -403,11 +403,11 @@ discard block |
||
| 403 | 403 | )); |
| 404 | 404 | |
| 405 | 405 | // secure web documents - flag as private |
| 406 | - include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; |
|
| 406 | + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
|
| 407 | 407 | secureWebDocument($key); |
| 408 | 408 | |
| 409 | 409 | // secure manager documents - flag as private |
| 410 | - include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php"; |
|
| 410 | + include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
|
| 411 | 411 | secureMgrDocument($key); |
| 412 | 412 | |
| 413 | 413 | // Set the item name for logger |
@@ -428,7 +428,7 @@ discard block |
||
| 428 | 428 | if ($_POST['mode'] == "4") { |
| 429 | 429 | $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; |
| 430 | 430 | } |
| 431 | - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay']; |
|
| 431 | + $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay']; |
|
| 432 | 432 | } else { |
| 433 | 433 | $header = "Location: index.php?a=3&id=$key&r=1"; |
| 434 | 434 | } |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | if (!$was_published && $published) { |
| 489 | 489 | $publishedon = $currentdate; |
| 490 | 490 | $publishedby = $modx->getLoginUserID(); |
| 491 | - } elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
|
| 491 | + } elseif ((!empty($pub_date) && $pub_date <= $currentdate && $published)) { |
|
| 492 | 492 | $publishedon = $pub_date; |
| 493 | 493 | $publishedby = $modx->getLoginUserID(); |
| 494 | 494 | } elseif ($was_published && !$published) { |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | . "menuindex={$menuindex}, " |
| 526 | 526 | . "searchable={$searchable}, " |
| 527 | 527 | . "cacheable={$cacheable}, " |
| 528 | - . "editedby=" . $modx->getLoginUserID() . ", " |
|
| 528 | + . "editedby=".$modx->getLoginUserID().", " |
|
| 529 | 529 | . "editedon={$currentdate}, " |
| 530 | 530 | . "publishedon={$publishedon}, " |
| 531 | 531 | . "publishedby={$publishedby}, " |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | } |
| 563 | 563 | |
| 564 | 564 | if (!empty($tvDeletions)) { |
| 565 | - $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN(' . implode(',', $tvDeletions) . ')'); |
|
| 565 | + $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN('.implode(',', $tvDeletions).')'); |
|
| 566 | 566 | } |
| 567 | 567 | |
| 568 | 568 | if (!empty($tvAdded)) { |
@@ -593,7 +593,7 @@ discard block |
||
| 593 | 593 | 'groups.id, groups.document_group', |
| 594 | 594 | "{$tbl_document_groups} AS groups |
| 595 | 595 | LEFT JOIN {$tbl_documentgroup_names} AS dgn ON dgn.id = groups.document_group", |
| 596 | - "((1=" . (int)$isManager . " AND dgn.private_memgroup) OR (1=" . (int)$isWeb . " AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
|
| 596 | + "((1=".(int) $isManager." AND dgn.private_memgroup) OR (1=".(int) $isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
|
| 597 | 597 | ); |
| 598 | 598 | $old_groups = array(); |
| 599 | 599 | while ($row = $modx->db->getRow($rs)) { |
@@ -607,14 +607,14 @@ discard block |
||
| 607 | 607 | unset($old_groups[$group]); |
| 608 | 608 | continue; |
| 609 | 609 | } elseif ($link_id == 'new') { |
| 610 | - $insertions[] = '(' . (int)$group . ',' . $id . ')'; |
|
| 610 | + $insertions[] = '('.(int) $group.','.$id.')'; |
|
| 611 | 611 | } |
| 612 | 612 | } |
| 613 | 613 | if (!empty($insertions)) { |
| 614 | - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', $insertions)); |
|
| 614 | + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $insertions)); |
|
| 615 | 615 | } |
| 616 | 616 | if (!empty($old_groups)) { |
| 617 | - $modx->db->delete($tbl_document_groups, "id IN (" . implode(',', $old_groups) . ")"); |
|
| 617 | + $modx->db->delete($tbl_document_groups, "id IN (".implode(',', $old_groups).")"); |
|
| 618 | 618 | } |
| 619 | 619 | // necessary to remove all permissions as document is public |
| 620 | 620 | if ((isset($_POST['chkalldocs']) && $_POST['chkalldocs'] == 'on')) { |
@@ -645,11 +645,11 @@ discard block |
||
| 645 | 645 | )); |
| 646 | 646 | |
| 647 | 647 | // secure web documents - flag as private |
| 648 | - include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; |
|
| 648 | + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
|
| 649 | 649 | secureWebDocument($id); |
| 650 | 650 | |
| 651 | 651 | // secure manager documents - flag as private |
| 652 | - include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php"; |
|
| 652 | + include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
|
| 653 | 653 | secureMgrDocument($id); |
| 654 | 654 | |
| 655 | 655 | // Set the item name for logger |
@@ -661,7 +661,7 @@ discard block |
||
| 661 | 661 | } |
| 662 | 662 | |
| 663 | 663 | if ($_POST['refresh_preview'] == '1') { |
| 664 | - $header = "Location: " . MODX_SITE_URL . "index.php?id=$id&z=manprev"; |
|
| 664 | + $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; |
|
| 665 | 665 | } else { |
| 666 | 666 | if ($_POST['stay'] != '2' && $id > 0) { |
| 667 | 667 | $modx->unlockElement(7, $id); |
@@ -675,9 +675,9 @@ discard block |
||
| 675 | 675 | // document |
| 676 | 676 | $a = ($_POST['stay'] == '2') ? "27&id=$id" : "4&pid=$parent"; |
| 677 | 677 | } |
| 678 | - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'] . $add_path; |
|
| 678 | + $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay'].$add_path; |
|
| 679 | 679 | } else { |
| 680 | - $header = "Location: index.php?a=3&id=$id&r=1" . $add_path; |
|
| 680 | + $header = "Location: index.php?a=3&id=$id&r=1".$add_path; |
|
| 681 | 681 | } |
| 682 | 682 | } |
| 683 | 683 | if (headers_sent()) { |
@@ -1,32 +1,32 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if (!$modx->hasPermission('save_document')||!$modx->hasPermission('publish_document')) { |
|
| 5 | +if (!$modx->hasPermission('save_document') || !$modx->hasPermission('publish_document')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_REQUEST['id'])? (int)$_REQUEST['id'] : 0; |
|
| 10 | -if ($id==0) { |
|
| 9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | /************webber ********/ |
| 15 | -$content=$modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'")); |
|
| 16 | -$pid=($content['parent']==0?$id:$content['parent']); |
|
| 15 | +$content = $modx->db->getRow($modx->db->select('parent, pagetitle', $modx->getFullTableName('site_content'), "id='{$id}'")); |
|
| 16 | +$pid = ($content['parent'] == 0 ? $id : $content['parent']); |
|
| 17 | 17 | |
| 18 | 18 | /************** webber *************/ |
| 19 | -$sd=isset($_REQUEST['dir'])?'&dir=' . $_REQUEST['dir']:'&dir=DESC'; |
|
| 20 | -$sb=isset($_REQUEST['sort'])?'&sort=' . $_REQUEST['sort']:'&sort=createdon'; |
|
| 21 | -$pg=isset($_REQUEST['page'])?'&page=' . (int)$_REQUEST['page']:''; |
|
| 22 | -$add_path=$sd . $sb . $pg; |
|
| 19 | +$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC'; |
|
| 20 | +$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon'; |
|
| 21 | +$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : ''; |
|
| 22 | +$add_path = $sd.$sb.$pg; |
|
| 23 | 23 | |
| 24 | 24 | /***********************************/ |
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | |
| 28 | 28 | // check permissions on the document |
| 29 | -include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
| 29 | +include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
| 30 | 30 | $udperms = new udperms(); |
| 31 | 31 | $udperms->user = $modx->getLoginUserID(); |
| 32 | 32 | $udperms->document = $id; |
@@ -57,6 +57,6 @@ discard block |
||
| 57 | 57 | // empty cache |
| 58 | 58 | $modx->clearCache('full'); |
| 59 | 59 | |
| 60 | -$header="Location: index.php?a=3&id=$pid&r=1" . $add_path; |
|
| 60 | +$header = "Location: index.php?a=3&id=$pid&r=1".$add_path; |
|
| 61 | 61 | |
| 62 | 62 | header($header); |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('delete_snippet')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 10 | -if ($id==0) { |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
@@ -34,5 +34,5 @@ discard block |
||
| 34 | 34 | $modx->clearCache('full'); |
| 35 | 35 | |
| 36 | 36 | // finished emptying cache - redirect |
| 37 | -$header="Location: index.php?a=76&r=2"; |
|
| 37 | +$header = "Location: index.php?a=76&r=2"; |
|
| 38 | 38 | header($header); |
@@ -1,21 +1,21 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('new_chunk')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 10 | -if ($id==0) { |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | // count duplicates |
| 15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_htmlsnippets'), "id='{$id}'")); |
| 16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_htmlsnippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 17 | -if ($count>=1) { |
|
| 18 | - $count = ' ' . ($count+1); |
|
| 17 | +if ($count >= 1) { |
|
| 18 | + $count = ' '.($count + 1); |
|
| 19 | 19 | } else { |
| 20 | 20 | $count = ''; |
| 21 | 21 | } |
@@ -35,5 +35,5 @@ discard block |
||
| 35 | 35 | $_SESSION['itemname'] = $name; |
| 36 | 36 | |
| 37 | 37 | // finish duplicating - redirect to new chunk |
| 38 | -$header="Location: index.php?r=2&a=78&id=$newid"; |
|
| 38 | +$header = "Location: index.php?r=2&a=78&id=$newid"; |
|
| 39 | 39 | header($header); |
@@ -1,21 +1,21 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('new_snippet')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 10 | -if ($id==0) { |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | // count duplicates |
| 15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_snippets'), "id='{$id}'")); |
| 16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_snippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 17 | -if ($count>=1) { |
|
| 18 | - $count = ' ' . ($count+1); |
|
| 17 | +if ($count >= 1) { |
|
| 18 | + $count = ' '.($count + 1); |
|
| 19 | 19 | } else { |
| 20 | 20 | $count = ''; |
| 21 | 21 | } |
@@ -36,5 +36,5 @@ discard block |
||
| 36 | 36 | $_SESSION['itemname'] = $name; |
| 37 | 37 | |
| 38 | 38 | // finish duplicating - redirect to new snippet |
| 39 | -$header="Location: index.php?r=2&a=22&id=$newid"; |
|
| 39 | +$header = "Location: index.php?r=2&a=22&id=$newid"; |
|
| 40 | 40 | header($header); |
@@ -1,20 +1,20 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('new_document') || !$modx->hasPermission('save_document')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 10 | -if ($id==0) { |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | $children = array(); |
| 15 | 15 | |
| 16 | 16 | // check permissions on the document |
| 17 | -include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
| 17 | +include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
| 18 | 18 | $udperms = new udperms(); |
| 19 | 19 | $udperms->user = $modx->getLoginUserID(); |
| 20 | 20 | $udperms->document = $id; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $_SESSION['itemname'] = $name; |
| 34 | 34 | |
| 35 | 35 | // finish cloning - redirect |
| 36 | -$header="Location: index.php?r=1&a=3&id=$id"; |
|
| 36 | +$header = "Location: index.php?r=1&a=3&id=$id"; |
|
| 37 | 37 | header($header); |
| 38 | 38 | |
| 39 | 39 | /** |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | * @param int $_toplevel |
| 43 | 43 | * @return int |
| 44 | 44 | */ |
| 45 | -function duplicateDocument($docid, $parent=null, $_toplevel=0) |
|
| 45 | +function duplicateDocument($docid, $parent = null, $_toplevel = 0) |
|
| 46 | 46 | { |
| 47 | 47 | $modx = evolutionCMS(); |
| 48 | 48 | global $_lang; |
@@ -86,13 +86,13 @@ discard block |
||
| 86 | 86 | $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$docid}'")); |
| 87 | 87 | $pagetitle = $modx->db->escape($pagetitle); |
| 88 | 88 | $count = $modx->db->getRecordCount($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "pagetitle LIKE '{$pagetitle} Duplicate%'")); |
| 89 | - if ($count>=1) { |
|
| 90 | - $count = ' ' . ($count+1); |
|
| 89 | + if ($count >= 1) { |
|
| 90 | + $count = ' '.($count + 1); |
|
| 91 | 91 | } else { |
| 92 | 92 | $count = ''; |
| 93 | 93 | } |
| 94 | 94 | |
| 95 | - $content['pagetitle'] = $_lang['duplicated_el_suffix'] . $count . ' ' . $content['pagetitle']; |
|
| 95 | + $content['pagetitle'] = $_lang['duplicated_el_suffix'].$count.' '.$content['pagetitle']; |
|
| 96 | 96 | $content['alias'] = null; |
| 97 | 97 | } elseif ($modx->config['friendly_urls'] == 0 || $modx->config['allow_duplicate_alias'] == 0) { |
| 98 | 98 | $content['alias'] = null; |
@@ -161,8 +161,8 @@ discard block |
||
| 161 | 161 | |
| 162 | 162 | $tbltvc = $modx->getFullTableName('site_tmplvar_contentvalues'); |
| 163 | 163 | |
| 164 | - $newid = (int)$newid; |
|
| 165 | - $oldid = (int)$oldid; |
|
| 164 | + $newid = (int) $newid; |
|
| 165 | + $oldid = (int) $oldid; |
|
| 166 | 166 | |
| 167 | 167 | $modx->db->insert( |
| 168 | 168 | array('contentid'=>'', 'tmplvarid'=>'', 'value'=>''), $tbltvc, // Insert into |
@@ -182,8 +182,8 @@ discard block |
||
| 182 | 182 | |
| 183 | 183 | $tbldg = $modx->getFullTableName('document_groups'); |
| 184 | 184 | |
| 185 | - $newid = (int)$newid; |
|
| 186 | - $oldid = (int)$oldid; |
|
| 185 | + $newid = (int) $newid; |
|
| 186 | + $oldid = (int) $oldid; |
|
| 187 | 187 | |
| 188 | 188 | $modx->db->insert( |
| 189 | 189 | array('document'=>'', 'document_group'=>''), $tbldg, // Insert into |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('delete_snippet')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 10 | -if ($id==0) { |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
@@ -34,5 +34,5 @@ discard block |
||
| 34 | 34 | $modx->clearCache('full'); |
| 35 | 35 | |
| 36 | 36 | // finished emptying cache - redirect |
| 37 | -$header="Location: index.php?a=76&r=2"; |
|
| 37 | +$header = "Location: index.php?a=76&r=2"; |
|
| 38 | 38 | header($header); |