Index: openacs-4/packages/xowiki/tcl/xowiki-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/xowiki-procs.tcl,v diff -u -r1.61 -r1.62 --- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 10 Dec 2006 16:56:52 -0000 1.61 +++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 22 Dec 2006 11:57:53 -0000 1.62 @@ -562,6 +562,49 @@ "\[$cmd\]"] } + Page instproc include_portlet {arg} { + my instvar package_id + # do we have a wellformed list? + if {[catch {set page_name [lindex $arg 0]} errMsg]} { + #my log "--S arg='$arg'" + # there is something syntactically wrong + return "$Error in '{{$arg}}' in [my set name]
\n\ + Syntax: <name of portlet> {<argument list>}
\n + Invalid argument list: '$arg'; must be attribute value pairs (attribues with dashes)" + } + + # the include is either a portlet class, or a wiki page + if {[my isclass ::xowiki::portlet::$page_name]} { + # direct call, without page, not tailorable + set page [::xowiki::portlet::$page_name new \ + -package_id $package_id \ + -name $page_name \ + -actual_query [::xo::cc actual_query]] + } else { + # we include a wiki page, tailorable + set page [$package_id resolve_page $page_name __m] + catch {$page set __decoration portlet} + } + if {$page ne ""} { + $page destroy_on_cleanup + $page set __including_page [self] + $page set __caller_parameters [lrange $arg 1 end] + #$page set __decoration portlet + foreach {att value} [$page set __caller_parameters] { + switch -- $att { + -decoration {$page set __decoration $value} + -title {$page set title $value} + } + } + if {[$page exists __decoration] && [$page set __decoration] ne "plain"} { + $page mixin add ::xowiki::portlet::decoration=[$page set __decoration] + } + return [$page render] + } else { + return "$page_name unknown
\n" + } + } + Page instproc include {ch arg} { [self class] instvar recursion_depth if {[regexp {^adp (.*)$} $arg _ adp]} { @@ -591,52 +634,15 @@ return $ch$page } else { - my instvar package_id # we have a direct (adp-less include) # Some browsers change {{cmd -flag "..."}} into {{cmd -flag "..."}} # We have to change this back regsub -all {([^\\])"} $arg "\\1\"" arg - - # do we have a wellformed list? - if {[catch {set page_name [lindex $arg 0]} errMsg]} { - #my log "--S arg='$arg'" - # there is something syntactically wrong - return "${ch}Error in '{{$arg}}' in [my set name]
\n\ - Syntax: <name of portlet> {<argument list>}
\n - Invalid argument list: '$arg'; must be attribute value pairs (attribues with dashes)" - } - # the include is either a portlet class, or a wiki page - if {[my isclass ::xowiki::portlet::$page_name]} { - # direct call, without page, not tailorable - set page [::xowiki::portlet::$page_name new \ - -package_id $package_id \ - -name $page_name \ - -actual_query [::xo::cc actual_query]] - } else { - # we include a wiki page, tailorable - set page [$package_id resolve_page $page_name __m] - catch {$page set __decoration portlet} - } - if {$page ne ""} { - $page destroy_on_cleanup - $page set __including_page [self] - $page set __caller_parameters [lrange $arg 1 end] - #$page set __decoration portlet - foreach {att value} [$page set __caller_parameters] { - switch -- $att { - -decoration {$page set __decoration $value} - -title {$page set title $value} - } - } - if {[$page exists __decoration] && [$page set __decoration] ne "plain"} { - $page mixin add ::xowiki::portlet::decoration=[$page set __decoration] - } - return $ch[$page render] - } else { - return "${ch} $page_name unknown
\n" - } + set html [my include_portlet $arg] + return ${ch}$html } } + Page instproc div {ch arg} { if {$arg eq "content"} { return "$ch
"