Class ::xowiki::includelet::recent (public)
::xowiki::IncludeletClass ::xowiki::includelet::recent
Defined in /var/www/openacs.org/packages/xowiki/tcl/includelet-procs.tcl
Display recent modified entries.
- Testcases:
- No testcase defined.
Source code: namespace eval ::xowiki::includelet {} ::nsf::object::alloc ::xowiki::IncludeletClass ::xowiki::includelet::recent {set :__default_metaclass ::xotcl::Class set :__default_superclass ::xotcl::Object set :aggregating false set :cacheable false set :localized true set :personalized true} ::xowiki::includelet::recent instproc render {} { :get_parameters ::xo::Page requireCSS "/resources/acs-templating/lists.css" set admin_p [::xo::cc permission -object_id $package_id -privilege admin -party_id [::xo::cc set untrusted_user_id]] set show_heritage $admin_p [:tableWidget] create t1 -volatile -set allow_edit $allow_edit -set allow_delete $allow_delete -set show_heritage $admin_p -columns { Field create date -label [_ xowiki.Page-last_modified] if {[[:info parent] set allow_edit]} { AnchorField create edit -CSSclass edit-item-button -label "" -richtext 1 } if {[[:info parent] set show_heritage]} { AnchorField create inherited -label "" -CSSclass inherited } AnchorField create title -label [::xowiki::Page::slot::title set pretty_name] if {[[:info parent] set allow_delete]} { AnchorField create delete -CSSclass delete-item-button -label "" -richtext 1 } } set listing [::xowiki::Includelet listing -package_id $package_id -page_number 1 -page_size $max_entries -orderby "publish_date desc"] foreach entry [$listing children] { $entry instvar parent_id formatted_date page_id {title entry_title} {name entry_name} set entry_package_id [$entry set package_id] set page_link [::$entry_package_id pretty_link -parent_id $parent_id $entry_name] switch -- $pretty_age { 1 {set age [::xowiki::utility pretty_age -timestamp [clock scan $formatted_date] -locale [:locale]]} 2 {set age [::xowiki::utility pretty_age -timestamp [clock scan $formatted_date] -locale [:locale] -levels 2]} default {set age $formatted_date} } t1 add -title $entry_title -title.href $page_link -date $age if {$allow_edit} { set p [::xo::db::CrClass get_instance_from_db -item_id 0 -revision_id $page_id] set edit_link [::$entry_package_id make_link -link $page_link $p edit return_url] #:log "page_link=$page_link, edit=$edit_link" [t1 last_child] set edit.href $edit_link [t1 last_child] set edit " " } if {$allow_delete} { if {![info exists p]} { set p [::xo::db::CrClass get_instance_from_db -item_id 0 -revision_id $page_id] } set delete_link [::$entry_package_id make_link -link $page_link $p delete return_url] [t1 last_child] set delete.href $delete_link [t1 last_child] set delete " " } if {$show_heritage} { if {$entry_package_id == ${:package_id}} { set href "" set title "" set alt "" set class "" set label "" } else { # provide a link to the original set href $page_link set label [::$entry_package_id instance_name] set title [_ xowiki.view_in_context [list context $label]] set alt $title set class "inherited" } [t1 last_child] set inherited $label [t1 last_child] set inherited.href $href [t1 last_child] set inherited.title $title [t1 last_child] set inherited.CSSclass $class } } return [t1 asHTML] } ::xowiki::includelet::recent instparametercmd title ::xowiki::includelet::recent instparametercmd parameter_declaration ::nsf::relation::set ::xowiki::includelet::recent superclass ::xowiki::Includelet ::nx::slotObj -container slot ::xowiki::includelet::recent ::xowiki::includelet::recent::slot eval {set :__parameter { {title "#xowiki.recently_changed_pages#"} {parameter_declaration { {-max_entries:integer 10} {-allow_edit:boolean false} {-allow_delete:boolean false} {-pretty_age off} }} }} ::nsf::object::alloc ::xotcl::Attribute ::xowiki::includelet::recent::slot::parameter_declaration {set :accessor public set :configurable true set :convert false set :default { {-max_entries:integer 10} {-allow_edit:boolean false} {-allow_delete:boolean false} {-pretty_age off} } set :defaultmethods {} set :disposition alias set :domain ::xowiki::includelet::recent set :incremental 0 set :manager ::xowiki::includelet::recent::slot::parameter_declaration set :methodname parameter_declaration set :multiplicity 1..1 set :name parameter_declaration set :parameterSpec {-parameter_declaration:substdefault { {-max_entries:integer 10} {-allow_edit:boolean false} {-allow_delete:boolean false} {-pretty_age off} }} set :per-object false set :position 0 set :required false set :substdefault 0b111 set :trace none : init} ::nsf::object::alloc ::xotcl::Attribute ::xowiki::includelet::recent::slot::title {set :accessor public set :configurable true set :convert false set :default #xowiki.recently_changed_pages# set :defaultmethods {} set :disposition alias set :domain ::xowiki::includelet::recent set :incremental 0 set :manager ::xowiki::includelet::recent::slot::title set :methodname title set :multiplicity 1..1 set :name title set :parameterSpec {-title:substdefault #xowiki.recently_changed_pages#} set :per-object false set :position 0 set :required false set :substdefault 0b111 set :trace none : init}XQL Not present: Generic, PostgreSQL, Oracle