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.91 -r1.92
--- openacs-4/packages/xowiki/tcl/includelet-procs.tcl 26 Jan 2009 19:33:26 -0000 1.91
+++ openacs-4/packages/xowiki/tcl/includelet-procs.tcl 29 Jan 2009 15:05:18 -0000 1.92
@@ -628,11 +628,32 @@
{-order_items_by "title,asc"}
{-category_ids ""}
{-except_category_ids ""}
+ {-allow_edit false}
{-ordered_composite}
}}
}
+ categories instproc category_tree_missing {{-name ""} -object_id -locale {-allow_edit false}} {
+ # todo i18n
+ # next steps: handle allow_edit for cases, where category tree was found
+ if {$name eq ""} {
+ set msg "No category tree found."
+ } else {
+ set msg "No category tree with name '$name' found."
+ }
+ [my package_id] flush_page_fragment_cache -scope agg
+ set allow_p [::xo::cc permission -object_id $object_id -privilege admin -party_id [::xo::cc user_id]]
+ if {$allow_edit && $allow_p} {
+ set href "admin/manage_categories?object_id=$object_id"
+ set html [[my set __including_page] include [list edit-item-button -link $href]]
+ return "
$msg
Manage Categories? $html"
+ } else {
+ my log $msg
+ return "$msg
"
+ }
+ }
+
categories instproc render {} {
my get_parameters
@@ -653,16 +674,16 @@
# we have nothing left from mapped trees, maybe the tree_names are not mapped;
# try to get these
foreach name $tree_name {
- #lappend trees [list [lindex [category_tree::get_id $tree_name $locale] 0] $name]
- lappend trees [list [lindex [category_tree::get_id $tree_name] 0] $name]
+ #set tree_id [lindex [category_tree::get_id $tree_name $locale] 0]
+ set tree_id [lindex [category_tree::get_id $tree_name] 0]
+ if {$tree_id ne ""} {
+ lappend trees [list $tree_id $name]
+ }
}
}
if {[llength $trees] == 0} {
- my log "No mapped category tree found\n\
- (mapped trees = [llength $trees],\n\
- tree_name = '$tree_name')"
- return ""
+ return [my category_tree_missing -name $name -object_id $package_id -locale $locale -allow_edit $allow_edit]
}
foreach tree $trees {
@@ -2342,6 +2363,7 @@
{-title "#xowiki.edit#"}
{-alt "edit"}
{-book_mode false}
+ {-link ""}
}}
}
@@ -2358,7 +2380,7 @@
append return_url #[toc anchor [$page name]]
}
return [my render_button \
- -page $page -method edit -package_id $package_id \
+ -page $page -method edit -package_id $package_id -link $link \
-title $title -alt $alt -return_url $return_url]
}
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.323 -r1.324
--- openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 25 Jan 2009 11:12:21 -0000 1.323
+++ openacs-4/packages/xowiki/tcl/xowiki-procs.tcl 29 Jan 2009 15:05:18 -0000 1.324
@@ -950,6 +950,7 @@
# there must be something syntactically wrong
return [my error_in_includelet $arg [_ xowiki.error-includelet-dash_syntax_invalid]]
}
+ #my msg "includelet: [lindex $arg 0], caller parms ? '[lrange $arg 1 end]'"
# the include is either a includelet class, or a wiki page
if {[my isclass ::xowiki::includelet::$page_name]} {
Index: openacs-4/packages/xowiki/www/admin/index.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/xowiki/www/admin/index.tcl,v
diff -u -r1.23 -r1.24
--- openacs-4/packages/xowiki/www/admin/index.tcl 16 Dec 2008 17:07:04 -0000 1.23
+++ openacs-4/packages/xowiki/www/admin/index.tcl 29 Jan 2009 15:05:18 -0000 1.24
@@ -15,9 +15,7 @@
set object_types [$object_type object_types]
set return_url [ns_conn url]
-set category_url [export_vars \
- -base [site_node::get_package_url -package_key categories]cadmin/object-map \
- { { object_id $package_id } {ctx_id $package_id} }]
+set category_url [export_vars -base manage_categories { { object_id $package_id } }]
lang::message::lookup "" xowiki.admin " "
TableWidget t1 -volatile \
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.28 -r1.29
--- openacs-4/packages/xowiki/www/admin/list.tcl 16 Dec 2008 17:07:04 -0000 1.28
+++ openacs-4/packages/xowiki/www/admin/list.tcl 29 Jan 2009 15:05:18 -0000 1.29
@@ -34,10 +34,9 @@
set return_url [expr {$per_type ? [export_vars -base [::$package_id url] object_type] :
[::$package_id url]}]
-set category_url [export_vars \
- -base [site_node::get_package_url -package_key categories]cadmin/object-map \
- { { object_id $package_id } {ctx_id $package_id} }]
+set category_url [export_vars -base manage_categories { { object_id $package_id } }]
+
set actions [subst {
Action new -label "[lang::message::lookup {} categories.Categories Categories]" \
-url $category_url