Index: openacs-4/packages/s5/tcl/s5-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/s5/tcl/s5-procs.tcl,v diff -u -N -r1.5 -r1.6 --- openacs-4/packages/s5/tcl/s5-procs.tcl 9 Dec 2007 20:08:32 -0000 1.5 +++ openacs-4/packages/s5/tcl/s5-procs.tcl 28 Jan 2008 13:01:00 -0000 1.6 @@ -45,8 +45,9 @@ {parameter_declaration { {-category_id} {-slideshow:boolean false} + {-pagenr 0} {-style standard} - {-menu_buttons "edit-item-button create-item-button delete-item-button"} + {-menu_buttons "edit copy create delete"} }} } @@ -75,7 +76,7 @@ $pages mixin add ::xo::OrderedComposite::IndexCompare $pages orderby page_order if {$slideshow} { - return [my render_slideshow $pages $cnames] + return [my render_slideshow $pages $cnames $pagenr] } else { return [my render_overview $pages $cnames $menu_buttons] } @@ -94,7 +95,6 @@ - @@ -109,6 +109,15 @@ img#me04 {top: 44px;} img#me05 {top: 43px;left: 36px;} + + + + @@ -128,10 +137,14 @@ }] } - s5 instproc render_slideshow {pages cnames} { + s5 instproc render_slideshow {pages cnames pagenr} { my instvar package_id style page ::xo::cc set_parameter master 0 + set output { + + } + set output [my slideshow_header \ -title [$page set title] \ -creator [$page set creator] \ @@ -141,6 +154,7 @@ if {$cnames ne ""} { #append output "
Filtered by categories: $cnames
" } + set count 0 foreach o [$pages children] { $o instvar page_order title page_id name title set level [expr {[regsub {[.]} $page_order . page_order] + 1}] @@ -149,11 +163,21 @@ #$p set render_adp 0 set content [$p get_content] set content [string map [list "\{\{" "\\\{\{"] $content] - append output "
" \ + set evenodd [expr {[incr count]%2 ? "even" : "odd"}] + append output "
" \

$title

\n \ $content \
\n } + # use YAHOO event management to allow multiple event listener, and ensure, this ones is after s5's + append output "\n" + return $output } @@ -163,19 +187,27 @@ if {$cnames ne ""} { append output "
Filtered by categories: $cnames
" } - set return_url [::xo::cc url] + #set return_url [::xo::cc url] + + set count -1 foreach o [$pages children] { $o instvar page_order title page_id name title + incr count + set level [expr {[regsub {[.]} $page_order . page_order] + 1}] set p [::xo::db::CrClass get_instance_from_db -item_id 0 -revision_id $page_id] $p destroy_on_cleanup set menu [list] foreach b $menu_buttons { - set html [$p include $b] - if {$html ne ""} {lappend menu $html} + if {[info command ::xowiki::includelet::$b] eq ""} { + set b $b-item-button + } + set html [$p include "$b -book_mode true"] + if {$html ne ""} {lappend menu $html} } + set pagenr_link "presentation?slideshow=1&pagenr=$count'" set menu "
[join $menu { }]
" $p set unresolved_references 0 #$p set render_adp 0 @@ -185,9 +217,36 @@ regexp {^.*:([^:]+)$} $name _ anchor append output "" \ $menu \ - "$page_order $title" \ + "$page_order $title" \ $content } return $output } } + + +namespace eval ::xowiki::includelet { + # + # vertical spacer + # + ::xowiki::IncludeletClass create vspace \ + -superclass ::xowiki::Includelet \ + -parameter { + {__decoration none} + {parameter_declaration { + {-height ""} + {-width ""} + }} + } + + vspace instproc render {} { + my get_parameters + if {$height ne ""} { + set height "height: $height;" + } + if {$width ne ""} { + set width "width: $width;" + } + return "
\n" + } +}