- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::includelet::recent
::xowiki::includelet::recent create ... \Display recent modified entries.
[ -parameter_declaration (default " {-max_entries:integer 10} {-allow_edit:boolean false} {-allow_delete:boolean false} {-pretty_age off} ") ] \
[ -title (default "#xowiki.recently_changed_pages#") ]
Defined in /var/www/openacs.org/packages/xowiki/tcl/includelet-procs.tcl
Class Relations
::xowiki::IncludeletClass create ::xowiki::includelet::recent \ -superclass ::xowiki::IncludeletMethods (to be applied on instances)
parameter_declaration (setter)
render (scripted)
: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]title (setter)
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables