Index: openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/Attic/xowiki-portlet-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 21 Dec 2006 11:55:30 -0000 1.5 +++ openacs-4/packages/xowiki/tcl/xowiki-portlet-procs.tcl 22 Dec 2006 11:57:53 -0000 1.6 @@ -5,11 +5,14 @@ -parameter {{name ""} {title ""} {__decoration "portlet"}} ::xowiki::Portlet instproc locale_clause {package_id locale} { + set default_locale [$package_id default_locale] + set system_locale "" + set with_system_locale [regexp {(.*)[+]system} $locale _ locale] if {$locale eq "default"} { - set locale [$package_id default_locale] + set locale $default_locale set include_system_locale 0 - } + } set locale_clause "" if {$locale ne ""} { @@ -21,11 +24,11 @@ or r.nls_language = '$system_locale' and not exists (select 1 from cr_items i where i.name = '[string range $locale 0 1]:' || substring(ci.name,4) and i.parent_id = ci.parent_id))" - } else - } else { - - } + } + } } + + #my log "--locale $locale, def=$default_locale sys=$system_locale, cl=$locale_clause" return [list $locale $locale_clause] } 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
" Index: openacs-4/packages/xowiki/www/oacs-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/Attic/oacs-view.adp,v diff -u -r1.10 -r1.11 --- openacs-4/packages/xowiki/www/oacs-view.adp 8 Dec 2006 10:13:54 -0000 1.10 +++ openacs-4/packages/xowiki/www/oacs-view.adp 22 Dec 2006 11:57:54 -0000 1.11 @@ -51,7 +51,9 @@ padding: 0px 6px 6px 0px; ">
- +
@content;noquote@
Index: openacs-4/packages/xowiki/www/portlets/include.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/portlets/Attic/include.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/xowiki/www/portlets/include.tcl 22 Dec 2006 11:57:54 -0000 1.1 @@ -0,0 +1,3 @@ +ns_log notice "--including_page= $__including_page, portlet=$portlet" +set content [$__including_page include_portlet $portlet] +template::set_file [file dir $__adp_stub]/plain-include