@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | // Determine upgradeability |
| 3 | 3 | $upgradeable = 0; |
| 4 | -if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { // Include the file so we can test its validity |
|
| 5 | - include_once $base_path . MGR_DIR . '/includes/config.inc.php'; |
|
| 4 | +if (is_file($base_path.MGR_DIR.'/includes/config.inc.php')) { // Include the file so we can test its validity |
|
| 5 | + include_once $base_path.MGR_DIR.'/includes/config.inc.php'; |
|
| 6 | 6 | // We need to have all connection settings - tho prefix may be empty so we have to ignore it |
| 7 | 7 | if (isset($dbase)) { |
| 8 | 8 | if (!$conn = @mysqli_connect($database_server, $database_user, $database_password)) |
@@ -17,16 +17,16 @@ discard block |
||
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | $ph['moduleName'] = $moduleName; |
| 20 | -$ph['displayNew'] = ($upgradeable!=0) ? 'display:none;' : ''; |
|
| 21 | -$ph['displayUpg'] = ($upgradeable==0) ? 'display:none;' : ''; |
|
| 20 | +$ph['displayNew'] = ($upgradeable != 0) ? 'display:none;' : ''; |
|
| 21 | +$ph['displayUpg'] = ($upgradeable == 0) ? 'display:none;' : ''; |
|
| 22 | 22 | $ph['displayAdvUpg'] = $ph['displayUpg']; |
| 23 | -$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
| 24 | -$ph['checkedUpg'] = ($_POST['installmode']==1 || $upgradeable==1) ? 'checked' : ''; |
|
| 25 | -$ph['checkedAdvUpg'] = ($_POST['installmode']==2 || $upgradeable==2) ? 'checked' : ''; |
|
| 23 | +$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
| 24 | +$ph['checkedUpg'] = ($_POST['installmode'] == 1 || $upgradeable == 1) ? 'checked' : ''; |
|
| 25 | +$ph['checkedAdvUpg'] = ($_POST['installmode'] == 2 || $upgradeable == 2) ? 'checked' : ''; |
|
| 26 | 26 | $ph['install_language'] = $install_language; |
| 27 | -$ph['disabledUpg'] = ($upgradeable!=1) ? 'disabled' : ''; |
|
| 28 | -$ph['disabledAdvUpg'] = ($upgradeable==0) ? 'disabled' : ''; |
|
| 27 | +$ph['disabledUpg'] = ($upgradeable != 1) ? 'disabled' : ''; |
|
| 28 | +$ph['disabledAdvUpg'] = ($upgradeable == 0) ? 'disabled' : ''; |
|
| 29 | 29 | |
| 30 | -$tpl = file_get_contents($base_path . 'install/actions/tpl_mode.html'); |
|
| 30 | +$tpl = file_get_contents($base_path.'install/actions/tpl_mode.html'); |
|
| 31 | 31 | $content = parse($tpl, $ph); |
| 32 | -echo parse($content, $_lang,'[%','%]'); |
|
| 32 | +echo parse($content, $_lang, '[%', '%]'); |
|
@@ -1,20 +1,22 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | // Determine upgradeability |
| 3 | 3 | $upgradeable = 0; |
| 4 | -if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { // Include the file so we can test its validity |
|
| 4 | +if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { |
|
| 5 | +// Include the file so we can test its validity |
|
| 5 | 6 | include_once $base_path . MGR_DIR . '/includes/config.inc.php'; |
| 6 | 7 | // We need to have all connection settings - tho prefix may be empty so we have to ignore it |
| 7 | 8 | if (isset($dbase)) { |
| 8 | - if (!$conn = @mysqli_connect($database_server, $database_user, $database_password)) |
|
| 9 | - $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
| 10 | - elseif (!@mysqli_select_db($conn, trim($dbase, '`'))) |
|
| 11 | - $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
| 12 | - else |
|
| 13 | - $upgradeable = 1; |
|
| 9 | + if (!$conn = @mysqli_connect($database_server, $database_user, $database_password)) { |
|
| 10 | + $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
| 11 | + } elseif (!@mysqli_select_db($conn, trim($dbase, '`'))) { |
|
| 12 | + $upgradeable = isset($_POST['installmode']) && $_POST['installmode'] == 'new' ? 0 : 2; |
|
| 13 | + } else { |
|
| 14 | + $upgradeable = 1; |
|
| 15 | + } |
|
| 16 | + } else { |
|
| 17 | + $upgradeable = 2; |
|
| 18 | + } |
|
| 14 | 19 | } |
| 15 | - else |
|
| 16 | - $upgradeable = 2; |
|
| 17 | -} |
|
| 18 | 20 | |
| 19 | 21 | $ph['moduleName'] = $moduleName; |
| 20 | 22 | $ph['displayNew'] = ($upgradeable!=0) ? 'display:none;' : ''; |
@@ -492,7 +492,7 @@ |
||
| 492 | 492 | }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
| 493 | 493 | $publishedon = $pub_date; |
| 494 | 494 | $publishedby = $modx->getLoginUserID(); |
| 495 | - }elseif ($was_published && !$published) { |
|
| 495 | + }elseif ($was_published && !$published) { |
|
| 496 | 496 | $publishedon = 0; |
| 497 | 497 | $publishedby = 0; |
| 498 | 498 | } else { |
@@ -280,19 +280,19 @@ |
||
| 280 | 280 | // invoke OnBeforeDocFormSave event |
| 281 | 281 | switch($modx->config['docid_incrmnt_method']) |
| 282 | 282 | { |
| 283 | - case '1': |
|
| 284 | - $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
|
| 285 | - $where = "T1.id IS NULL"; |
|
| 286 | - $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL"); |
|
| 287 | - $id = $modx->db->getValue($rs); |
|
| 283 | + case '1': |
|
| 284 | + $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
|
| 285 | + $where = "T1.id IS NULL"; |
|
| 286 | + $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL"); |
|
| 287 | + $id = $modx->db->getValue($rs); |
|
| 288 | + break; |
|
| 289 | + case '2': |
|
| 290 | + $rs = $modx->db->select('MAX(id)+1', $tbl_site_content); |
|
| 291 | + $id = $modx->db->getValue($rs); |
|
| 288 | 292 | break; |
| 289 | - case '2': |
|
| 290 | - $rs = $modx->db->select('MAX(id)+1', $tbl_site_content); |
|
| 291 | - $id = $modx->db->getValue($rs); |
|
| 292 | - break; |
|
| 293 | 293 | |
| 294 | - default: |
|
| 295 | - $id = ''; |
|
| 294 | + default: |
|
| 295 | + $id = ''; |
|
| 296 | 296 | } |
| 297 | 297 | |
| 298 | 298 | $modx->invokeEvent("OnBeforeDocFormSave", array( |
@@ -278,7 +278,7 @@ discard block |
||
| 278 | 278 | case 'new' : |
| 279 | 279 | |
| 280 | 280 | // invoke OnBeforeDocFormSave event |
| 281 | - switch($modx->config['docid_incrmnt_method']) |
|
| 281 | + switch ($modx->config['docid_incrmnt_method']) |
|
| 282 | 282 | { |
| 283 | 283 | case '1': |
| 284 | 284 | $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | if (!$was_published && $published) { |
| 490 | 490 | $publishedon = $currentdate; |
| 491 | 491 | $publishedby = $modx->getLoginUserID(); |
| 492 | - }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
|
| 492 | + }elseif ((!empty($pub_date) && $pub_date <= $currentdate && $published)) { |
|
| 493 | 493 | $publishedon = $pub_date; |
| 494 | 494 | $publishedby = $modx->getLoginUserID(); |
| 495 | 495 | }elseif ($was_published && !$published) { |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | // invoke OnBeforeDocFormSave event |
| 504 | - $modx->invokeEvent("OnBeforeDocFormSave", array ( |
|
| 504 | + $modx->invokeEvent("OnBeforeDocFormSave", array( |
|
| 505 | 505 | "mode" => "upd", |
| 506 | 506 | "id" => $id |
| 507 | 507 | )); |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | . "menuindex={$menuindex}, " |
| 527 | 527 | . "searchable={$searchable}, " |
| 528 | 528 | . "cacheable={$cacheable}, " |
| 529 | - . "editedby=" . $modx->getLoginUserID() . ", " |
|
| 529 | + . "editedby=".$modx->getLoginUserID().", " |
|
| 530 | 530 | . "editedon={$currentdate}, " |
| 531 | 531 | . "publishedon={$publishedon}, " |
| 532 | 532 | . "publishedby={$publishedby}, " |
@@ -540,7 +540,7 @@ discard block |
||
| 540 | 540 | |
| 541 | 541 | // update template variables |
| 542 | 542 | $rs = $modx->db->select('id, tmplvarid', $tbl_site_tmplvar_contentvalues, "contentid='{$id}'"); |
| 543 | - $tvIds = array (); |
|
| 543 | + $tvIds = array(); |
|
| 544 | 544 | while ($row = $modx->db->getRow($rs)) { |
| 545 | 545 | $tvIds[$row['tmplvarid']] = $row['id']; |
| 546 | 546 | } |
@@ -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)) $old_groups[$row['document_group']] = $row['id']; |
@@ -605,7 +605,7 @@ discard block |
||
| 605 | 605 | unset($old_groups[$group]); |
| 606 | 606 | continue; |
| 607 | 607 | } elseif ($link_id == 'new') { |
| 608 | - $insertions[] = '('.(int)$group.','.$id.')'; |
|
| 608 | + $insertions[] = '('.(int) $group.','.$id.')'; |
|
| 609 | 609 | } |
| 610 | 610 | } |
| 611 | 611 | if (!empty($insertions)) { |
@@ -637,17 +637,17 @@ discard block |
||
| 637 | 637 | |
| 638 | 638 | |
| 639 | 639 | // invoke OnDocFormSave event |
| 640 | - $modx->invokeEvent("OnDocFormSave", array ( |
|
| 640 | + $modx->invokeEvent("OnDocFormSave", array( |
|
| 641 | 641 | "mode" => "upd", |
| 642 | 642 | "id" => $id |
| 643 | 643 | )); |
| 644 | 644 | |
| 645 | 645 | // secure web documents - flag as private |
| 646 | - include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; |
|
| 646 | + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
|
| 647 | 647 | secureWebDocument($id); |
| 648 | 648 | |
| 649 | 649 | // secure manager documents - flag as private |
| 650 | - include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php"; |
|
| 650 | + include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
|
| 651 | 651 | secureMgrDocument($id); |
| 652 | 652 | |
| 653 | 653 | // Set the item name for logger |
@@ -673,13 +673,13 @@ discard block |
||
| 673 | 673 | // document |
| 674 | 674 | $a = ($_POST['stay'] == '2') ? "27&id=$id" : "4&pid=$parent"; |
| 675 | 675 | } |
| 676 | - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'].$add_path; |
|
| 676 | + $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay'].$add_path; |
|
| 677 | 677 | } else { |
| 678 | 678 | $header = "Location: index.php?a=3&id=$id&r=1".$add_path; |
| 679 | 679 | } |
| 680 | 680 | } |
| 681 | 681 | if (headers_sent()) { |
| 682 | - $header = str_replace('Location: ','',$header); |
|
| 682 | + $header = str_replace('Location: ', '', $header); |
|
| 683 | 683 | echo "<script>document.location.href='$header';</script>\n"; |
| 684 | 684 | } else { |
| 685 | 685 | header($header); |
@@ -134,8 +134,7 @@ discard block |
||
| 134 | 134 | } |
| 135 | 135 | //end webber |
| 136 | 136 | } |
| 137 | -} |
|
| 138 | -elseif ($alias) { |
|
| 137 | +} elseif ($alias) { |
|
| 139 | 138 | $alias = $modx->stripAlias($alias); |
| 140 | 139 | } |
| 141 | 140 | |
@@ -149,8 +148,7 @@ discard block |
||
| 149 | 148 | |
| 150 | 149 | if ($pub_date < $currentdate) { |
| 151 | 150 | $published = 1; |
| 152 | - } |
|
| 153 | - elseif ($pub_date > $currentdate) { |
|
| 151 | + } elseif ($pub_date > $currentdate) { |
|
| 154 | 152 | $published = 0; |
| 155 | 153 | } |
| 156 | 154 | } |
@@ -278,8 +276,7 @@ discard block |
||
| 278 | 276 | case 'new' : |
| 279 | 277 | |
| 280 | 278 | // invoke OnBeforeDocFormSave event |
| 281 | - switch($modx->config['docid_incrmnt_method']) |
|
| 282 | - { |
|
| 279 | + switch($modx->config['docid_incrmnt_method']) { |
|
| 283 | 280 | case '1': |
| 284 | 281 | $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
| 285 | 282 | $where = "T1.id IS NULL"; |
@@ -347,8 +344,9 @@ discard block |
||
| 347 | 344 | "alias_visible" => $aliasvisible |
| 348 | 345 | ); |
| 349 | 346 | |
| 350 | - if ($id != '') |
|
| 351 | - $dbInsert["id"] = $id; |
|
| 347 | + if ($id != '') { |
|
| 348 | + $dbInsert["id"] = $id; |
|
| 349 | + } |
|
| 352 | 350 | |
| 353 | 351 | $key = $modx->db->insert($dbInsert, $tbl_site_content); |
| 354 | 352 | |
@@ -424,11 +422,13 @@ discard block |
||
| 424 | 422 | // redirect/stay options |
| 425 | 423 | if ($_POST['stay'] != '') { |
| 426 | 424 | // weblink |
| 427 | - if ($_POST['mode'] == "72") |
|
| 428 | - $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent"; |
|
| 425 | + if ($_POST['mode'] == "72") { |
|
| 426 | + $a = ($_POST['stay'] == '2') ? "27&id=$key" : "72&pid=$parent"; |
|
| 427 | + } |
|
| 429 | 428 | // document |
| 430 | - if ($_POST['mode'] == "4") |
|
| 431 | - $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; |
|
| 429 | + if ($_POST['mode'] == "4") { |
|
| 430 | + $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; |
|
| 431 | + } |
|
| 432 | 432 | $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay']; |
| 433 | 433 | } else { |
| 434 | 434 | $header = "Location: index.php?a=3&id=$key&r=1"; |
@@ -489,10 +489,10 @@ discard block |
||
| 489 | 489 | if (!$was_published && $published) { |
| 490 | 490 | $publishedon = $currentdate; |
| 491 | 491 | $publishedby = $modx->getLoginUserID(); |
| 492 | - }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
|
| 492 | + } elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
|
| 493 | 493 | $publishedon = $pub_date; |
| 494 | 494 | $publishedby = $modx->getLoginUserID(); |
| 495 | - }elseif ($was_published && !$published) { |
|
| 495 | + } elseif ($was_published && !$published) { |
|
| 496 | 496 | $publishedon = 0; |
| 497 | 497 | $publishedby = 0; |
| 498 | 498 | } else { |
@@ -548,7 +548,9 @@ discard block |
||
| 548 | 548 | $tvChanges = array(); |
| 549 | 549 | foreach ($tmplvars as $field => $value) { |
| 550 | 550 | if (!is_array($value)) { |
| 551 | - if (isset($tvIds[$value])) $tvDeletions[] = $tvIds[$value]; |
|
| 551 | + if (isset($tvIds[$value])) { |
|
| 552 | + $tvDeletions[] = $tvIds[$value]; |
|
| 553 | + } |
|
| 552 | 554 | } else { |
| 553 | 555 | $tvId = $value[0]; |
| 554 | 556 | $tvVal = $value[1]; |
@@ -596,7 +598,9 @@ discard block |
||
| 596 | 598 | "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
| 597 | 599 | ); |
| 598 | 600 | $old_groups = array(); |
| 599 | - while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id']; |
|
| 601 | + while ($row = $modx->db->getRow($rs)) { |
|
| 602 | + $old_groups[$row['document_group']] = $row['id']; |
|
| 603 | + } |
|
| 600 | 604 | |
| 601 | 605 | // update the permissions in the database |
| 602 | 606 | $insertions = $deletions = array(); |
@@ -658,9 +662,9 @@ discard block |
||
| 658 | 662 | $modx->clearCache('full'); |
| 659 | 663 | } |
| 660 | 664 | |
| 661 | - if ($_POST['refresh_preview'] == '1') |
|
| 662 | - $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; |
|
| 663 | - else { |
|
| 665 | + if ($_POST['refresh_preview'] == '1') { |
|
| 666 | + $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; |
|
| 667 | + } else { |
|
| 664 | 668 | if ($_POST['stay'] != '2' && $id > 0) { |
| 665 | 669 | $modx->unlockElement(7, $id); |
| 666 | 670 | } |
@@ -1,5 +1,5 @@ |
||
| 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 | ?> |
@@ -1,5 +1,5 @@ |
||
| 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 | ?> |
@@ -1,5 +1,5 @@ |
||
| 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 | ?> |