Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add CONTENT_EDIT_URI_RETURN variable to content plugin.
Instructs the plugin to return to the page with the edited content.
  • Loading branch information
racke committed Nov 14, 2013
1 parent f5e7c1f commit b05ebb4
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions plugins/content/code/form_content_edit_save.sub
Expand Up @@ -7,13 +7,6 @@ sub {
return {jump => 'content_edit'};
}

# determine page to show after edit
if ($Variable->{CONTENT_OVERVIEW_TYPE} eq 'panel') {
$page = 'content/list';
} else {
$page = 'content/recent';
}

$Tag->perl({tables => 'content'});

for (qw/title body uri/) {
Expand All @@ -22,6 +15,16 @@ sub {
$content{uid} = $Session->{username} || 0;
$content{type} = 'page';

# determine page to show after edit
if ($content{uri} && $Variable->{CONTENT_EDIT_URI_RETURN}) {
$page = $content{uri};
}
elsif ($Variable->{CONTENT_OVERVIEW_TYPE} eq 'panel') {
$page = 'content/list';
} else {
$page = 'content/recent';
}

# store timestamp
if ($CGI->{code}) {
my @edit_perms;
Expand Down

0 comments on commit b05ebb4

Please sign in to comment.