- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables
Class ::xowiki::includelet::selection
::xowiki::includelet::selection create ... \Provide a selection of pages
[ -__decoration (default "plain") ] \
[ -parameter_declaration (default " {-edit_links:boolean true} {-pages ""} {-ordered_pages ""} {-source} {-publish_status ready} {-menu_buttons edit} {-range ""} ") ]
Defined in /var/www/openacs.org/packages/xowiki/tcl/includelet-procs.tcl
Class Relations
- class: ::xowiki::IncludeletClass
- superclass: ::xowiki::Includelet
- instmixin: ::xowiki::includelet::PageReorderSupport
- subclass: ::xowiki::includelet::composite-form
::xowiki::IncludeletClass create ::xowiki::includelet::selection \ -superclass ::xowiki::Includelet \ -instmixin ::xowiki::includelet::PageReorderSupportMethods (to be applied on instances)
__decoration (setter)
parameter_declaration (setter)
render (scripted)
:get_parameters set :package_id $package_id set :edit_links $edit_links if {[info exists source]} { :get_page_order -source $source } else { :get_page_order -pages $pages -ordered_pages $ordered_pages } set publish_status_clause [expr {[info exists publish_status] ? [::xowiki::Includelet publish_status_clause -base_table p $publish_status] : ""}] set pages [::xowiki::Page instantiate_objects -sql "select page_id, name, title, item_id from xowiki_page_live_revision p where parent_id = [ns_dbquotevalue [::$package_id folder_id]] and name in ([ns_dbquotelist [array names :page_order]]) $publish_status_clause [::xowiki::Page container_already_rendered item_id]" ] foreach p [$pages children] { $p set page_order $:page_order([$p set name]) } if {$range ne ""} { lassign [split $range -] from to foreach p [$pages children] { if {[$pages __value_compare [$p set page_order] $from 0] == -1 || [$pages __value_compare [$p set page_order] $to 0] > 0} { $pages delete $p } } } $pages orderby -type index page_order return [:render_children $pages $menu_buttons]render_children (scripted)
set output "" foreach o [$pages children] { $o instvar page_order title page_id name set level [expr {[regsub {[.]} $page_order . page_order] + 1}] set edit_markup "" set p [::xo::db::CrClass get_instance_from_db -item_id 0 -revision_id $page_id] $p references clear switch [$p info class] { ::xowiki::Form { set content [$p render] } default { set content [$p render -with_footer false] set content [string map [list "\{\{" "\\\{\{"] $content] } } set menu [list] foreach b $menu_buttons { if {[info commands ::xowiki::includelet::$b] eq ""} { set b $b-item-button } set html [$p include [list $b -book_mode true]] if {$html ne ""} {lappend menu $html} } set label "$page_order $title" append output "<h$level class='book'>" "<div style='float: right'>" [join $menu " "] "</div>" "<a name='[ns_quotehtml [toc anchor $name]]'></a>[ns_quotehtml $label]</h$level>" $content } return $output
- Methods: All Methods Documented Methods Hide Methods
- Source: Display Source Hide Source
- Variables: Show Variables Hide Variables