Completed
Push — develop ( fbe358...01f50e )
by Dmytro
09:14 queued 03:31
created
manager/processors/save_content.processor.php 1 patch
Spacing   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -278,7 +278,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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);
Please login to merge, or discard this patch.