Index: openacs-4/packages/xotcl-core/www/admin/toggle-debug.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xotcl-core/www/admin/toggle-debug.tcl,v
diff -u -r1.3 -r1.3.2.1
--- openacs-4/packages/xotcl-core/www/admin/toggle-debug.tcl 24 Dec 2017 12:28:07 -0000 1.3
+++ openacs-4/packages/xotcl-core/www/admin/toggle-debug.tcl 7 Feb 2020 08:44:05 -0000 1.3.2.1
@@ -1,67 +1,74 @@
ad_page_contract {
- ... purpose ...
- @author ...
- @creation-date ...
+ ... purpose ...
+ @author ...
+ @creation-date ...
} {
- {proc_spec ""}
- {return_url:localurl "."}
+ {proc_spec ""}
+ {return_url:localurl "."}
}
if {![acs_user::site_wide_admin_p]} {
- ad_complain [_ acs-admin.lt_You_dont_have_permiss]
+ ad_complain [_ acs-admin.lt_You_dont_have_permiss]
}
switch [llength $proc_spec] {
- 1 {}
- 3 {lassign $proc_spec obj methodType method; set scope ""}
- 4 {lassign $proc_spec scope obj methodType method}
- default {
- ad_log warning "toggle_debug: Unexpected format <$proc_spec> consists of [llength $proc_spec] parts"
- }
+ 1 {}
+ 3 {lassign $proc_spec obj methodType method; set scope ""}
+ 4 {lassign $proc_spec scope obj methodType method}
+ default {
+ ad_log warning "toggle_debug: Unexpected format <$proc_spec> consists of [llength $proc_spec] parts"
+ }
}
if {[info exists method]} {
- if {$methodType eq "proc"} {
- set modifier "-per-object"
- } elseif {$methodType eq "instproc"} {
- set modifier ""
- } else {
- ns_log warning "unexpected method type <$methodType>"
- set modifier ""
- }
- set debug_p [{*}$scope ::nsf::method::property $obj {*}$modifier $method debug]
- set cmd ""
-} else {
- #
- # In case the proc_spec is not fully qualified, prepend namespace qualifier
- #
- if {![string match ::* $proc_spec]} {set proc_spec ::$proc_spec}
-
- set definition [nsf::cmd::info definition $proc_spec]
- set method $proc_spec
+ if {$methodType eq "proc"} {
+ set modifier "-per-object"
+ } elseif {$methodType eq "instproc"} {
set modifier ""
- set scope ""
- set obj ::nx::Object
- set cmd ""
+ } else {
+ ns_log warning "unexpected method type <$methodType>"
+ set modifier ""
+ }
+ set debug_p [{*}$scope ::nsf::method::property $obj {*}$modifier $method debug]
+ set cmd ""
+} else {
+ #
+ # In case the proc_spec is not fully qualified, prepend namespace qualifier
+ #
+ if {![string match ::* $proc_spec]} {set proc_spec ::$proc_spec}
- #
- # If the proc is not a nsf::proc, build a nsf::proc on the fly
- #
- if {[lindex $definition 0] eq "::proc"} {
- set cmd [list ::nsf::proc -debug {*}[lrange $definition 1 end]]
- ns_log notice $cmd
- ns_eval [list ::nsf::proc -debug {*}[lrange $definition 1 end]]
- set debug_p 0
- } else {
- set debug_p [{*}$scope ::nsf::method::property $obj {*}$modifier $method debug]
- }
+ set definition [nsf::cmd::info definition $proc_spec]
+ set method $proc_spec
+ set modifier ""
+ set scope ""
+ set obj ::nx::Object
+ set cmd ""
+
+ #
+ # If the proc is not a nsf::proc, build a nsf::proc on the fly
+ #
+ if {[lindex $definition 0] eq "::proc"} {
+ set cmd [list ::nsf::proc -debug {*}[lrange $definition 1 end]]
+ ns_log notice $cmd
+ ns_eval [list ::nsf::proc -debug {*}[lrange $definition 1 end]]
+ set debug_p 0
+ } else {
+ set debug_p [{*}$scope ::nsf::method::property $obj {*}$modifier $method debug]
+ }
}
set cmd [list {*}$scope ::nsf::method::property $obj {*}$modifier $method debug [expr {!$debug_p}]]
ns_log notice "setting debug flag with cmd\n$cmd"
ad_try {
- ns_eval {*}$cmd
+ ns_eval {*}$cmd
} on error {errorMsg} {
- ns_log notice "toggle-debug raised error: $errorMsg"
+ ns_log notice "toggle-debug raised error: $errorMsg"
}
ns_log notice "calling return redirect to $return_url"
ad_returnredirect $return_url
+
+#
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 2
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/xowf/tcl/xowf-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowf/tcl/xowf-procs.tcl,v
diff -u -r1.28.2.23 -r1.28.2.24
--- openacs-4/packages/xowf/tcl/xowf-procs.tcl 25 Nov 2019 11:46:47 -0000 1.28.2.23
+++ openacs-4/packages/xowf/tcl/xowf-procs.tcl 7 Feb 2020 08:44:05 -0000 1.28.2.24
@@ -1330,6 +1330,7 @@
post-process form in edit mode to provide feedback in feedback mode
} {
# In feedback mode, we set the CSS class to correct or incorrect
+
if {[info exists :__feedback_mode]} {
unset :__feedback_mode
::xo::Page requireCSS /resources/xowf/feedback.css
Index: openacs-4/packages/xowiki/tcl/resource-init.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/resource-init.tcl,v
diff -u -r1.3.2.5 -r1.3.2.6
--- openacs-4/packages/xowiki/tcl/resource-init.tcl 20 Nov 2019 09:01:58 -0000 1.3.2.5
+++ openacs-4/packages/xowiki/tcl/resource-init.tcl 7 Feb 2020 08:44:05 -0000 1.3.2.6
@@ -22,20 +22,27 @@
#
set resDir $::acs::rootdir/packages/xowiki/www/resources
foreach variant {yui bootstrap3} {
- if {![file exists $resDir/xowiki-$variant.css]
- || [file mtime $resDir/xowiki-$variant.css] < [file mtime $resDir/xowiki.css]
- || [file mtime $resDir/xowiki-$variant.css] < [file mtime $resDir/xowiki-$variant-specific.css]
+ if {![file exists $resDir/xowiki-$variant.css]
+ || [file mtime $resDir/xowiki-$variant.css] < [file mtime $resDir/xowiki.css]
+ || [file mtime $resDir/xowiki-$variant.css] < [file mtime $resDir/xowiki-$variant-specific.css]
} {
- set content ""
- set F [open $resDir/xowiki.css]; append content [read $F] \n; close $F
- set F [open $resDir/xowiki-$variant-specific.css]; append content [read $F] \n; close $F
- set F [open $resDir/xowiki-$variant.css w]; puts -nonewline $F $content; close $F
- unset content
- }
+ set content ""
+ set F [open $resDir/xowiki.css]; append content [read $F] \n; close $F
+ set F [open $resDir/xowiki-$variant-specific.css]; append content [read $F] \n; close $F
+ set F [open $resDir/xowiki-$variant.css w]; puts -nonewline $F $content; close $F
+ unset content
+ }
}
template::register_urn -urn urn:ad:css:bootstrap3 -resource //maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css
template::register_urn -urn urn:ad:css:xowiki-yui -resource /resources/xowiki/xowiki-yui.css
template::register_urn -urn urn:ad:css:xowiki-bootstrap -resource /resources/xowiki/xowiki-bootstrap3.css
template::register_urn -urn urn:ad:css:bootstrap3-treeview \
-resource //cdnjs.cloudflare.com/ajax/libs/bootstrap-treeview/1.2.0/bootstrap-treeview.min.css
+
+#
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 2
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/xowiki/tcl/test/xowiki-link-test-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/test/xowiki-link-test-procs.tcl,v
diff -u -r1.1.2.4 -r1.1.2.5
--- openacs-4/packages/xowiki/tcl/test/xowiki-link-test-procs.tcl 25 Sep 2019 16:59:07 -0000 1.1.2.4
+++ openacs-4/packages/xowiki/tcl/test/xowiki-link-test-procs.tcl 7 Feb 2020 08:44:05 -0000 1.1.2.5
@@ -1,128 +1,135 @@
namespace eval ::xowiki::test {
- aa_register_case \
- -cats {smoke production_safe} \
- -procs {
- "::xowiki::Page instproc render"
- } \
- link_tests {
- Test links pointing to folders in different instances
- } {
- #
- # Set up of the test case.
- #
- set main_xowiki_instance_name /xowiki-test
- set linked_xowiki_instance_name /xowiki-test-linked
+ aa_register_case \
+ -cats {smoke production_safe} \
+ -procs {
+ "::xowiki::Page instproc render"
+ } \
+ link_tests {
+ Test links pointing to folders in different instances
+ } {
+ #
+ # Set up of the test case.
+ #
+ set main_xowiki_instance_name /xowiki-test
+ set linked_xowiki_instance_name /xowiki-test-linked
- set main_package_id [::acs::test::require_package_instance \
- -package_key xowiki \
- -empty \
- -instance_name $main_xowiki_instance_name]
- set linked_package_id [::acs::test::require_package_instance \
- -package_key xowiki \
- -empty \
- -instance_name $linked_xowiki_instance_name]
- aa_log main_package_id=$main_package_id
- aa_log linked_package_id=$linked_package_id
+ set main_package_id [::acs::test::require_package_instance \
+ -package_key xowiki \
+ -empty \
+ -instance_name $main_xowiki_instance_name]
+ set linked_package_id [::acs::test::require_package_instance \
+ -package_key xowiki \
+ -empty \
+ -instance_name $linked_xowiki_instance_name]
+ aa_log main_package_id=$main_package_id
+ aa_log linked_package_id=$linked_package_id
- foreach parameter {MenuBar MenuBarSymLinks} {
- #
- # Use directly the xo* interface to avoid surprises with
- # cached parameter values when creating new instances.
- #
- xo::parameter set_value -package_id $main_package_id -parameter $parameter -value 1
- xo::parameter set_value -package_id $linked_package_id -parameter $parameter -value 1
- }
+ foreach parameter {MenuBar MenuBarSymLinks} {
+ #
+ # Use directly the xo* interface to avoid surprises with
+ # cached parameter values when creating new instances.
+ #
+ xo::parameter set_value -package_id $main_package_id -parameter $parameter -value 1
+ xo::parameter set_value -package_id $linked_package_id -parameter $parameter -value 1
+ }
- set testfolder .testfolder
+ set testfolder .testfolder
- #
- # Force the system locale to en_US. We have to reset the
- # locale at the end of this run, since we have no
- # transaction.
- #
- #set defined_locale [lang::system::locale]
- #lang::system::set_locale en_US
+ #
+ # Force the system locale to en_US. We have to reset the
+ # locale at the end of this run, since we have no
+ # transaction.
+ #
+ #set defined_locale [lang::system::locale]
+ #lang::system::set_locale en_US
- set locale [lang::system::locale]
- set lang [string range $locale 0 1]
+ set locale [lang::system::locale]
+ set lang [string range $locale 0 1]
- ::xowiki::Package initialize -package_id $main_package_id
- ::xowiki::Package initialize -package_id $linked_package_id
+ ::xowiki::Package initialize -package_id $main_package_id
+ ::xowiki::Package initialize -package_id $linked_package_id
- set main_root_folder_id [::$main_package_id folder_id]
- set linked_root_folder_id [::$linked_package_id folder_id]
+ set main_root_folder_id [::$main_package_id folder_id]
+ set linked_root_folder_id [::$linked_package_id folder_id]
- set link_name link-to-folder-with-no-index-page
- set linked_folder_name folder-with-no-index-page
+ set link_name link-to-folder-with-no-index-page
+ set linked_folder_name folder-with-no-index-page
- set linked_folder_id [xowiki::test::require_folder $linked_folder_name \
- $linked_root_folder_id $linked_package_id]
- aa_true "linked_folder_id $linked_folder_id is valid " {$linked_folder_id ne "0"}
+ set linked_folder_id [xowiki::test::require_folder $linked_folder_name \
+ $linked_root_folder_id $linked_package_id]
+ aa_true "linked_folder_id $linked_folder_id is valid " {$linked_folder_id ne "0"}
- set link_id [xowiki::test::require_link $link_name $main_root_folder_id \
- $main_package_id /$linked_xowiki_instance_name/$linked_folder_name]
- aa_true "link_id $link_id is valid " {$link_id ne "0"}
+ set link_id [xowiki::test::require_link $link_name $main_root_folder_id \
+ $main_package_id /$linked_xowiki_instance_name/$linked_folder_name]
+ aa_true "link_id $link_id is valid " {$link_id ne "0"}
- set p1_id [xowiki::test::require_page en:p1 $linked_folder_id $linked_package_id]
- aa_true "link_id $p1_id is valid " {$p1_id ne "0"}
+ set p1_id [xowiki::test::require_page en:p1 $linked_folder_id $linked_package_id]
+ aa_true "link_id $p1_id is valid " {$p1_id ne "0"}
- ::xo::db::CrClass get_instance_from_db -item_id $link_id
- set link_content [::$link_id render_content]
- #ns_log notice $link_content
+ ::xo::db::CrClass get_instance_from_db -item_id $link_id
+ set link_content [::$link_id render_content]
+ #ns_log notice $link_content
- aa_section "Check links in rendered child-resources (default render_local)"
- #
- # Check, if
- # (a) the rendered link contains the page included in the linked folder and
- # (b) that the page link points to the target instance (no resolve_local provided)
- #
- acs::test::dom_html root $link_content {
- set node [$root selectNodes //td\[@class='list'\]/a\[@title='en:p1'\]]
- aa_true "one page found" {[llength $node] == 1}
- if {[llength $node] == 1} {
- set href [$node getAttribute href]
- aa_equals "href points to linked folder" $href \
- $linked_xowiki_instance_name/$linked_folder_name/p1
- }
- }
+ aa_section "Check links in rendered child-resources (default render_local)"
+ #
+ # Check, if
+ # (a) the rendered link contains the page included in the linked folder and
+ # (b) that the page link points to the target instance (no resolve_local provided)
+ #
+ acs::test::dom_html root $link_content {
+ set node [$root selectNodes //td\[@class='list'\]/a\[@title='en:p1'\]]
+ aa_true "one page found" {[llength $node] == 1}
+ if {[llength $node] == 1} {
+ set href [$node getAttribute href]
+ aa_equals "href points to linked folder" $href \
+ $linked_xowiki_instance_name/$linked_folder_name/p1
+ }
+ }
- aa_section "Check links in rendered child-resources (default render_local=true)"
+ aa_section "Check links in rendered child-resources (default render_local=true)"
- #
- # Now we test the behavior, if the link is defined with
- # "resolve_local=true". Since the defining is coming from
- # the site-wide-pages, and many of these values are
- # already loaded, we modify the loaded content. In
- # particular, the form-field responsible for rendering can
- # be looked up, and we can modify in this form-field the
- # instance variable "resolve_local" directly.
- #
- # This is by-passing the API, but little code. Caveat:
- # When form-field caching is modified, we might have to
- # change this code as well
+ #
+ # Now we test the behavior, if the link is defined with
+ # "resolve_local=true". Since the defining is coming from
+ # the site-wide-pages, and many of these values are
+ # already loaded, we modify the loaded content. In
+ # particular, the form-field responsible for rendering can
+ # be looked up, and we can modify in this form-field the
+ # instance variable "resolve_local" directly.
+ #
+ # This is by-passing the API, but little code. Caveat:
+ # When form-field caching is modified, we might have to
+ # change this code as well
- foreach f [::xowiki::formfield::FormField info instances -closure] {
- if {[$f name] eq "link"} {
- $f set resolve_local true
- }
- }
+ foreach f [::xowiki::formfield::FormField info instances -closure] {
+ if {[$f name] eq "link"} {
+ $f set resolve_local true
+ }
+ }
- acs::test::dom_html root [::$link_id render_content] {
- set node [$root selectNodes //td\[@class='list'\]/a\[@title='en:p1'\]]
- aa_true "one page found" {[llength $node] == 1}
- if {[llength $node] == 1} {
- set href [$node getAttribute href]
- aa_equals "href points to local folder" $href \
- $main_xowiki_instance_name/$link_name/p1
- }
- }
+ acs::test::dom_html root [::$link_id render_content] {
+ set node [$root selectNodes //td\[@class='list'\]/a\[@title='en:p1'\]]
+ aa_true "one page found" {[llength $node] == 1}
+ if {[llength $node] == 1} {
+ set href [$node getAttribute href]
+ aa_equals "href points to local folder" $href \
+ $main_xowiki_instance_name/$link_name/p1
+ }
+ }
- #
- # reset system locale to saved value
- #
- #lang::system::set_locale $defined_locale
- }
+ #
+ # reset system locale to saved value
+ #
+ #lang::system::set_locale $defined_locale
+ }
}
+
+#
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 2
+# indent-tabs-mode: nil
+# End:
Index: openacs-4/packages/xowiki/www/admin/export.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/export.tcl,v
diff -u -r1.24.2.2 -r1.24.2.3
--- openacs-4/packages/xowiki/www/admin/export.tcl 8 May 2019 19:59:57 -0000 1.24.2.2
+++ openacs-4/packages/xowiki/www/admin/export.tcl 7 Feb 2020 08:44:05 -0000 1.24.2.3
@@ -5,7 +5,7 @@
@creation-date Aug 11, 2006
@cvs-id $Id$
- @param object_type
+ @param object_type
} -parameter {
{-object_type ::xowiki::Page}
{-objects ""}
@@ -23,11 +23,11 @@
foreach o $objects {
::$package_id get_lang_and_name -default_lang [::xo::cc lang] -path $o lang stripped_name
set parent_id [::$package_id get_parent_and_name -lang $lang \
- -path $stripped_name -parent_id $folder_id \
- parent local_name]
+ -path $stripped_name -parent_id $folder_id \
+ parent local_name]
#ns_log notice "lookup of $o in $folder_id returns [::xo::db::CrClass lookup -name $o -parent_id $parent_id]"
if {[set item_id [::xo::db::CrClass lookup -name $local_name -parent_id $parent_id]] != 0} {
- set items($item_id) 1
+ set items($item_id) 1
}
}
}
Index: openacs-4/packages/xowiki/www/admin/list.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/list.tcl,v
diff -u -r1.38.2.2 -r1.38.2.3
--- openacs-4/packages/xowiki/www/admin/list.tcl 14 May 2019 15:25:45 -0000 1.38.2.2
+++ openacs-4/packages/xowiki/www/admin/list.tcl 7 Feb 2020 08:44:05 -0000 1.38.2.3
@@ -76,8 +76,8 @@
-alt permsissions -label "" -html {style "padding: 2px;"}
}
if {$::with_publish_status} {
- ImageAnchorField create publish_status -orderby publish_status.src -src "" \
- -width 8 -height 8 -title "Toggle Publish Status" \
+ ImageAnchorField create publish_status -orderby publish_status.src -src "" \
+ -width 8 -height 8 -title "Toggle Publish Status" \
-alt "publish status" -label [_ xowiki.publish_status] -html {style "padding: 2px;text-align: center;"}
}
Field create syndicated -label "RSS" -html {style "padding: 2px; text-align: center;"}
@@ -106,7 +106,7 @@
set folder_id [::$package_id folder_id]
foreach i [xo::dc list get_syndicated {
- select s.object_id from syndication s, cr_items ci
+ select s.object_id from syndication s, cr_items ci
where s.object_id = ci.live_revision and ci.parent_id = :folder_id
}] { set syndicated($i) 1 }
@@ -132,7 +132,7 @@
$name]
set name [::$package_id external_name -parent_id $parent_id $name]
- ::template::t1 add \
+ ::template::t1 add \
-name $name \
-title $title \
-object_type [string map [list "::xowiki::" ""] $object_type] \
@@ -146,27 +146,27 @@
-mod_user [::xo::get_user_name $creation_user] \
-delete "" \
-delete.href [export_vars -base [::$package_id package_url] {{delete 1} item_id name return_url}] \
- -delete.title #xowiki.delete#
+ -delete.title #xowiki.delete#
if {$::individual_permissions} {
[::template::t1 last_child] set permissions.href \
- [export_vars -base permissions {item_id return_url}]
+ [export_vars -base permissions {item_id return_url}]
}
if {$::with_publish_status} {
# TODO: this should get some architectural support
- if {$publish_status eq "ready"} {
- set image active.png
- set state "production"
- } else {
- set image inactive.png
- set state "ready"
- }
+ if {$publish_status eq "ready"} {
+ set image active.png
+ set state "production"
+ } else {
+ set image inactive.png
+ set state "ready"
+ }
[::template::t1 last_child] set publish_status.src /resources/xowiki/$image
- [::template::t1 last_child] set publish_status.href \
- [export_vars -base [::$package_id package_url]admin/set-publish-state \
- {state revision_id return_url}]
+ [::template::t1 last_child] set publish_status.href \
+ [export_vars -base [::$package_id package_url]admin/set-publish-state \
+ {state revision_id return_url}]
}
- [::template::t1 last_child] set page_order $page_order
+ [::template::t1 last_child] set page_order $page_order
}
Index: openacs-4/packages/xowiki/www/admin/portal-element-add.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/portal-element-add.tcl,v
diff -u -r1.17.2.2 -r1.17.2.3
--- openacs-4/packages/xowiki/www/admin/portal-element-add.tcl 9 Aug 2019 08:29:28 -0000 1.17.2.2
+++ openacs-4/packages/xowiki/www/admin/portal-element-add.tcl 7 Feb 2020 08:44:05 -0000 1.17.2.3
@@ -31,32 +31,32 @@
# for the time being, we add the portlet on the first page (page 0)
set portal_page_id [portal::get_page_id -portal_id $portal_id -sort_key 0]
-
+
if {[xo::dc get_value check_unique_name_on_page {
select 1 from portal_element_map
- where page_id = :portal_page_id
+ where page_id = :portal_page_id
and pretty_name = :page_title
} 0]} {
#
# The name of the portal element is not unique.
#
ad_return_error \
- [_ xowiki.portlet_title_exists_error_short] \
- [_ xowiki.portlet_title_exists_error_long $page_title]
+ [_ xowiki.portlet_title_exists_error_short] \
+ [_ xowiki.portlet_title_exists_error_long $page_title]
ad_script_abort
} else {
#
# everything ok, add the portal element
#
db_transaction {
set element_id [portal::add_element \
- -portal_id $portal_id \
- -portlet_name [xowiki_portlet name] \
- -pretty_name $page_title \
- -force_region [parameter::get_from_package_key \
- -parameter "xowiki_portal_content_force_region" \
- -package_key "xowiki-portlet"]
- ]
+ -portal_id $portal_id \
+ -portlet_name [xowiki_portlet name] \
+ -pretty_name $page_title \
+ -force_region [parameter::get_from_package_key \
+ -parameter "xowiki_portal_content_force_region" \
+ -package_key "xowiki-portlet"]
+ ]
portal::set_element_param $element_id package_id $package_id
# in case, someone wants language-specific includelets
#regexp {^..:(.*)$} $page_name _ page_name
Index: openacs-4/packages/xowiki/www/ckeditor-images/delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ckeditor-images/delete.tcl,v
diff -u -r1.5 -r1.5.2.1
--- openacs-4/packages/xowiki/www/ckeditor-images/delete.tcl 19 Jan 2018 13:48:24 -0000 1.5
+++ openacs-4/packages/xowiki/www/ckeditor-images/delete.tcl 7 Feb 2020 08:44:05 -0000 1.5.2.1
@@ -1,8 +1,8 @@
ad_page_contract {
-
+
} {
- parent_id:notnull,integer
- revision:notnull,integer
+ parent_id:notnull,integer
+ revision:notnull,integer
}
set item_id [content::revision::item_id -revision_id $revision]
Index: openacs-4/packages/xowiki/www/ckeditor-images/preview.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ckeditor-images/Attic/preview.tcl,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/xowiki/www/ckeditor-images/preview.tcl 7 Aug 2017 23:48:31 -0000 1.4
+++ openacs-4/packages/xowiki/www/ckeditor-images/preview.tcl 7 Feb 2020 08:44:05 -0000 1.4.2.1
@@ -1,8 +1,8 @@
ad_page_contract {
-
+
} {
- revision:notnull,integer
-}
+ revision:notnull,integer
+}
template::add_event_listener \
-id controls-link \
Index: openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.tcl,v
diff -u -r1.8 -r1.8.2.1
--- openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.tcl 18 Dec 2018 16:13:04 -0000 1.8
+++ openacs-4/packages/xowiki/www/ckeditor-images/thumb-view.tcl 7 Feb 2020 08:44:05 -0000 1.8.2.1
@@ -1,12 +1,12 @@
ad_page_contract {
-
+
} {
{parent_id:naturalnum ""}
} -validate {
parent_id_exists -requires {parent_id} {
- if {[xo::dc 0or1row object_exists "select item_id from cr_items where item_id = :parent_id"] == 0} {
- ad_complain "Specified item does not exist"
- }
+ if {[xo::dc 0or1row object_exists "select item_id from cr_items where item_id = :parent_id"] == 0} {
+ ad_complain "Specified item does not exist"
+ }
}
}
@@ -18,20 +18,20 @@
img_id
image_p
} sub_files get_children "
-select package_id,name,cr.title,cr.item_id,revision_id,mime_type, to_char(publish_date, 'yyyy-mm-dd, HH:MM') as date
+select package_id,name,cr.title,cr.item_id,revision_id,mime_type, to_char(publish_date, 'yyyy-mm-dd, HH:MM') as date
from cr_items ci inner join cr_revisions cr on (ci.item_id = cr.item_id)
join acs_objects o on o.object_id=cr.item_id
- where parent_id = :parent_id and revision_id = ci.live_revision
+ where parent_id = :parent_id and revision_id = ci.live_revision
AND cr.mime_type LIKE 'image/%'
- ORDER BY publish_date DESC" {
+ ORDER BY publish_date DESC" {
::xowiki::Package initialize -package_id $package_id
set item [::xowiki::File get_instance_from_db -item_id $item_id]
- set url [$item pretty_link]
+ set url [$item pretty_link]
set download_url [export_vars -base $url {{m download}}]
set delete_url [export_vars -base $url {{m delete} return_url}]
set img_id "preview-img-${revision_id}"
set image_p [expr {$mime_type in {"image/jpeg" "image/png" "image/gif"}}]
- }
+ }
set server_url ""
Index: openacs-4/packages/xowiki/www/ckeditor-images/upload_image.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ckeditor-images/upload_image.tcl,v
diff -u -r1.10.2.1 -r1.10.2.2
--- openacs-4/packages/xowiki/www/ckeditor-images/upload_image.tcl 14 Aug 2019 19:33:35 -0000 1.10.2.1
+++ openacs-4/packages/xowiki/www/ckeditor-images/upload_image.tcl 7 Feb 2020 08:44:05 -0000 1.10.2.2
@@ -15,7 +15,7 @@
-has_submit 1 \
-mode edit \
-form {
- {upload_file:file(file),optional {label #xowiki.choose_file#}}
+ {upload_file:file(file),optional {label #xowiki.choose_file#}}
} -on_submit {
#set width [template::element::get_values upload_form width]
#set height [template::element::get_values upload_form height]
@@ -33,7 +33,7 @@
if {![regexp (image/*|audio/mpeg|application/x-shockwave-flash|application/vnd.adobe.flash-movie|video/mp4) $mime_type]} {
#template::form::set_error "upload_image" "upload_file" "[_ tlf-resource-integrator.HTMLArea_SelectImageUploadNoImage]"
break
- }
+ }
set title $file_name
set existing_filenames [xo::dc list _ "select name from cr_items where parent_id = :parent_id" ]
Index: openacs-4/packages/xowiki/www/ckeditor-images/view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/ckeditor-images/Attic/view.tcl,v
diff -u -r1.4 -r1.4.2.1
--- openacs-4/packages/xowiki/www/ckeditor-images/view.tcl 7 Aug 2017 23:48:31 -0000 1.4
+++ openacs-4/packages/xowiki/www/ckeditor-images/view.tcl 7 Feb 2020 08:44:05 -0000 1.4.2.1
@@ -1,11 +1,11 @@
ad_page_contract {
-
+
} {
- revision:notnull,integer
-}
+ revision:notnull,integer
+}
-
cr_write_content -revision_id $revision
+
# Local variables:
# mode: tcl
# tcl-indent-level: 2
Index: openacs-4/packages/xowiki/www/xinha/attach-file.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/attach-file.tcl,v
diff -u -r1.6 -r1.6.2.1
--- openacs-4/packages/xowiki/www/xinha/attach-file.tcl 7 Aug 2017 23:48:31 -0000 1.6
+++ openacs-4/packages/xowiki/www/xinha/attach-file.tcl 7 Feb 2020 08:44:05 -0000 1.6.2.1
@@ -1,155 +1,155 @@
ad_page_contract {
- Simple image upload, attach image to object_id passed in, if no
- object_id, use the current package_id
- @author Guenter Ernst guenter.ernst@wu-wien.ac.at,
- @author Gustaf Neumann neumann@wu-wien.ac.at
- @author Dave Bauer (dave@solutiongrove.com)
- @creation-date 13.07.2004
- @cvs-id $Id$
+ Simple image upload, attach image to object_id passed in, if no
+ object_id, use the current package_id
+ @author Guenter Ernst guenter.ernst@wu-wien.ac.at,
+ @author Gustaf Neumann neumann@wu-wien.ac.at
+ @author Dave Bauer (dave@solutiongrove.com)
+ @creation-date 13.07.2004
+ @cvs-id $Id$
} {
- {parent_id:naturalnum,notnull}
- {selector_type "image"}
+ {parent_id:naturalnum,notnull}
+ {selector_type "image"}
}
set f_url ""
set user_id [ad_conn user_id]
-# if user has write permission, create image upload form,
+# if user has write permission, create image upload form,
if {[permission::permission_p -party_id $user_id -object_id $parent_id \
- -privilege "write"]} {
+ -privilege "write"]} {
- set write_p 1
+ set write_p 1
- # FIXME DAVEB i18n for share_options
- set share_options [list \
- [list "[_ acs-templating.Only_myself]" private] \
- [list "[_ acs-templating.This_Group]" group] \
- [list "[_ acs-templating.Anyone_on_this_system]" site] \
- [list "[_ acs-templating.Anyone_on_the_internet]" public]]
- ad_form \
- -name upload_form \
- -mode edit \
- -export {selector_type file_types parent_id} \
- -html { enctype multipart/form-data } \
- -form {
- item_id:key
- {upload_file:file(file)
- {html {size 30}}
- }
- {share:text(radio),optional
- {label "[_ acs-templating.This_image_can_be_reused_by]"}
- {options $share_options}
- {help_text "[_ acs-templating.This_image_can_be_reused_help]"}
- }
- {ok_btn:text(submit)
- {label "[_ acs-templating.HTMLArea_SelectUploadBtn]"}
- }
- } \
- -on_request {
- set share site
- } \
- -on_submit {
- # check file name
- if {$upload_file eq ""} {
- template::form::set_error upload_form upload_file \
- [_ acs-templating.HTMLArea_SpecifyUploadFilename]
- break
- }
+ # FIXME DAVEB i18n for share_options
+ set share_options [list \
+ [list "[_ acs-templating.Only_myself]" private] \
+ [list "[_ acs-templating.This_Group]" group] \
+ [list "[_ acs-templating.Anyone_on_this_system]" site] \
+ [list "[_ acs-templating.Anyone_on_the_internet]" public]]
+ ad_form \
+ -name upload_form \
+ -mode edit \
+ -export {selector_type file_types parent_id} \
+ -html { enctype multipart/form-data } \
+ -form {
+ item_id:key
+ {upload_file:file(file)
+ {html {size 30}}
+ }
+ {share:text(radio),optional
+ {label "[_ acs-templating.This_image_can_be_reused_by]"}
+ {options $share_options}
+ {help_text "[_ acs-templating.This_image_can_be_reused_help]"}
+ }
+ {ok_btn:text(submit)
+ {label "[_ acs-templating.HTMLArea_SelectUploadBtn]"}
+ }
+ } \
+ -on_request {
+ set share site
+ } \
+ -on_submit {
+ # check file name
+ if {$upload_file eq ""} {
+ template::form::set_error upload_form upload_file \
+ [_ acs-templating.HTMLArea_SpecifyUploadFilename]
+ break
+ }
- if {[info exists folder_size]} {
- # check per folder quota
- set maximum_folder_size [parameter::get -parameter "MaximumFolderSize"]
-
- if { $maximum_folder_size ne "" } {
- if { $folder_size+[file size ${upload_file.tmpfile}] > $maximum_folder_size } {
- template::form::set_error upload_form upload_file \
- [_ file-storage.out_of_space]
- break
- }
- }
- }
-
- set file_name [template::util::file::get_property filename $upload_file]
- set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file]
- set mime_type [template::util::file::get_property mime_type $upload_file]
- if {$mime_type eq ""} {
- set mime_type [ns_guesstype $file_name]
+ if {[info exists folder_size]} {
+ # check per folder quota
+ set maximum_folder_size [parameter::get -parameter "MaximumFolderSize"]
+
+ if { $maximum_folder_size ne "" } {
+ if { $folder_size+[file size ${upload_file.tmpfile}] > $maximum_folder_size } {
+ template::form::set_error upload_form upload_file \
+ [_ file-storage.out_of_space]
+ break
}
- if {$selector_type eq "image" \
- && ![string match "image/*" $mime_type]} {
- template::form::set_error upload_form upload_file \
- [_ acs-templating.HTMLArea_SelectImageUploadNoImage]
- break
- }
- if {[string match "image/*" $mime_type]} {
-
- image::new \
- -item_id $item_id \
- -name ${item_id}_$file_name \
- -parent_id $parent_id \
- -tmp_filename $upload_tmpfile \
- -creation_user $user_id \
- -creation_ip [ad_conn peeraddr] \
- -package_id [ad_conn package_id]
- } else {
- content::item::new \
- -item_id $item_id \
- -name ${item_id}_$file_name \
- -parent_id $parent_id \
- -tmp_filename $upload_tmpfile \
- -creation_user $user_id \
- -creation_ip [ad_conn peeraddr] \
- -package_id [ad_conn package_id]
- }
- file delete -- $upload_tmpfile
+ }
+ }
+
+ set file_name [template::util::file::get_property filename $upload_file]
+ set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file]
+ set mime_type [template::util::file::get_property mime_type $upload_file]
+ if {$mime_type eq ""} {
+ set mime_type [ns_guesstype $file_name]
+ }
+ if {$selector_type eq "image" \
+ && ![string match "image/*" $mime_type]} {
+ template::form::set_error upload_form upload_file \
+ [_ acs-templating.HTMLArea_SelectImageUploadNoImage]
+ break
+ }
+ if {[string match "image/*" $mime_type]} {
+
+ image::new \
+ -item_id $item_id \
+ -name ${item_id}_$file_name \
+ -parent_id $parent_id \
+ -tmp_filename $upload_tmpfile \
+ -creation_user $user_id \
+ -creation_ip [ad_conn peeraddr] \
+ -package_id [ad_conn package_id]
+ } else {
+ content::item::new \
+ -item_id $item_id \
+ -name ${item_id}_$file_name \
+ -parent_id $parent_id \
+ -tmp_filename $upload_tmpfile \
+ -creation_user $user_id \
+ -creation_ip [ad_conn peeraddr] \
+ -package_id [ad_conn package_id]
+ }
+ file delete -- $upload_tmpfile
+ permission::grant \
+ -object_id $item_id \
+ -party_id $user_id \
+ -privilege admin
+
+ switch -- $share {
+ private {
+ permission::set_not_inherit -object_id $item_id
+ }
+ group {
+ # Find the closest application group
+ # either dotlrn or acs-subsite
+
permission::grant \
+ -party_id [acs_magic_object "registered_users"] \
-object_id $item_id \
- -party_id $user_id \
- -privilege admin
-
- switch -- $share {
- private {
- permission::set_not_inherit -object_id $item_id
- }
- group {
- # Find the closest application group
- # either dotlrn or acs-subsite
-
- permission::grant \
- -party_id [acs_magic_object "registered_users"] \
- -object_id $item_id \
- -privilege "read"
- }
- public {
- permission::grant \
- -party_id [acs_magic_object "the_public"] \
- -object_id $item_id \
- -privilege "read"
- }
- site -
- default {
- permission::grant \
- -party_id [acs_magic_object "registered_users"] \
- -object_id $item_id \
- -privilege "read"
- }
-
- }
- if {$share eq "private"} {
- # need a private URL that allows viewers of this
- # object to see the image
- # this isn't totally secure, because of course
- # you need to be able to see the image somehow
- # but we only allow read on the image if you can
- # see the parent object
- set f_url "/image/$item_id/private/$file_name"
- } else {
- set f_url "/image/$item_id/$file_name"
- }
+ -privilege "read"
+ }
+ public {
+ permission::grant \
+ -party_id [acs_magic_object "the_public"] \
+ -object_id $item_id \
+ -privilege "read"
+ }
+ site -
+ default {
+ permission::grant \
+ -party_id [acs_magic_object "registered_users"] \
+ -object_id $item_id \
+ -privilege "read"
+ }
+
}
-
+ if {$share eq "private"} {
+ # need a private URL that allows viewers of this
+ # object to see the image
+ # this isn't totally secure, because of course
+ # you need to be able to see the image somehow
+ # but we only allow read on the image if you can
+ # see the parent object
+ set f_url "/image/$item_id/private/$file_name"
+ } else {
+ set f_url "/image/$item_id/$file_name"
+ }
+ }
+
} else {
- set write_p 0
+ set write_p 0
}
@@ -181,6 +181,7 @@
set HTML_Preview "Preview"
set HTML_UploadTitle ""
+
# Local variables:
# mode: tcl
# tcl-indent-level: 2
Index: openacs-4/packages/xowiki/www/xinha/insert-file.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/insert-file.tcl,v
diff -u -r1.7 -r1.7.2.1
--- openacs-4/packages/xowiki/www/xinha/insert-file.tcl 1 Oct 2017 12:10:25 -0000 1.7
+++ openacs-4/packages/xowiki/www/xinha/insert-file.tcl 7 Feb 2020 08:44:05 -0000 1.7.2.1
@@ -1,148 +1,149 @@
ad_page_contract {
- Simple image upload, attach image to object_id passed in, if no
- object_id, use the current package_id
- @author Guenter Ernst guenter.ernst@wu-wien.ac.at,
- @author Gustaf Neumann neumann@wu-wien.ac.at
- @author Dave Bauer (dave@solutiongrove.com)
- @creation-date 13.07.2004
- @cvs-id $Id$
+ Simple image upload, attach image to object_id passed in, if no
+ object_id, use the current package_id
+ @author Guenter Ernst guenter.ernst@wu-wien.ac.at,
+ @author Gustaf Neumann neumann@wu-wien.ac.at
+ @author Dave Bauer (dave@solutiongrove.com)
+ @creation-date 13.07.2004
+ @cvs-id $Id$
} {
- {parent_id:naturalnum,notnull}
- {selector_type "image"}
+ {parent_id:naturalnum,notnull}
+ {selector_type "image"}
}
set f_url ""
set user_id [ad_conn user_id]
-# if user has write permission, create image upload form,
+# if user has write permission, create image upload form,
if {[permission::permission_p -party_id $user_id -object_id $parent_id \
- -privilege "write"]} {
+ -privilege "write"]} {
- set write_p 1
+ set write_p 1
- # FIXME DAVEB i18n for share_options
- set share_options [list [list "[_ acs-templating.Only_myself]" private] [list "[_ acs-templating.This_Group]" group] [list "[_ acs-templating.Anyone_on_this_system]" site] [list "[_ acs-templating.Anyone_on_the_internet]" public]]
- ad_form \
- -name upload_form \
- -mode edit \
- -export {selector_type file_types parent_id} \
- -html { enctype multipart/form-data } \
- -form {
- item_id:key
- {upload_file:file(file) {html {size 30}} }
- {share:text(radio),optional {label "[_ acs-templating.This_image_can_be_reused_by]"} {options $share_options} {help_text "[_ acs-templating.This_image_can_be_reused_help]"}}
- {ok_btn:text(submit) {label "[_ acs-templating.HTMLArea_SelectUploadBtn]"}
- }
- } \
- -on_request {
- set share site
- } \
- -on_submit {
- # check file name
- if {$upload_file eq ""} {
- template::form::set_error upload_form upload_file \
- [_ acs-templating.HTMLArea_SpecifyUploadFilename]
- break
- }
+ # FIXME DAVEB i18n for share_options
+ set share_options [list [list "[_ acs-templating.Only_myself]" private] [list "[_ acs-templating.This_Group]" group] [list "[_ acs-templating.Anyone_on_this_system]" site] [list "[_ acs-templating.Anyone_on_the_internet]" public]]
+ ad_form \
+ -name upload_form \
+ -mode edit \
+ -export {selector_type file_types parent_id} \
+ -html { enctype multipart/form-data } \
+ -form {
+ item_id:key
+ {upload_file:file(file) {html {size 30}} }
+ {share:text(radio),optional {label "[_ acs-templating.This_image_can_be_reused_by]"} {options $share_options} {help_text "[_ acs-templating.This_image_can_be_reused_help]"}}
+ {ok_btn:text(submit) {label "[_ acs-templating.HTMLArea_SelectUploadBtn]"}
+ }
+ } \
+ -on_request {
+ set share site
+ } \
+ -on_submit {
+ # check file name
+ if {$upload_file eq ""} {
+ template::form::set_error upload_form upload_file \
+ [_ acs-templating.HTMLArea_SpecifyUploadFilename]
+ break
+ }
- if {[info exists folder_size]} {
- # check per folder quota
- set maximum_folder_size [parameter::get -parameter "MaximumFolderSize"]
-
- if { $maximum_folder_size ne "" } {
- if { $folder_size+[file size ${upload_file.tmpfile}] > $maximum_folder_size } {
- template::form::set_error upload_form upload_file \
- [_ file-storage.out_of_space]
- break
- }
- }
- }
-
- set file_name [template::util::file::get_property filename $upload_file]
- set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file]
- set mime_type [template::util::file::get_property mime_type $upload_file]
- if {$mime_type eq ""} {
- set mime_type [ns_guesstype $file_name]
+ if {[info exists folder_size]} {
+ # check per folder quota
+ set maximum_folder_size [parameter::get -parameter "MaximumFolderSize"]
+
+ if { $maximum_folder_size ne "" } {
+ if { $folder_size+[file size ${upload_file.tmpfile}] > $maximum_folder_size } {
+ template::form::set_error upload_form upload_file \
+ [_ file-storage.out_of_space]
+ break
}
- if {$selector_type eq "image" \
- && ![string match "image/*" $mime_type]} {
- template::form::set_error upload_form upload_file \
- [_ acs-templating.HTMLArea_SelectImageUploadNoImage]
- break
- }
- if {[string match "image/*" $mime_type]} {
-
- image::new \
- -item_id $item_id \
- -name ${item_id}_$file_name \
- -parent_id $parent_id \
- -tmp_filename $upload_tmpfile \
- -creation_user $user_id \
- -creation_ip [ad_conn peeraddr] \
- -package_id [ad_conn package_id]
- } else {
- content::item::new \
- -item_id $item_id \
- -name ${item_id}_$file_name \
- -parent_id $parent_id \
- -tmp_filename $upload_tmpfile \
- -creation_user $user_id \
- -creation_ip [ad_conn peeraddr] \
- -package_id [ad_conn package_id]
- }
- file delete -- $upload_tmpfile
+ }
+ }
+
+ set file_name [template::util::file::get_property filename $upload_file]
+ set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file]
+ set mime_type [template::util::file::get_property mime_type $upload_file]
+ if {$mime_type eq ""} {
+ set mime_type [ns_guesstype $file_name]
+ }
+ if {$selector_type eq "image" \
+ && ![string match "image/*" $mime_type]} {
+ template::form::set_error upload_form upload_file \
+ [_ acs-templating.HTMLArea_SelectImageUploadNoImage]
+ break
+ }
+ if {[string match "image/*" $mime_type]} {
+
+ image::new \
+ -item_id $item_id \
+ -name ${item_id}_$file_name \
+ -parent_id $parent_id \
+ -tmp_filename $upload_tmpfile \
+ -creation_user $user_id \
+ -creation_ip [ad_conn peeraddr] \
+ -package_id [ad_conn package_id]
+ } else {
+ content::item::new \
+ -item_id $item_id \
+ -name ${item_id}_$file_name \
+ -parent_id $parent_id \
+ -tmp_filename $upload_tmpfile \
+ -creation_user $user_id \
+ -creation_ip [ad_conn peeraddr] \
+ -package_id [ad_conn package_id]
+ }
+ file delete -- $upload_tmpfile
+ permission::grant \
+ -object_id $item_id \
+ -party_id $user_id \
+ -privilege admin
+
+ switch -- $share {
+ private {
+ permission::set_not_inherit -object_id $item_id
+ }
+ group {
+ # Find the closest application group
+ # either dotlrn or acs-subsite
+
permission::grant \
+ -party_id [acs_magic_object "registered_users"] \
-object_id $item_id \
- -party_id $user_id \
- -privilege admin
-
- switch -- $share {
- private {
- permission::set_not_inherit -object_id $item_id
- }
- group {
- # Find the closest application group
- # either dotlrn or acs-subsite
-
- permission::grant \
- -party_id [acs_magic_object "registered_users"] \
- -object_id $item_id \
- -privilege "read"
- }
- public {
- permission::grant \
- -party_id [acs_magic_object "the_public"] \
- -object_id $item_id \
- -privilege "read"
- }
- site -
- default {
- permission::grant \
- -party_id [acs_magic_object "registered_users"] \
- -object_id $item_id \
- -privilege "read"
- }
-
- }
- if {$share eq "private"} {
- # need a private URL that allows viewers of this
- # object to see the image
- # this isn't totally secure, because of course
- # you need to be able to see the image somehow
- # but we only allow read on the image if you can
- # see the parent object
- set f_url "/image/$item_id/private/$file_name"
- } else {
- set f_url "/image/$item_id/$file_name"
- }
+ -privilege "read"
+ }
+ public {
+ permission::grant \
+ -party_id [acs_magic_object "the_public"] \
+ -object_id $item_id \
+ -privilege "read"
+ }
+ site -
+ default {
+ permission::grant \
+ -party_id [acs_magic_object "registered_users"] \
+ -object_id $item_id \
+ -privilege "read"
+ }
+
}
+ if {$share eq "private"} {
+ # need a private URL that allows viewers of this
+ # object to see the image
+ # this isn't totally secure, because of course
+ # you need to be able to see the image somehow
+ # but we only allow read on the image if you can
+ # see the parent object
+ set f_url "/image/$item_id/private/$file_name"
+ } else {
+ set f_url "/image/$item_id/$file_name"
+ }
+ }
} else {
- set write_p 0
+ set write_p 0
}
set HTML_Preview "Preview"
set HTML_UploadTitle ""
+
# Local variables:
# mode: tcl
# tcl-indent-level: 2
Index: openacs-4/packages/xowiki/www/xinha/insert-wlink.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/xinha/insert-wlink.tcl,v
diff -u -r1.6.2.2 -r1.6.2.3
--- openacs-4/packages/xowiki/www/xinha/insert-wlink.tcl 8 May 2019 14:33:40 -0000 1.6.2.2
+++ openacs-4/packages/xowiki/www/xinha/insert-wlink.tcl 7 Feb 2020 08:44:05 -0000 1.6.2.3
@@ -1,9 +1,9 @@
ad_page_contract {
- popup for choosing a target for wiki link
+ popup for choosing a target for wiki link
} {
- {package_id:naturalnum,notnull}
- {page_number:integer 1}
- {page_size:integer 20}
+ {package_id:naturalnum,notnull}
+ {page_number:integer 1}
+ {page_size:integer 20}
}
::xowiki::Package initialize -package_id $package_id
@@ -40,9 +40,9 @@
template::add_event_listener -id "body" -event "load" -script {Init();}
foreach entry [$listing children] {
- $entry instvar name parent_id title formatted_date page_id
+ $entry instvar name parent_id title formatted_date page_id
set entry_package_id [$entry set package_id]
-
+
set page_link [::$package_id pretty_link -parent_id $parent_id $name]
t1 add \
-title $title \
Index: openacs-4/packages/xowiki-portlet/www/xowiki-admin-portlet.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki-portlet/www/xowiki-admin-portlet.tcl,v
diff -u -r1.10 -r1.10.2.1
--- openacs-4/packages/xowiki-portlet/www/xowiki-admin-portlet.tcl 29 Jun 2018 17:27:19 -0000 1.10
+++ openacs-4/packages/xowiki-portlet/www/xowiki-admin-portlet.tcl 7 Feb 2020 08:44:05 -0000 1.10.2.1
@@ -1,9 +1,9 @@
ad_page_contract {
- The display logic for the xowiki admin portlet
+ The display logic for the xowiki admin portlet
- @author Michael Totschnig
- @author Gustaf Neumann
- @cvs-id $Id$
+ @author Michael Totschnig
+ @author Gustaf Neumann
+ @cvs-id $Id$
} {
package_id:naturalnum,optional
template_portal_id:naturalnum,optional
@@ -27,43 +27,43 @@
if {![info exists template_portal_id] || $template_portal_id eq ""} {
set template_portal_id [dotlrn_community::get_portal_id]
}
-
+
if {![info exists referer] && [info exists return_url] && $return_url ne ""} {
set referer $return_url
}
-
+
if {![info exists referer]} {
set referer [ad_conn url]
}
-
+
set element_pretty_name [parameter::get \
- -parameter xowiki_admin_portlet_element_pretty_name \
- -default [_ xowiki-portlet.admin_portlet_element_pretty_name]]
-
+ -parameter xowiki_admin_portlet_element_pretty_name \
+ -default [_ xowiki-portlet.admin_portlet_element_pretty_name]]
+
db_multirow content select_content \
- "select m.element_id, m.pretty_name, pep.value as name
- from portal_element_map m, portal_pages p, portal_element_parameters pep
- where m.page_id = p.page_id
- and p.portal_id = $template_portal_id
+ "select m.element_id, m.pretty_name, pep.value as name
+ from portal_element_map m, portal_pages p, portal_element_parameters pep
+ where m.page_id = p.page_id
+ and p.portal_id = $template_portal_id
and m.datasource_id = [portal::get_datasource_id [xowiki_portlet name]]
and pep.element_id = m.element_id and pep.key = 'page_name'" {}
-
+
# don't ask to insert same page twice
template::multirow foreach content {set used_page_id($name) 1}
set options ""
db_foreach instance_select \
[::xowiki::Page instance_select_query \
- -folder_id [::$xowiki_package_id folder_id] \
- -with_subtypes true \
- -from_clause ", xowiki_page P" \
- -where_clause "P.page_id = bt.revision_id" \
- -orderby "ci.name" \
- ] {
- if {[regexp {^::[0-9]} $name]} continue
- if {[info exists used_page_id($name)]} continue
- append options ""
- }
+ -folder_id [::$xowiki_package_id folder_id] \
+ -with_subtypes true \
+ -from_clause ", xowiki_page P" \
+ -where_clause "P.page_id = bt.revision_id" \
+ -orderby "ci.name" \
+ ] {
+ if {[regexp {^::[0-9]} $name]} continue
+ if {[info exists used_page_id($name)]} continue
+ append options ""
+ }
@@ -83,3 +83,9 @@
}
+#
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 2
+# indent-tabs-mode: nil
+# End: