[wellwell-devel] [wellwell] Add CONTENT_EDIT_URI_RETURN variable to content plugin.
Git
wellwell-devel at rt.icdevgroup.org
Thu Nov 14 20:32:18 UTC 2013
commit b05ebb450529665fb56dcc6d25e9cc21274eb267
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Thu Nov 14 21:31:59 2013 +0100
Add CONTENT_EDIT_URI_RETURN variable to content plugin.
Instructs the plugin to return to the page with the edited content.
plugins/content/code/form_content_edit_save.sub | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/plugins/content/code/form_content_edit_save.sub b/plugins/content/code/form_content_edit_save.sub
index 50ee4c8..fd9c586 100644
--- a/plugins/content/code/form_content_edit_save.sub
+++ b/plugins/content/code/form_content_edit_save.sub
@@ -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/) {
@@ -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;
More information about the wellwell-devel
mailing list