Skip to content
This repository
Browse code

MINOR Using new PjaxResponseNegotiator in CMSMain

  • Loading branch information...
commit a6c586ae203fd0ca01c2c81b8966e01ab2235fd7 1 parent 3341a18
Ingo Schommer authored April 05, 2012

Showing 1 changed file with 5 additions and 21 deletions. Show diff stats Hide diff stats

  1. 26  code/controllers/CMSMain.php
26  code/controllers/CMSMain.php
@@ -591,20 +591,12 @@ public function save($data, $form) {
591 591
 					$record->Title
592 592
 				)
593 593
 			);
594  
-		
595  
-			// Reload form, data and actions might have changed
596  
-			$form = $this->getEditForm($record->ID);
597 594
 		} else {
598 595
 			$this->response->addHeader('X-Status', _t('LeftAndMain.SAVEDUP'));
599  
-			
600  
-			// Reload form, data and actions might have changed
601  
-			$form = $this->getEditForm($record->ID);
602 596
 		}
603  
-		
604  
-		return $form->forTemplate();
605  
-	}
606 597
 
607  
-	
  598
+		return $this->getResponseNegotiator()->respond($this->request);
  599
+	}
608 600
 
609 601
 	/**
610 602
 	 * @uses LeftAndMainExtension->augmentNewSiteTreeItem()
@@ -742,9 +734,7 @@ public function revert($data, $form) {
742 734
 			)
743 735
 		);
744 736
 		
745  
-		$form = $this->getEditForm($record->ID);
746  
-		
747  
-		return $form->forTemplate();
  737
+		return $this->getResponseNegotiator()->respond($this->request);
748 738
 	}
749 739
 	
750 740
 	/**
@@ -796,10 +786,7 @@ function unpublish($data, $form) {
796 786
 			sprintf(_t('CMSMain.REMOVEDPAGE',"Removed '%s' from the published site"),$record->Title)
797 787
 		);
798 788
 		
799  
-		// Reload form, data and actions might have changed
800  
-		$form = $this->getEditForm($record->ID);
801  
-		
802  
-		return $form->forTemplate();
  789
+		return $this->getResponseNegotiator()->respond($this->request);
803 790
 	}
804 791
 
805 792
 	/**
@@ -948,10 +935,7 @@ function restore($data, $form) {
948 935
 			)
949 936
 		);
950 937
 		
951  
-		// Reload form, data and actions might have changed
952  
-		$form = $this->getEditForm($restoredPage->ID);
953  
-		
954  
-		return $form->forTemplate();
  938
+		return $this->getResponseNegotiator()->respond($this->request);
955 939
 	}
956 940
 
957 941
 	function duplicate($request) {

0 notes on commit a6c586a

Please sign in to comment.
Something went wrong with that request. Please try again.