Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Cancel, and redirect on Save
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchisari authored and The Appleseed Project committed Nov 27, 2010
1 parent fa87d94 commit 5357b76
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions components/journal/controllers/entry.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public function Edit ( $pView = null, $pData = array ( ) ) {

private function _PrepAdd ( ) {

$this->View->Find ( '.journal', 0 )->action = "/profile/" . $this->_Focus->Username . '/journal/save/';
$this->View->Find ( '.journal', 0 )->action = "/profile/" . $this->_Focus->Username . '/journal/add';

$privacyData = array ( 'start' => $start, 'step' => $step, 'total' => $total, 'link' => $link );
$privacyControls = $this->View->Find ('.privacy');
Expand All @@ -113,7 +113,7 @@ private function _PrepEdit ( ) {

$Identifier = $this->GetSys ( 'Request' )->Get ( 'Identifier' );

$this->View->Find ( '.journal', 0 )->action = "/profile/" . $this->_Focus->Username . '/journal/' . $Identifier;
$this->View->Find ( '.journal', 0 )->action = "/profile/" . $this->_Focus->Username . '/journal/edit/' . $Identifier;

$privacyData = array ( 'start' => $start, 'step' => $step, 'total' => $total, 'link' => $link );
$privacyControls = $this->View->Find ('.privacy');
Expand Down Expand Up @@ -159,7 +159,11 @@ public function Cancel ( ) {

$Entry = $this->GetSys ( 'Request' )->Get ( 'Entry' );

$location = '/profile/' . $this->_Focus->Username . '/journal/' . $Entry;
if ( $Entry ) {
$location = '/profile/' . $this->_Focus->Username . '/journal/' . $Entry;
} else {
$location = '/profile/' . $this->_Focus->Username . '/journal/';
}

header ( 'Location: ' . $location );
exit;
Expand Down

0 comments on commit 5357b76

Please sign in to comment.