Index: openacs-4/packages/xowiki/tcl/chat-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/chat-procs.tcl,v diff -u -N -r1.27 -r1.28 --- openacs-4/packages/xowiki/tcl/chat-procs.tcl 17 May 2018 07:35:52 -0000 1.27 +++ openacs-4/packages/xowiki/tcl/chat-procs.tcl 11 Jun 2018 18:47:26 -0000 1.28 @@ -11,7 +11,7 @@ # Chat instproc render {} { # :orderby time # set result "" - # foreach child [:children] { + # foreach child [:children] { # set msg [$child msg] # set user_id [$child user_id] # set timelong [clock format [$child time]] @@ -47,7 +47,7 @@ } elseif {[string index $path end] ne "/"} { append path / } - + if {$mode eq ""} { # # The parameter "mode" was not specified, we try to guess the @@ -56,10 +56,10 @@ # The most conservative mode is # - "polling" (which requires for every connected client polling # requests), followed by - # - "scripted-streaming" (which opens and "infinitely long" HTML - # files with embedded script tags; very portable, but this + # - "scripted-streaming" (which opens and "infinitely long" HTML + # files with embedded script tags; very portable, but this # causes the loading indicator to spin), followed by - # - "streaming" (true streaming, but this requires + # - "streaming" (true streaming, but this requires # an HTTP stack supporting partial reads). # # NOTICE 1: The guessing is based on current versions of the @@ -87,7 +87,7 @@ set mode scripted-streaming if {![regexp msie|opera [string tolower [ns_set get [ns_conn headers] User-Agent]]]} { # Explorer doesn't expose partial response until request state != 4, while Opera fires - # onreadystateevent only once. For this reason, for every browser except them, we could + # onreadystateevent only once. For this reason, for every browser except them, we could # use the nice mode without the spinning load indicator. # set mode streaming @@ -148,8 +148,8 @@ -id "messages-form" \ -event "submit" \ -script [subst { - chatSendMsg(\"$send_url\",chatReceiver); - }] + chatSendMsg(\"$send_url\",chatReceiver); + }] return "\
-
Index: openacs-4/packages/xowiki/tcl/form-field-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/form-field-procs.tcl,v diff -u -N -r1.273 -r1.274 --- openacs-4/packages/xowiki/tcl/form-field-procs.tcl 20 May 2018 11:01:57 -0000 1.273 +++ openacs-4/packages/xowiki/tcl/form-field-procs.tcl 11 Jun 2018 18:47:26 -0000 1.274 @@ -919,8 +919,8 @@ # is not in a published state. # if {[$package_id get_parameter production_mode 0]} { - $file_object publish_status "production" - } + $file_object publish_status "production" + } $file_object save_new {*}$save_flag } return $file_object @@ -1384,9 +1384,9 @@ } number instproc render_input {} { set boolean_atts [:booleanAttributes required readonly disabled \ - formnovalidate autofocus] + formnovalidate autofocus] ::html::input [:get_attributes type id name value {CSSclass class} \ - min max step autocomplete placeholder {*}$boolean_atts] {} + min max step autocomplete placeholder {*}$boolean_atts] {} :resetBooleanAttributes $boolean_atts } @@ -1730,7 +1730,7 @@ #ns_log notice "==== ${:name} EDITOR specified? [info exists :editor]" if {![info exists :editor]} { set :editor [parameter::get_global_value -package_key xowiki \ - -parameter PreferredRichtextEditor -default ckeditor4] + -parameter PreferredRichtextEditor -default ckeditor4] #:msg "setting default of ${:name} to ${:editor}" } if {![info exists :__initialized]} { @@ -2100,7 +2100,7 @@ try { # # Try to use the ckeditor from the richtext-ckeditor4 - # installation. + # installation. # ::richtext::ckeditor4::add_editor \ -order 90 \ @@ -2119,11 +2119,11 @@ security::csp::require script-src cdn.ckeditor.com security::csp::require style-src cdn.ckeditor.com security::csp::require img-src cdn.ckeditor.com - + template::head::add_javascript -order 90 -src "//cdn.ckeditor.com/4.8.0/standard-all/ckeditor.js" template::head::add_javascript -order 90.1 -src "//cdn.ckeditor.com/4.8.0/standard-all/adapters/jquery.js" } - + # # In contrary to the documentation, ckeditor4 names instances # after the id, not the name. @@ -2641,7 +2641,7 @@ if {![:horizontal]} { html::br } - + #::html::input $atts {} #::html::label -for $id {html::t "$label "} #if {![:horizontal]} {html::br} 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 -N -r1.224 -r1.225 --- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 20 May 2018 11:01:57 -0000 1.224 +++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 11 Jun 2018 18:47:26 -0000 1.225 @@ -5,20 +5,21 @@ @author Gustaf Neumann @cvs-id $Id$ } + namespace eval ::xowiki::includelet { # # Define a meta-class for creating Includelet classes. # We use a meta-class for making it easier to define properties # on classes of includelets, which can be used without instantiating - # it. One can for example use the query from the page fragment + # it. One can for example use the query from the page fragment # cache the caching properties of the class. # Class create ::xowiki::IncludeletClass \ -superclass ::xotcl::Class \ -parameter { - {localized true} - {personalized true} - {cacheable false} + {localized true} + {personalized true} + {cacheable false} {aggregating false} } @@ -27,9 +28,9 @@ Class create ::xowiki::Includelet \ -superclass ::xo::Context \ -parameter { - {name ""} - {title ""} - {__decoration "portlet"} + {name ""} + {title ""} + {__decoration "portlet"} {parameter_declaration {}} {id} } @@ -50,8 +51,8 @@ ::xo::Page requireJS "//yui.yahooapis.com/$version/build/$path" security::csp::require script-src yui.yahooapis.com } - } - + } + ::xowiki::Includelet proc describe_includelets {includelet_classes} { #:log "--plc=$includelet_classes " foreach cl $includelet_classes { @@ -98,7 +99,7 @@ ::xowiki::Includelet proc js_name {name} { return ID[string map [list : _ # _] $name] } - + ::xowiki::Includelet proc js_encode {string} { string map [list \n \\n \" {\"} ' {\'}] $string } @@ -111,12 +112,12 @@ ::xowiki::Includelet proc html_id {name} { - # Construct a valid HTML id or name. + # Construct a valid HTML id or name. # For details, see http://www.w3.org/TR/html4/types.html # # For XOTcl object names, strip first the colons set name [string trimleft $name :] - + # make sure, the ID starts with characters if {![regexp {^[A-Za-z]} $name]} { set name id_$name @@ -150,9 +151,9 @@ } ::xowiki::Includelet proc locale_clause { - -revisions - -items - package_id + -revisions + -items + package_id locale } { set default_locale [$package_id default_locale] @@ -165,19 +166,19 @@ } #:msg "--L with_system_locale=$with_system_locale, locale=$locale, default_locale=$default_locale" - set locale_clause "" + set locale_clause "" if {$locale ne ""} { - set locale_clause " and $revisions.nls_language = '$locale'" + set locale_clause " and $revisions.nls_language = '$locale'" if {$with_system_locale} { set system_locale [lang::system::locale -package_id $package_id] #:msg "system_locale=$system_locale, default_locale=$default_locale" if {$system_locale ne $default_locale} { - set locale_clause " and ($revisions.nls_language = '$locale' + set locale_clause " and ($revisions.nls_language = '$locale' or $revisions.nls_language = '$system_locale' and not exists - (select 1 from cr_items i where i.name = '[string range $locale 0 1]:' || + (select 1 from cr_items i where i.name = '[string range $locale 0 1]:' || substring($items.name,4) and i.parent_id = $items.parent_id))" } - } + } } #:msg "--locale $locale, def=$default_locale sys=$system_locale, cl=$locale_clause locale_clause=$locale_clause" @@ -314,10 +315,10 @@ ::xowiki::Includelet instproc resolve_page_name {page_name} { return [${:__including_page} resolve_included_page_name $page_name] - } + } ::xowiki::Includelet instproc get_page_order {-source -ordered_pages -pages} { - # + # # first check, if we can load the page_order from the page # denoted by source # @@ -332,7 +333,7 @@ } } } - + # compute a list of ordered_pages from pages, if necessary if {[info exists ordered_pages]} { foreach {order page} $ordered_pages {set :page_order($page) $order} @@ -356,15 +357,15 @@ # It can be used to alter specified parameter from the user, # or to influence the rendering of a decoration (e.g. title etc.) } - + ::xowiki::Includelet instproc js_name {} { return [[self class] js_name [self]] } ::xowiki::Includelet instproc screen_name {user_id} { acs_user::get -user_id $user_id -array user return [expr {$user(screen_name) ne "" ? $user(screen_name) : $user(name)}] - } + } } namespace eval ::xowiki::includelet { @@ -384,7 +385,7 @@ namespace eval ::xowiki::includelet { ############################################################################# # Page Fragment Cache - # + # # The following mixin-class implements page fragment caching in the # xowiki-cache. Caching can be turned on for every # ::xowiki::IncludeletClass instance. @@ -398,7 +399,7 @@ Class create ::xowiki::includelet::page_fragment_cache -instproc render {} { set c [:info class] # - # Construct a key based on the class parameters and the + # Construct a key based on the class parameters and the # actual parameters # set key "PF-${:package_id}-" @@ -429,7 +430,7 @@ set data [next] if {$data ne ""} {ns_cache set xowiki_cache $key $data} } -} +} namespace eval ::xowiki::includelet { ############################################################################# # dotlrn style includelet decoration for includelets @@ -442,12 +443,12 @@ set id [expr {[info exists :id] ? "id='[:id]'" : ""}] set html [next] set localized_title [::xo::localize $title] - set link [expr {[string match "*:*" $name] ? - "[ns_quotehtml $localized_title]" : + set link [expr {[string match "*:*" $name] ? + "[ns_quotehtml $localized_title]" : $localized_title}] ::xo::render_localizer return [subst [[self class] set template]] - } -set template [expr {[apm_version_names_compare [ad_acs_version] 5.3.0] == 1 ? + } -set template [expr {[apm_version_names_compare [ad_acs_version] 5.3.0] == 1 ? {
$link
$html
@@ -464,8 +465,8 @@ set html [next] set localized_title [::xo::localize $title] set edit_button [:include [list edit-item-button -book_mode true]] - set link [expr {[string match "*:*" $name] ? - "[ns_quotehtml $localized_title]" : + set link [expr {[string match "*:*" $name] ? + "[ns_quotehtml $localized_title]" : $localized_title}] return [subst [[self class] set template]] } -set template {
@@ -506,7 +507,7 @@ if {[info exists variable] && [$page exists $variable]} { return [$page set $variable] - } + } if {[info exists form_variable] && [$page exists instance_attributes]} { set __ia [$page set instance_attributes] if {[dict exists $__ia $form_variable]} { @@ -518,7 +519,7 @@ } return "no such form_variable $form_variable defined in page [$page set name]" } - + ::xowiki::IncludeletClass create creation-date \ -superclass ::xowiki::Includelet \ -parameter { @@ -590,7 +591,7 @@ '&detail_link='+escape(d.location.href)+'&text='+escape(t),'_blank', 'scrollbars=yes,width=700,height=575,status=yes,resizable=yes,scrollbars=yes')); }] - + return "[ns_quotehtml $label]" } @@ -617,7 +618,7 @@ namespace eval ::xowiki::includelet { ############################################################################# # valid parameters for he categories includelet are - # tree_name: match pattern, if specified displays only the trees + # tree_name: match pattern, if specified displays only the trees # with matching names # no_tree_name: if specified, tree names are not displayed # open_page: name (e.g. en:iMacs) of the page to be opened initially @@ -678,7 +679,7 @@ } return "" } - + categories instproc category_tree_missing {{-name ""} -edit_html} { # todo i18n if {$name eq ""} { @@ -695,25 +696,25 @@ } return $html } - + categories instproc render {} { :get_parameters - + set content "" set folder_id [$package_id folder_id] set open_item_id [expr {$open_page ne "" ? [::xo::db::CrClass lookup -name $open_page -parent_id $folder_id] : 0}] - + lassign [::xowiki::Includelet locale_clause -revisions r -items ci $package_id $locale] \ locale locale_clause - + set trees [::xowiki::Category get_mapped_trees -object_id $package_id -locale $locale \ -names $tree_name \ -output {tree_id tree_name}] - + #:msg "[llength $trees] == 0 && $tree_name" if {[llength $trees] == 0 && $tree_name ne ""} { - # we have nothing left from mapped trees, maybe the tree_names are not mapped; + # we have nothing left from mapped trees, maybe the tree_names are not mapped; # try to get these foreach name $tree_name { #set tree_id [lindex [category_tree::get_id $tree_name $locale] 0] @@ -723,17 +724,17 @@ } } } - + set edit_html [:category_tree_edit_button -object_id $package_id -allow_edit $allow_edit] if {[llength $trees] == 0} { return [:category_tree_missing -name $tree_name -edit_html $edit_html] } - + if {![info exists :id]} {set :id [::xowiki::Includelet html_id [self]]} - + foreach tree $trees { lassign $tree tree_id my_tree_name ... - + set edit_html [:category_tree_edit_button -object_id $package_id \ -allow_edit $allow_edit -tree_id $tree_id] #append content "
$edit_html
\n" @@ -747,7 +748,7 @@ set pos 0 set cattree(0) [::xowiki::Tree new -volatile -orderby pos \ -id [:id]-$my_tree_name -name $my_tree_name] - + set category_infos [::xowiki::Category get_category_infos \ -locale $locale -tree_id $tree_id] foreach category_info $category_infos { @@ -760,19 +761,19 @@ set category($cid) $c lappend categories $cid } - + if {[llength $categories] == 0} { return $content } - + if {[info exists ordered_composite]} { set items [list] foreach c [$ordered_composite children] {lappend items [$c item_id]} - + # If we have no item, provide a dummy one to avoid sql error # later if {[llength $items]<1} {set items -4711} - + if {$count} { set sql "category_object_map c where c.object_id in ([join $items ,]) " @@ -786,7 +787,7 @@ set sql "category_object_map c, cr_items ci, cr_revisions r where c.object_id in ([join $items ,]) and c.object_id = ci.item_id - and r.revision_id = ci.live_revision + and r.revision_id = ci.live_revision and ci.publish_status <> 'production' " } @@ -799,7 +800,7 @@ and p.page_id = r.revision_id \ and ci.publish_status <> 'production'" } - + if {$except_category_ids ne ""} { append sql \ " and not exists (select * from category_object_map c2 \ @@ -821,7 +822,7 @@ } } append sql $locale_clause - + if {$count} { ::xo::dc foreach get_counts \ "select count(*) as nr,category_id from $sql group by category_id" { @@ -834,16 +835,16 @@ } else { lassign [split $order_items_by ,] orderby direction ;# e.g. "title,asc" set increasing [expr {$direction ne "desc"}] - set order_column ", p.page_order" - + set order_column ", p.page_order" + ::xo::dc foreach get_pages \ "select ci.item_id, ci.name, ci.parent_id, r.title, category_id $order_column from $sql" { if {$title eq ""} {set title $name} set itemobj [Object new] set prefix "" set suffix "" foreach var {name title prefix suffix page_order} {$itemobj set $var [set $var]} - $itemobj set href [::$package_id pretty_link -parent_id $parent_id $name] + $itemobj set href [::$package_id pretty_link -parent_id $parent_id $name] $cattree(0) add_item \ -category $category($category_id) \ -itemobj $itemobj \ @@ -865,10 +866,10 @@ # display recent entries by categories # -gustaf neumann # - # valid parameters from the include are + # valid parameters from the include are # tree_name: match pattern, if specified displays only the trees with matching names # max_entries: show given number of new entries - + ::xowiki::IncludeletClass create categories-recent \ -superclass ::xowiki::Includelet \ -cacheable true -personalized false -aggregating true \ @@ -897,10 +898,10 @@ categories-recent instproc include_head_entries {} { ::xowiki::Tree include_head_entries -renderer ${:style} } - + categories-recent instproc render {} { :get_parameters - + if {![info exists :id]} {set :id [::xowiki::Includelet html_id [self]]} set cattree [::xowiki::Tree new -volatile -id [:id]] @@ -909,7 +910,7 @@ set tree_ids [::xowiki::Category get_mapped_trees -object_id $package_id -locale $locale \ -names $tree_name -output tree_id] - + if {$tree_ids ne ""} { set tree_select_clause "and c.tree_id in ([join $tree_ids ,])" } else { @@ -938,7 +939,7 @@ if {$prefix ne ""} {set prefix "$prefix";$itemobj set encoded(prefix) 1} if {$suffix ne ""} {set suffix "$suffix";$itemobj set encoded(suffix) 1} foreach var {name title prefix suffix} {$itemobj set $var [set $var]} - $itemobj set href [::$package_id pretty_link -parent_id $parent_id $name] + $itemobj set href [::$package_id pretty_link -parent_id $parent_id $name] if {![info exists categories($category_id)]} { set categories($category_id) [::xowiki::TreeNode new \ @@ -956,9 +957,9 @@ namespace eval ::xowiki::includelet { ############################################################################# # - # display recent entries + # display recent entries # - + ::xowiki::IncludeletClass create recent \ -superclass ::xowiki::Includelet \ -parameter { @@ -970,7 +971,7 @@ {-pretty_age off} }} } - + recent instproc render {} { :get_parameters ::xo::Page requireCSS "/resources/acs-templating/lists.css" @@ -989,7 +990,7 @@ } if {[[:info parent] set show_heritage]} { AnchorField create inherited -label "" -CSSclass inherited - } + } AnchorField create title -label [::xowiki::Page::slot::title set pretty_name] if {[[:info parent] set allow_delete]} { AnchorField create delete -CSSclass delete-item-button -label "" -richtext 1 @@ -1003,7 +1004,7 @@ foreach entry [$listing children] { $entry instvar parent_id formatted_date page_id {title entry_title} {name entry_name} set entry_package_id [$entry set package_id] - + set page_link [$entry_package_id pretty_link -parent_id $parent_id $entry_name] switch -- $pretty_age { 1 {set age [::xowiki::utility pretty_age -timestamp [clock scan $formatted_date] -locale [:locale]]} @@ -1034,7 +1035,7 @@ if {$show_heritage} { if {$entry_package_id == ${:package_id}} { set href "" - set title "" + set title "" set alt "" set class "" set label "" @@ -1059,9 +1060,9 @@ namespace eval ::xowiki::includelet { ############################################################################# # - # display last visited entries + # display last visited entries # - + ::xowiki::IncludeletClass create last-visited \ -superclass ::xowiki::Includelet \ -parameter { @@ -1070,7 +1071,7 @@ {-max_entries:integer 20} }} } - + last-visited instproc render {} { :get_parameters ::xo::Page requireCSS "/resources/acs-templating/lists.css" @@ -1079,7 +1080,7 @@ -columns { AnchorField create title -label [::xowiki::Page::slot::title set pretty_name] } - + xo::dc foreach get_pages \ [::xo::dc select \ -vars "i.parent_id, r.title,i.name, to_char(time,'YYYY-MM-DD HH24:MI:SS') as visited_date" \ @@ -1092,7 +1093,7 @@ { t1 add \ -title $title \ - -title.href [$package_id pretty_link -parent_id $parent_id $name] + -title.href [$package_id pretty_link -parent_id $parent_id $name] } return [t1 asHTML] } @@ -1114,14 +1115,14 @@ {-interval} }} } - + most-popular instproc render {} { :get_parameters ::xo::Page requireCSS "/resources/acs-templating/lists.css" - + if {[info exists interval]} { - # - # If we have and interval, we cannot get report the number of visits + # + # If we have and interval, we cannot get report the number of visits # for that interval, since we have only the aggregated values in # the database. # @@ -1199,7 +1200,7 @@ :title [ [${:feed} channel] title] } } - + rss-client instproc render {} { :get_parameters if {[info commands [${:feed} channel]] eq ""} { @@ -1236,11 +1237,11 @@ {-max_entries:integer "15"} }} } - + most-frequent-visitors instproc render {} { :get_parameters ::xo::Page requireCSS "/resources/acs-templating/lists.css" - + TableWidget create t1 -volatile \ -columns { Field create user -label [_ xowiki.includelet-visitors] -html { align right } @@ -1270,10 +1271,10 @@ # Display unread items # # Currently moderately useful - # + # # TODO: display of unread *revisions* should be included optionally, one has to # consider what to do with auto-created stuff (put it into 'production' state?) - # + # ::xowiki::IncludeletClass create unread-items \ -superclass ::xowiki::Includelet \ @@ -1283,7 +1284,7 @@ {-max_entries:integer 20} }} } - + unread-items instproc render {} { :get_parameters ::xo::Page requireCSS "/resources/acs-templating/lists.css" @@ -1294,27 +1295,27 @@ } set user_id [::xo::cc user_id] set or_clause "or i.item_id in ( - select x.page_id - from xowiki_last_visited x, acs_objects o - where x.time < o.last_modified - and x.page_id = o.object_id + select x.page_id + from xowiki_last_visited x, acs_objects o + where x.time < o.last_modified + and x.page_id = o.object_id and x.package_id = :package_id and x.user_id = :user_id )" set or_clause "" - set folder_id [$package_id folder_id] + set folder_id [$package_id folder_id] ::xo::dc foreach unread-items \ [::xo::dc select \ -vars "a.title, i.name, i.parent_id" \ -from "xowiki_page p, cr_items i, acs_objects a " \ -where "(i.item_id not in ( - select x.page_id from xowiki_last_visited x + select x.page_id from xowiki_last_visited x where x.user_id = [::xo::cc user_id] and x.package_id = :package_id ) $or_clause ) - and i.live_revision = p.page_id + and i.live_revision = p.page_id and i.parent_id = :folder_id and i.publish_status <> 'production' and a.object_id = i.item_id" \ @@ -1323,7 +1324,7 @@ { t1 add \ -title $title \ - -title.href [$package_id pretty_link -parent_id $parent_id $name] + -title.href [$package_id pretty_link -parent_id $parent_id $name] } return [t1 asHTML] } @@ -1349,7 +1350,7 @@ {-page} }} } - + tags instproc render {} { :get_parameters ::xo::Page requireCSS "/resources/acs-templating/lists.css" @@ -1384,7 +1385,7 @@ lappend entries "[ns_quotehtml $tag] " #lappend entries "[ns_quotehtml $tag] " } - return [expr {[llength $entries] > 0 ? + return [expr {[llength $entries] > 0 ? "

[ns_quotehtml $label]

[join $entries {, }]
\n" : ""}] } @@ -1398,19 +1399,19 @@ }} id } - + my-tags instproc render {} { :get_parameters ::xo::Page requireJS urn:ad:js:get-http-object - + set p_link [${:__including_page} pretty_link] set return_url [::xo::cc url]?[::xo::cc actual_query] set weblog_page [$package_id get_parameter weblog_page weblog] set save_tag_link [$package_id make_link -link $p_link ${:__including_page} \ save-tags return_url] set popular_tags_link [$package_id make_link -link $p_link ${:__including_page} \ popular-tags] - + set :tags [lsort [::xowiki::Page get_tags -user_id [::xo::cc user_id] \ -item_id [${:__including_page} item_id] -package_id $package_id]] set entries [list] @@ -1445,7 +1446,7 @@ return $content } - + ::xowiki::IncludeletClass create my-categories \ -superclass ::xowiki::Includelet \ -parameter { @@ -1454,7 +1455,7 @@ {-summary 1} }} } - + my-categories instproc render {} { :get_parameters set content "" @@ -1503,10 +1504,10 @@ ::xowiki::IncludeletClass create my-general-comments \ -superclass ::xowiki::Includelet \ -parameter {{__decoration none}} - + my-general-comments instproc render {} { :get_parameters - set item_id [${:__including_page} item_id] + set item_id [${:__including_page} item_id] set gc_return_url [$package_id url] # # Even, if general_comments is turned on, don't offer the @@ -1528,7 +1529,7 @@ return "$gc_link" } } - + ::xowiki::IncludeletClass create digg \ -superclass ::xowiki::Includelet \ -parameter { @@ -1538,7 +1539,7 @@ {-url} }} } - + digg instproc render {} { :get_parameters set digg_link [export_vars -base "http://digg.com/submit" { @@ -1560,7 +1561,7 @@ {-url} }} } - + delicious instproc render {} { :get_parameters @@ -1590,7 +1591,7 @@ {-rssurl} }} } - + my-yahoo-publisher instproc render {} { :get_parameters @@ -1604,24 +1605,24 @@ # - # my-references lists the pages which are referring to the + # my-references lists the pages which are referring to the # including page # ::xowiki::IncludeletClass create my-references \ -superclass ::xowiki::Includelet \ -parameter {{__decoration none}} - + my-references instproc render {} { :get_parameters - set item_id [${:__including_page} item_id] + set item_id [${:__including_page} item_id] set refs [list] - # The same image might be linked both, as img or file on one page, + # The same image might be linked both, as img or file on one page, # so we need DISTINCT. xo::dc foreach -prepare integer get_references { SELECT DISTINCT page,ci.name,ci.parent_id,o.package_id as pid - from xowiki_references,cr_items ci,acs_objects o + from xowiki_references,cr_items ci,acs_objects o where reference = :item_id and ci.item_id = page and ci.item_id = o.object_id } { if {$pid eq ""} { @@ -1652,17 +1653,17 @@ } # - # my-refers lists the pages which are referred to by the + # my-refers lists the pages which are referred to by the # including page # ::xowiki::IncludeletClass create my-refers \ -superclass ::xowiki::Includelet \ -parameter {{__decoration none}} - + my-refers instproc render {} { :get_parameters - set item_id [${:__including_page} item_id] + set item_id [${:__including_page} item_id] set refs [list] ::xo::dc foreach get_refers "SELECT DISTINCT reference,ci.name,ci.parent_id,o.package_id as pid \ @@ -1722,8 +1723,8 @@ if {[::xo::cc user_id] == 0} { switch -- $show_anonymous { nothing {return ""} - all {set summary 0} - default {set summary 1} + all {set summary 0} + default {set summary 1} } } @@ -1739,7 +1740,7 @@ set select_users "user_id, to_char(max(time),'YYYY-MM-DD HH24:MI:SS') as max_time from xowiki_last_visited " } - # allow for caching prepared value. + # allow for caching prepared value. set since [::xo::dc interval $interval] set since_condition "time > TO_TIMESTAMP(:since,'YYYY-MM-DD HH24:MI:SS')" @@ -1769,7 +1770,7 @@ foreach value $values { lassign $value user_id time set seen($user_id) $time - + regexp {^([^.]+)[.]} $time _ time set pretty_time [util::age_pretty -timestamp_ansi $time \ -sysdate_ansi [clock_to_ansi [clock seconds]] \ @@ -1782,8 +1783,8 @@ } if {$output ne ""} {set output "$output
\n"} } - set users [expr {$count == 0 ? "No registered users" : - $count == 1 ? "1 registered user" : + set users [expr {$count == 0 ? "No registered users" : + $count == 1 ? "1 registered user" : "$count registered users"}] return "
[ns_quotehtml $users$what]$when
$output" } @@ -1835,7 +1836,7 @@ return "
    \n" } PageReorderSupport instproc page_reorder_item_id {-ID -prefix_js -page_order js_} { - :upvar $js_ js + :upvar $js_ js set key :__count($prefix_js) set p [incr $key] set id ${ID}_${prefix_js}_$p @@ -1853,7 +1854,7 @@ -parameter { {__decoration plain} {parameter_declaration { - {-style ""} + {-style ""} {-open_page ""} {-book_mode false} {-folder_mode false} @@ -2047,7 +2048,7 @@ //console.log('have href ' + href + ' c=' + c); var transaction = YAHOO.util.Connect.asyncRequest('GET', \ - href + '?template_file=view-page&return_url=' + href, + href + '?template_file=view-page&return_url=' + href, { success:function(o) { var bookpage = document.getElementById('book-page'); @@ -2109,7 +2110,7 @@ fadeOutAnim.onComplete.subscribe(doFadeIn); fadeOutAnim.animate(); - }, + }, failure:function(o) { // console.error(o); // alert('failure '); @@ -2122,11 +2123,11 @@ return false; }, - treeInit: function() { - [:js_name].tree = new YAHOO.widget.TreeView('[:id]'); + treeInit: function() { + [:js_name].tree = new YAHOO.widget.TreeView('[:id]'); [:js_name].tree.subscribe('clickEvent', function(oArgs) { var m = /href=\"(\[^\"\]+)\"/.exec(oArgs.node.html); - [:js_name].getPage( m\[1\], oArgs.node.index); + [:js_name].getPage( m\[1\], oArgs.node.index); }); [:js_name].tree.draw(); } @@ -2139,16 +2140,16 @@ toc instproc yui_non_ajax {} { return " - var [:js_name]; + var [:js_name]; YAHOO.util.Event.onDOMReady(function() { - [:js_name] = new YAHOO.widget.TreeView('[:id]'); - [:js_name].subscribe('clickEvent',function(oArgs) { + [:js_name] = new YAHOO.widget.TreeView('[:id]'); + [:js_name].subscribe('clickEvent',function(oArgs) { //console.info(oArgs); var m = /href=\"(\[^\"\]+)\"/.exec(oArgs.node.html); //console.info(m\[1\]); //window.location.href = m\[1\]; return false; - }); + }); [:js_name].render(); }); " @@ -2165,7 +2166,7 @@ set ajax 0 } set :ajax $ajax - + if {$ajax} { set :js [:yui_ajax] } else { @@ -2340,7 +2341,7 @@ } } } - + $pages orderby page_order return [:render_children $pages $menu_buttons] } @@ -2349,16 +2350,16 @@ set output "" foreach o [$pages children] { $o instvar page_order title page_id name title - set level [expr {[regsub {[.]} $page_order . page_order] + 1}] + 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 { + default { set content [$p render -with_footer false] set content [string map [list "\{\{" "\\\{\{"] $content] } @@ -2415,7 +2416,7 @@ Create Form from Content