Index: openacs-4/packages/xowiki/www/portlets/recent.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/portlets/Attic/recent.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/packages/xowiki/www/portlets/recent.tcl 25 Feb 2006 13:36:24 -0000 1.3 +++ openacs-4/packages/xowiki/www/portlets/recent.tcl 3 May 2006 12:03:23 -0000 1.4 @@ -7,34 +7,39 @@ ::xowiki::Page requireCSS "/resources/acs-templating/lists.css" -if {![info exists max_entries]} {set max_entries 20} +::xowiki::Page proc __render_html { + -folder_id + -max_entries +} { + TableWidget t1 -volatile \ + -columns { + Field date -label "Modification Date" + AnchorField title -label [_ xowiki.page_title] + } -# get the folder id from the including page -set folder_id [$__including_page set parent_id] - -TableWidget t1 -volatile \ - -columns { - Field date -label "Modification Date" - AnchorField title -label [_ xowiki.page_title] - } - -set content "" -db_foreach get_pages \ - "select r.title, p.page_title, \ + db_foreach get_pages \ + "select i.name, r.title, \ to_char(r.publish_date,'YYYY-MM-DD HH24:MI:SS') as publish_date \ from cr_items i, cr_revisions r, xowiki_page p \ where i.parent_id = $folder_id \ and r.revision_id = i.live_revision \ and p.page_id = r.revision_id \ - order by r.publish_date desc limit $max_entries - " { - if {$page_title eq ""} {set page_title $title} + order by r.publish_date desc limit $max_entries\ + " { + if {$title eq ""} {set title $name} + + t1 add \ + -title $title \ + -title.href [::xowiki::Page pretty_link $name] \ + -date $publish_date + } - t1 add \ - -title $page_title \ - -title.href [::xowiki::Page pretty_link $title] \ - -date $publish_date - } + return [t1 asHTML] +} -set content [t1 asHTML] set link "" +set content [::xowiki::Page __render_html \ + -folder_id [$__including_page set parent_id] \ + -max_entries [expr {[info exists max_entries] ? $max_entries : 20}] \ + ] +