- You don't have permission to modify this entry. -" - ad_script_abort - } -} - ad_proc -public lars_blogger::entry::publish { {-entry_id:required} {-package_id ""} @@ -72,6 +57,35 @@ } +ad_proc -public lars_blogger::entry::draft { + {-entry_id:required} +} { + Mark a blog entry as drafted +} { + permission::require_write_permission -object_id $entry_id + db_dml delete { + update pinds_blog_entries + set draft_p = 't' + where entry_id = :entry_id + } + lars_blog_flush_cache +} + +ad_proc -public lars_blogger::entry::delete { + {-entry_id:required} +} { + Delete a blog entry +} { + permission::require_write_permission -object_id $entry_id + db_dml delete { + update pinds_blog_entries + set deleted_p = 't' + where entry_id = :entry_id + } + lars_blog_flush_cache +} + + ad_proc -public lars_blogger::entry::htmlify { -array:required } { @@ -170,4 +184,4 @@ upvar $multirow $multirow db_multirow $multirow get_comments "" -} \ No newline at end of file +} Index: openacs-4/packages/lars-blogger/www/blog.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/blog.adp,v diff -u -r1.14 -r1.15 --- openacs-4/packages/lars-blogger/www/blog.adp 29 Sep 2003 11:32:53 -0000 1.14 +++ openacs-4/packages/lars-blogger/www/blog.adp 16 Oct 2003 23:10:45 -0000 1.15 @@ -17,9 +17,9 @@
-
|
-
» Add entry
Index: openacs-4/packages/lars-blogger/www/drafts.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/drafts.tcl,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/lars-blogger/www/drafts.tcl 28 Aug 2003 09:41:55 -0000 1.2
+++ openacs-4/packages/lars-blogger/www/drafts.tcl 16 Oct 2003 23:10:45 -0000 1.3
@@ -6,22 +6,70 @@
set package_id [ad_conn package_id]
set user_id [ad_conn user_id]
-if { [ad_permission_p $package_id admin] } {
+set page_title "Draft Entries"
+
+set context [list $page_title]
+
+set elements [list]
+lappend elements edit {
+ label {}
+ sub_class narrow
+ display_template {
+
+ }
+ link_url_eval {[export_vars -base entry-edit { entry_id { return_url [ad_return_url] } }]}
+ link_html { title "Edit entry" }
+}
+lappend elements entry_date {
+ label "Date"
+ display_col entry_date_pretty
+}
+
+if { [permission::permission_p -object_id $package_id -privilege write] } {
set statement "all_draft_entries"
+ lappend elements creation_user {
+ label "Author"
+ display_template {@entries.first_names@ @entries.last_name@}
+ link_url_eval {[acs_community_member_url -user_id $creation_user]}
+ }
} else {
set statement "draft_entries"
}
-set page_title "Draft Entries"
+lappend elements content {
+ label "Entry"
+ link_url_eval {[export_vars -base one-entry { entry_id { return_url [ad_return_url] } }]}
+ link_html { title "Preview entry" }
+}
+lappend elements publish {
+ label {Publish}
+ sub_class narrow
+ display_template {
+ Publish
+ }
+ link_url_eval {[export_vars -base entry-publish { entry_id { return_url [ad_return_url] } }]}
+ link_html { title "Publish entry" }
+ html { align center }
+}
+lappend elements delete {
+ label {}
+ sub_class narrow
+ display_template {
+
+ }
+ link_url_eval {[export_vars -base entry-delete { entry_id { return_url [ad_return_url] } }]}
+ link_html { title "Delete entry" }
+}
-set context [list $page_title]
-db_multirow -extend { edit_url publish_url delete_url preview_url } draft_entries $statement {} {
- set return_url "[ad_conn url][ad_decode [ad_conn query] "" "" "?[ad_conn query]"]"
- set edit_url "[ad_conn package_url]entry-edit?[export_vars { entry_id return_url }]"
- set delete_url "[ad_conn package_url]entry-delete?[export_vars { entry_id return_url }]"
- set preview_url "[ad_conn package_url]one-entry?[export_vars { entry_id return_url }]"
- set publish_url "[ad_conn package_url]entry-publish?[export_vars { entry_id return_url }]"
+template::list::create \
+ -name entries \
+ -multirow entries \
+ -elements $elements
+
+db_multirow -extend { entry_date_pretty edit_url publish_url delete_url preview_url } entries $statement {} {
+ set entry_date_pretty [lc_time_fmt $entry_date_ansi "%q"]
+ set content [string_truncate -len 80 $content]
}
set entry_add_url "entry-edit"
Index: openacs-4/packages/lars-blogger/www/drafts.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/drafts.xql,v
diff -u -r1.2 -r1.3
--- openacs-4/packages/lars-blogger/www/drafts.xql 28 Aug 2003 09:41:55 -0000 1.2
+++ openacs-4/packages/lars-blogger/www/drafts.xql 16 Oct 2003 23:10:45 -0000 1.3
@@ -2,17 +2,46 @@
» Add entry
@@ -116,7 +116,7 @@
Install the package on your system, mount a new instance somewhere - on the site map, make sure you have write permission on the + on the site map, make sure you have create permission on the instance, and then visit the URL where you mounted it. Now you can add your first blog entry.
@@ -91,7 +91,7 @@ The package fully supports multiple instances. You can mount several instances in your site map, and they'll stay properly isolated from each other. Alternatively you can let multiple users post to one - instance by granting write permissions. Mounting Weblogger under, say, + instance by granting create permissions. Mounting Weblogger under, say, /blog, you will have /blog/user/screenname displaying the entries of one user and /blog displaying either a list of all bloggers (this is done by setting the parameter DisplayUsersP to 1) or all entries posted to the @@ -101,10 +101,19 @@Contents in your blog entries are assumed to be full-blooded ADP-ified HTML, so don't give people access to post a blog (i.e. grant - write permissions on the instance) unless you trust them. This also means + create permissions on the instance) unless you trust them. This also means that if you've added custom ADP tags, those are also available to you in your blog.
+@@ -168,6 +177,9 @@