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 -r1.239.2.15 -r1.239.2.16
--- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 23 Jul 2019 14:15:00 -0000 1.239.2.15
+++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 29 Jul 2019 19:01:31 -0000 1.239.2.16
@@ -850,10 +850,11 @@
"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 mset [list \
+ name $name title $title prefix "" suffix "" \
+ page_order $page_order \
+ href [::$package_id pretty_link -parent_id $parent_id $name] \
+ ]
$cattree(0) add_item \
-category $category($category_id) \
-itemobj $itemobj \
@@ -947,10 +948,12 @@
}
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]
- if {![info exists categories($category_id)]} {
+ $itemobj mset [list \
+ name $name title $title prefix $prefix suffix $suffix \
+ href [::$package_id pretty_link -parent_id $parent_id $name] \
+ ]
+ if {![info exists categories($category_id)]} {
set categories($category_id) [::xowiki::TreeNode new \
-label [category::get_name $category_id $locale] \
-level 1]
@@ -1092,12 +1095,12 @@
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" \
+ -vars "i.parent_id, r.title,i.name, x.time" \
-from "xowiki_last_visited x, xowiki_page p, cr_items i, cr_revisions r" \
-where "x.page_id = i.item_id and i.live_revision = p.page_id \
and r.revision_id = p.page_id and x.user_id = [::xo::cc set untrusted_user_id] \
- and x.package_id = :package_id and i.publish_status <> 'production'" \
- -orderby "visited_date desc" \
+ and x.package_id = :package_id and i.publish_status <> 'production'" \
+ -orderby "x.time desc" \
-limit $max_entries] \
{
t1 add \
@@ -1145,7 +1148,7 @@
set since_condition [::xo::dc since_interval_condition time $interval]
xo::dc foreach get_pages \
[::xo::dc select \
- -vars "count(x.user_id) as nr_different_users, x.page_id, r.title,i.name, i.parent_id" \
+ -vars "count(x.user_id) as nr_different_users, r.title, i.name, i.parent_id" \
-from "xowiki_last_visited x, cr_items i, cr_revisions r" \
-where "x.package_id = :package_id and x.page_id = i.item_id and \
i.publish_status <> 'production' and i.live_revision = r.revision_id \
@@ -1168,7 +1171,7 @@
}
xo::dc foreach get_pages \
[::xo::dc select \
- -vars "sum(x.count) as sum, count(x.user_id) as nr_different_users, x.page_id, r.title,i.name, i.parent_id" \
+ -vars "sum(x.count) as sum, count(x.user_id) as nr_different_users, r.title,i.name, i.parent_id" \
-from "xowiki_last_visited x, cr_items i, cr_revisions r" \
-where "x.package_id = :package_id and x.page_id = i.item_id and \
i.publish_status <> 'production' and i.live_revision = r.revision_id" \
@@ -1683,7 +1686,7 @@
}
if {$pid ne ""} {
::xowiki::Package require $pid
- lappend refs "[ns_quotehtml $name]"
+ lappend refs "[ns_quotehtml $name]"
}
}
@@ -4746,8 +4749,9 @@
}}
}
-
- # the two method "href" and "page_number" are copied from "toc"
+ #
+ # The two methods "href" and "page_number" are copied from "toc"
+ #
html-file instproc href {book_mode name} {
if {$book_mode} {
set href [::xo::cc url]#[toc anchor $name]
Index: openacs-4/packages/xowiki/tcl/package-procs.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/tcl/package-procs.tcl,v
diff -u -r1.332.2.30 -r1.332.2.31
--- openacs-4/packages/xowiki/tcl/package-procs.tcl 23 Jul 2019 14:15:00 -0000 1.332.2.30
+++ openacs-4/packages/xowiki/tcl/package-procs.tcl 29 Jul 2019 19:01:31 -0000 1.332.2.31
@@ -538,23 +538,20 @@
# between folder and page in ambiguous cases.
#
if {$found_id != 0 && $page eq ""} {
- ns_log notice "have to fetch target page. You should provide '-page' to pretty_link"
+ #ad_log warning "have to fetch target page. You should provide '-page' to pretty_link"
set page [::xo::db::CrClass get_instance_from_db -item_id $found_id]
}
if {$found_id != 0 && $page ne ""} {
- # :log "... named page <$name> exists <$found_id [$found_id name]), provided page <$page [$page name]>\
- # folder [$page is_folder_page] link [$page is_link_page]"
#
- # Do NOT add a language prefix for folders, links and newborn
- # pages, or if the name lookup found exactly the page we were
- # pointing to.
+ # Do never add a language prefix for certain pages
#
- if {$found_id == [$page item_id] || [$page is_folder_page] || [$page is_link_page] || $name eq [$page revision_id]} {
- #:log "... on the folder or newborn page."
+ if {[$page is_unprefixed]} {
+ #:log "... $page is unprefixed"
set found_id 0
}
}
+
#:log "-pretty_link: found_id=$found_id name=$name,folder=$folder,lang=$lang,default_lang=$default_lang"
if {$download} {
#
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.542.2.34 -r1.542.2.35
--- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 23 Jul 2019 14:36:01 -0000 1.542.2.34
+++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 29 Jul 2019 19:01:31 -0000 1.542.2.35
@@ -1355,6 +1355,7 @@
Page instproc is_folder_page {{-include_folder_links true}} {
return 0
}
+
FormPage instproc is_folder_page {{-include_folder_links true}} {
set page_template_name [${:page_template} name]
if {$page_template_name eq "en:folder.form"} {return 1}
@@ -1371,6 +1372,7 @@
Page instproc is_link_page {} {
return 0
}
+
FormPage instproc is_link_page {} {
#
# Make sure, the page_template is instantiated
@@ -1381,6 +1383,18 @@
return [expr {[${:page_template} name] eq "en:link.form"}]
}
+ Page instproc is_unprefixed {} {
+ #
+ # Pages which should not get an extra language prefix. In case,
+ # your package has further such requirements, extend this proc in
+ # you package.
+ #
+ return [expr {[:is_folder_page]
+ || [:is_link_page]
+ || ${:name} eq ${:revision_id}
+ }]
+ }
+
#
# link properties
#
@@ -2434,15 +2448,30 @@
return $result
}
- Page instproc new_link {-object_type -name -title -nls_language -return_url -parent_id page_package_id} {
+ Page instproc new_link {
+ -object_type
+ -name -title
+ -nls_language
+ -return_url
+ -parent_id
+ page_package_id
+ } {
if {[info exists parent_id] && $parent_id eq ""} {
unset parent_id
}
return [::$page_package_id make_link $page_package_id \
edit-new object_type name title nls_language return_url parent_id autoname]
}
- FormPage instproc new_link {-object_type -name -title -nls_language -parent_id -return_url page_package_id} {
+ FormPage instproc new_link {
+ -object_type
+ -name
+ -title
+ -nls_language
+ -parent_id
+ -return_url
+ page_package_id
+ } {
if {[info exists object_type]} {
next
} else {