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.11
--- 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 3 Sep 2024 15:38:00 -0000 1.11
@@ -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,44 @@
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]]
-
-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
+ -parameter xowiki_admin_portlet_element_pretty_name \
+ -default [_ xowiki-portlet.admin_portlet_element_pretty_name]]
+
+::xo::dc multirow -prepare integer content select_content [subst {
+ 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'" {}
-
+ 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 \
+::xo::dc 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 +84,9 @@
}
+#
+# Local variables:
+# mode: tcl
+# tcl-indent-level: 2
+# indent-tabs-mode: nil
+# End: