Index: openacs-4/packages/lars-blogger/lars-blogger.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/lars-blogger.info,v diff -u -r1.39 -r1.40 --- openacs-4/packages/lars-blogger/lars-blogger.info 24 Feb 2005 13:33:21 -0000 1.39 +++ openacs-4/packages/lars-blogger/lars-blogger.info 5 Apr 2005 12:08:47 -0000 1.40 @@ -7,14 +7,14 @@ <initial-install-p>f</initial-install-p> <singleton-p>f</singleton-p> - <version name="2.1.1" url="http://openacs.org/repository/download/apm/lars-blogger-2.1.1.apm"> + <version name="2.2.0d2" url="http://openacs.org/repository/download/apm/lars-blogger-2.2.0d2.apm"> <owner url="mailto:lars@pinds.com">Lars Pind</owner> <summary>Individual or collaborative web logs.</summary> <release-date>2004-02-11</release-date> <vendor url="http://www.collaboraid.biz">Collaboraid</vendor> <description format="text/html">Weblog creation and management with notifications, RSS, trackpack, technorati, blogroll, pings, archives, draft and published entries, includable templates for presenting on other pages, and permissioning for multiple users.</description> - <provides url="lars-blogger" version="2.1.1"/> + <provides url="lars-blogger" version="2.2.0d2"/> <requires url="acs-datetime" version="4.0"/> <requires url="acs-tcl" version="5.0.1"/> <requires url="categories" version="1.0d4"/> @@ -30,8 +30,9 @@ <callback type="after-instantiate" proc="lars_blogger::install::package_instantiate"/> </callbacks> <parameters> - <parameter datatype="string" min_n_values="1" max_n_values="1" name="CategoryContainer" default="package_id" description="Should the category container for the weblog be -"subsite_id" or "package_id""/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="CategoryContainer" default="package_id" description="Should the category container for the weblog be "subsite_id" or "package_id""/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="OnlyManageOwnPostsP" default="0" description="If 1 only the original poster or an admin can edit thier posts"/> + <parameter datatype="string" min_n_values="1" max_n_values="1" name="ImmediatePublishP" default="0" description="If 1 then publishing will be immediate and there will be no drafts screen or unpublish etc."/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="DisplayUsersP" default="0" description="Should we display a list of bloggers on the index page."/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="EnableAutoDiscoveryAndPing" default="1" description="Enable auto-discovery and sending of trackback pings" section_name="Trackback"/> <parameter datatype="number" min_n_values="1" max_n_values="1" name="EnableCategoriesP" default="1" description="Should entries be categorized?"/> 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.22 -r1.23 --- openacs-4/packages/lars-blogger/www/blog.adp 26 Mar 2005 00:10:43 -0000 1.22 +++ openacs-4/packages/lars-blogger/www/blog.adp 5 Apr 2005 12:08:47 -0000 1.23 @@ -1,7 +1,7 @@ <link rel="stylesheet" type="text/css" href="@stylesheet_url@" /> <multiple name="blog"> - <include src="@entry_chunk@" &="blog" package_id="@package_id@" screen_name="@screen_name@" max_content_length="@max_content_length@"> + <include src="@entry_chunk@" &="blog" package_id="@package_id@" screen_name="@screen_name@" max_content_length="@max_content_length@" unpublish_p="@unpublish_p@" manageown_p="@manageown_p@" /> </multiple> <ul class="action-links"> Index: openacs-4/packages/lars-blogger/www/blog.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/blog.tcl,v diff -u -r1.25 -r1.26 --- openacs-4/packages/lars-blogger/www/blog.tcl 26 Feb 2005 17:52:22 -0000 1.25 +++ openacs-4/packages/lars-blogger/www/blog.tcl 5 Apr 2005 12:08:47 -0000 1.26 @@ -12,6 +12,8 @@ # max_content_length:integer,optional # create_p:boolean # display_template: +# unpublish_p +# manageown_p # If the caller specified a URL, then we gather the package_id from that URL if { [info exists url] } { @@ -28,6 +30,14 @@ set create_p [permission::permission_p -object_id $package_id -privilege create] } +if {![exists_and_not_null unpublish_p]} { + set unpublish_p 1 +} +if {![exists_and_not_null manageown_p]} { + set manageown_p [expr ![permission::permission_p -object_id $package_id -privilege admin]] +} + + if { ![info exists category_id] } { set blog_category_id {} } else { @@ -75,9 +85,9 @@ -package_id $package_id \ -parameter max_content_length \ -default 0] -} - +} + if { ![info exists type] } { set type "current" } @@ -136,12 +146,12 @@ } else { set num_entries [db_string num_entries_by_date {}] } - + if { $num_entries < $min_num_entries } { # Eliminate date clause, and set the limit to the minimum number of entries set date_clause {} set limit $min_num_entries - } + } } set arr_category_name() None Index: openacs-4/packages/lars-blogger/www/entry-chunk.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/entry-chunk.adp,v diff -u -r1.26 -r1.27 --- openacs-4/packages/lars-blogger/www/entry-chunk.adp 26 Mar 2005 00:10:43 -0000 1.26 +++ openacs-4/packages/lars-blogger/www/entry-chunk.adp 5 Apr 2005 12:08:47 -0000 1.27 @@ -51,15 +51,17 @@ <if @show_comments_p@ false> | <a href="@blog.permalink_url@" title="View comments on this entry">Comments (@blog.num_comments@)</a> </if> - <if @blog.write_p@ true> - | <a href="@blog.edit_url@">Edit</a> - <if @blog.draft_p@ true> - | <a href="@blog.publish_url@">Publish</a> + <if @manageown_p@ false or @blog.user_id@ eq @user_id@> + <if @blog.write_p@ true> + | <a href="@blog.edit_url@">Edit</a> + <if @blog.draft_p@ true> + | <a href="@blog.publish_url@">Publish</a> + </if> + <else> + <if @unpublish_p@ true>| <a href="@blog.revoke_url@">Unpublish</a></if> + </else> + | <a href="@blog.delete_url@">Delete</a> </if> - <else> - | <a href="@blog.revoke_url@">Unpublish</a> - </else> - | <a href="@blog.delete_url@">Delete</a> </if> </p> </div> Index: openacs-4/packages/lars-blogger/www/entry-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/entry-edit.tcl,v diff -u -r1.24 -r1.25 --- openacs-4/packages/lars-blogger/www/entry-edit.tcl 23 Feb 2005 15:28:57 -0000 1.24 +++ openacs-4/packages/lars-blogger/www/entry-edit.tcl 5 Apr 2005 12:08:47 -0000 1.25 @@ -105,12 +105,29 @@ {(<a href="javascript:setEntryDateToToday()">Set to now</a>)} } } - {draft_p:text(select) - {options {{"Draft" "t"} {"Publish" "f"}}} - {label "Post Status"} +} +set unpublish_p [expr ![parameter::get -parameter ImmediatePublishP -default 0]] + +if {$unpublish_p} { + ad_form -extend -name entry -form { + {draft_p:text(select) + {options {{"Draft" "t"} {"Publish" "f"}}} + {label "Post Status"} + } } -} \ +} else { + ad_form -extend -name entry -form { + {draft_p:text(hidden)} + } +} + +ad_form -extend -name entry \ -new_request { + if {$unpublish_p} { + set draft_p t + } else { + set draft_p f + } set entry_date $now_ansi set content [template::util::richtext::create $content {}] } \ Index: openacs-4/packages/lars-blogger/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/index.adp,v diff -u -r1.38 -r1.39 --- openacs-4/packages/lars-blogger/www/index.adp 26 Mar 2005 00:10:43 -0000 1.38 +++ openacs-4/packages/lars-blogger/www/index.adp 5 Apr 2005 12:08:47 -0000 1.39 @@ -38,7 +38,7 @@ <div id="lars_blogger_left"> <div class="lars_blogger_content_table"> - <include src="blog" type="@type@" archive_interval="@interval@" archive_date="@archive_date@" screen_name="@screen_name@" category_id="@category_id@" sw_category_id="@sw_category_id@" max_content_length="0"> + <include src="blog" type="@type@" archive_interval="@interval@" archive_date="@archive_date@" screen_name="@screen_name@" category_id="@category_id@" sw_category_id="@sw_category_id@" max_content_length="0" unpublish_p="@unpublish_p@" manageown_p="@manageown_p@"> </div> </div> @@ -74,7 +74,7 @@ <div class="action-links"> <ul> <li><a href="@package_url@entry-edit" title="Add an entry to this blog">Add @blog_name@ Item</a></li> - <li><a href="@package_url@drafts" title="View draft entries">Draft entries</a></li> + <if @unpublish_p@ true><li><a href="@package_url@drafts" title="View draft entries">Draft entries</a></li></if> <if @admin_p@ true> <li><a href="@package_url@admin/" title="Visit administration pages">Administer</a></li> </if> Index: openacs-4/packages/lars-blogger/www/index.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/index.tcl,v diff -u -r1.28 -r1.29 --- openacs-4/packages/lars-blogger/www/index.tcl 26 Mar 2005 00:10:43 -0000 1.28 +++ openacs-4/packages/lars-blogger/www/index.tcl 5 Apr 2005 12:08:47 -0000 1.29 @@ -61,10 +61,18 @@ set rsd_url "" if { [xmlrpc::enabled_p] } { set rsd_url "[ad_url]${package_url}rsd/" -} +} set stylesheet_url [lars_blog_stylesheet_url] +set unpublish_p [expr ![parameter::get -parameter ImmediatePublishP -default 0]] + +# We say manageown if manageown set and not admin on the package. +set manageown_p [parameter::get -parameter OnlyManageOwnPostsP -default 0] +if {$manageown_p} { + set manageown_p [expr ![permission::permission_p -object_id $package_id -privilege admin]] +} + # since ADP commands can't be evaluated in the <property> tags, we # create a separate ADP file for headerstuff. See Bart's post # http://openacs.org/forums/message-view?message_id=149849 Index: openacs-4/packages/lars-blogger/www/one-entry.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/one-entry.adp,v diff -u -r1.18 -r1.19 --- openacs-4/packages/lars-blogger/www/one-entry.adp 13 Jan 2005 13:58:22 -0000 1.18 +++ openacs-4/packages/lars-blogger/www/one-entry.adp 5 Apr 2005 12:08:47 -0000 1.19 @@ -7,5 +7,5 @@ <property name="displayed_object_id">@entry_id;noquote@</property> <div class="lars_blogger_body"> - <include src="entry-chunk" &="blog" screen_name="@screen_name@" perma_p="1" max_content_length="0"> + <include src="entry-chunk" &="blog" screen_name="@screen_name@" perma_p="1" max_content_length="0" manageown_p="@manageown_p@" unpublish_p="@unpublish_p@" /> </div> Index: openacs-4/packages/lars-blogger/www/one-entry.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lars-blogger/www/one-entry.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/lars-blogger/www/one-entry.tcl 17 May 2004 13:02:17 -0000 1.15 +++ openacs-4/packages/lars-blogger/www/one-entry.tcl 5 Apr 2005 12:08:47 -0000 1.16 @@ -13,6 +13,14 @@ set sw_category_multirow "__branimir__multirow__blog/$entry_id" +set unpublish_p [expr ![parameter::get -parameter ImmediatePublishP -default 0]] + +# We say manageown if manageown set and not admin on the package. +set manageown_p [parameter::get -parameter OnlyManageOwnPostsP -default 0] +if {$manageown_p} { + set manageown_p [expr ![permission::permission_p -object_id $package_id -privilege admin]] +} + template::multirow create $sw_category_multirow sw_category_id \ sw_category_name sw_category_url