[wellwell-devel] [SCM] Interchange wellwell catalog branch, master, updated. 8988661c695daa882f21fe8ea0caecef684ab7ac
Stefan Hornburg
racke at rt.icdevgroup.org
Fri Dec 11 09:24:54 UTC 2009
via 8988661c695daa882f21fe8ea0caecef684ab7ac (commit)
via d144774d3872046db4a75ef3fabeff06a0986be5 (commit)
via 3927c1555cea131084b59a232228191ec1c26781 (commit)
from d8e6f6887db7bffdeb3fd8e693890de91c302d72 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 8988661c695daa882f21fe8ea0caecef684ab7ac
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Fri Dec 11 10:24:05 2009 +0100
added variable CONTENT_OVERVIEW_TYPE to select between blog and list view
commit d144774d3872046db4a75ef3fabeff06a0986be5
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Fri Dec 11 10:22:53 2009 +0100
added view_content to list of permissions
commit 3927c1555cea131084b59a232228191ec1c26781
Author: Stefan Hornburg (Racke) <racke at linuxia.de>
Date: Fri Dec 11 10:08:06 2009 +0100
allow previews and edit of content posted by anonymous users
-----------------------------------------------------------------------
Summary of changes and diff:
plugins/content/README | 1 +
plugins/content/code/content.sub | 2 ++
plugins/content/code/form_content_edit_save.sub | 23 +++++++++++++++--------
plugins/content/plugin.cfg | 5 +++++
4 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/plugins/content/README b/plugins/content/README
index 9e88451..21a368c 100644
--- a/plugins/content/README
+++ b/plugins/content/README
@@ -3,6 +3,7 @@ Permissions:
create_content
edit_content
edit_own_content
+view_content
FCK editor:
diff --git a/plugins/content/code/content.sub b/plugins/content/code/content.sub
index 9a64c74..3836416 100644
--- a/plugins/content/code/content.sub
+++ b/plugins/content/code/content.sub
@@ -14,6 +14,8 @@ sub {
}
$CGI->{mv_nextpage} = $url;
+ } elsif ($Variable->{CONTENT_OVERVIEW_TYPE} eq 'panel') {
+ $CGI->{mv_nextpage} = 'content/list';
} else {
$CGI->{mv_nextpage} = 'content/recent';
}
diff --git a/plugins/content/code/form_content_edit_save.sub b/plugins/content/code/form_content_edit_save.sub
index d24e928..73e1e83 100644
--- a/plugins/content/code/form_content_edit_save.sub
+++ b/plugins/content/code/form_content_edit_save.sub
@@ -1,7 +1,18 @@
Sub form_content_edit_save <<EOS
sub {
# create new content
- my (%content, $code);
+ my (%content, $code, $page);
+
+ if ($CGI->{preview}) {
+ 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'});
@@ -17,10 +28,6 @@ sub {
$content{uid} = $Db{content}->field($CGI->{code}, 'uid');
- unless ($content{uid}) {
- return;
- }
-
@edit_perms = 'edit_content';
if ($content{uid} == $Session->{username}) {
@@ -30,20 +37,20 @@ sub {
unless ($Tag->acl('check', \@edit_perms)) {
$Tag->error({name => 'content',
set => 'No permission to edit content'});
- return {page => 'content/recent'};
+ return {page => $page};
}
}
else {
unless ($Tag->acl('check', 'create_content')) {
$Tag->error({name => 'content',
set => 'No permission to create content'});
- return {page => 'content/recent'};
+ return {page => $page};
}
$content{created} = $Tag->time({format => '%s'});
}
$code = $Db{content}->set_slice($CGI->{code}, %content);
- return {code => $code, page => 'content/recent'};
+ return {code => $code, page => $page};
}
EOS
diff --git a/plugins/content/plugin.cfg b/plugins/content/plugin.cfg
index ca9cf1c..73a6b9b 100644
--- a/plugins/content/plugin.cfg
+++ b/plugins/content/plugin.cfg
@@ -13,4 +13,9 @@ endif
Variable CONTENT_ANON_NAME Anonymous user
Variable CONTENT_DISPLAY_NAME {FIRST_NAME} {LAST_NAME}
+# Overview type, valid values are 'blog' and 'panel'
+ifndef CONTENT_OVERVIEW_TYPE
+Variable CONTENT_OVERVIEW_TYPE blog
+endif
+
ActionMap content content
\ No newline at end of file
hooks/post-receive
--
Interchange wellwell catalog
More information about the wellwell-devel
mailing list