Index: openacs-4/packages/xowiki/tcl/includelet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/includelet-procs.tcl,v diff -u -r1.132 -r1.133 --- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 4 Dec 2009 21:40:12 -0000 1.132 +++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 11 Dec 2009 14:01:15 -0000 1.133 @@ -3184,6 +3184,54 @@ } ############################################################################# + ::xowiki::IncludeletClass create form-stats \ + -superclass ::xowiki::Includelet \ + -parameter { + {__decoration plain} + {parameter_declaration { + {-form} + {-var _state} + {-orderby "value,desc"} + }} + } + + form-stats instproc render {} { + my get_parameters + + set form_item_ids [::xowiki::Weblog instantiate_forms -forms $form -package_id $package_id] + set items [::xowiki::FormPage get_form_entries \ + -base_item_ids $form_item_ids -form_fields "" \ + -always_queried_attributes "*" \ + -publish_status ready -package_id $package_id] + + foreach i [$items children] { + set value "" + if {[string match _* $var]} { + set varname [string range $var 1 end] + if {[$i exists $varname]} {set value [$i set $varname]} + } else { + array set __ia [$i set instance_attributes] + set varname __ia($var) + if {[my exists $varname]} {set value [my set $varname]} + } + if {[info exists count($value)]} {incr count($value)} else {set count($value) 1} + } + + TableWidget t1 -volatile \ + -columns { + Field name -orderby name -label name + Field value -orderby value -label value + } + + foreach {att order} [split $orderby ,] break + t1 orderby -order [expr {$order eq "asc" ? "increasing" : "decreasing"}] $att + foreach {name value} [array get count] { + t1 add -name $name -value $value + } + return [t1 asHTML] + } + + ############################################################################# ::xowiki::IncludeletClass create form-usages \ -superclass ::xowiki::Includelet \ -parameter { @@ -3751,4 +3799,56 @@ return [[my set __including_page] include [list [$random_item name] -decoration none]] } } -} \ No newline at end of file +} + +namespace eval ::xowiki::includelet { + ############################################################################# + # flowplayer + # + # Get flowplayer from + # http://flowplayer.org/download/index.html + # Get pseudostreaming plugin from + # http://flowplayer.org/plugins/streaming/pseudostreaming.html#download + # + # install bowth under packages/xowiki/www/resources/flowplayer + # + ::xowiki::IncludeletClass create flowplayer \ + -superclass ::xowiki::Includelet \ + -parameter { + {__decoration none} + {parameter_declaration { + -mp4:required + }} + } + + flowplayer instproc include_head_entries {} { + ::xo::Page requireJS "/resources/xowiki/flowplayer/example/flowplayer-3.1.4.min.js" + } + + flowplayer instproc render {} { + my get_parameters + return " + " + } +}