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.4 -r1.5 --- openacs-4/packages/xowiki/www/admin/index.tcl 19 Jan 2006 23:01:58 -0000 1.4 +++ openacs-4/packages/xowiki/www/admin/index.tcl 28 Jan 2006 23:28:23 -0000 1.5 @@ -1,67 +1,46 @@ ad_page_contract { - This is the admin page for the package. It displays all of the types for - Notes and provides links to delete them + This is the admin page for the package. It displays all of the types + of wiki pages provides links to delete them - @author Your Name (you@example.com) - @cvs-id $Id$ + @author Gustaf Neumann neumann@wu-wien.ac.at + @cvs-id $Id$ } -query { object_type:optional } set context [list] set supertype ::xowiki::Page -set object_type_key [$supertype set object_type_key] - set page_title "Administer all kind of [$supertype set pretty_plural]" -template::list::create \ - -name admin_index \ +set object_type_key [$supertype set object_type_key] +set folder_id [$supertype require_folder -name xowiki] +set object_types [$supertype object_types] + +TableWidget t1 -volatile \ -actions { - export export export - import import import + Action new -label export -url export + Action new -label import -url import } \ - -elements { - delete { - link_url_col delete_url - display_template { - Delete object type with all subtypes and instances - delete - } - sub_class narrow - } - nr_instances { - link_url_col instances_url - label Instances - } - object_type { - label "Object Type" - } + -columns { + Field object_type -label [_ xowiki.page_type] + AnchorField instances -label Instances -html {align center} + ImageField_AddIcon edit -label "Add" -html {align center} + ImageField_DeleteIcon delete -label "Delete" -html {align center} } -db_multirow \ - -extend { - delete_url - instances_url - nr_instances - } admin_index type_index_select " - select object_type from acs_object_types where +db_foreach type_select \ + "select object_type from acs_object_types where tree_sortkey between :object_type_key and tree_right(:object_type_key) " { - - set delete_url [export_vars -base delete-type {object_type}] - if {[$object_type info class] eq "::xotcl::Class"} { - # for backward comatibility with 5.1, since we define PageTemplate as plain xotcl class; - # only necessary to avoid crash, when entries are already in the database - continue - #set nr_instances 0 - } else { - set nr_instances [db_list count [$object_type instance_select_query \ - -count 1 \ - -with_subtypes false]] - } - set instances_url [export_vars -base ../index {object_type}] + t1 add \ + -object_type $object_type \ + -instances [db_list count [$object_type instance_select_query \ + -folder_id $folder_id -count 1 -with_subtypes false]] \ + -instances.href [export_vars -base ../index {object_type}] \ + -edit.href [export_vars -base ../edit {object_type folder_id}] \ + -delete.href [export_vars -base delete-type {object_type}] \ + -edit.title [_ xotcl-core.add [list type [$object_type pretty_name]]] \ + -delete.title "Delete Type [$object_type pretty_name]" } -set template admin_index \ No newline at end of file +set t1 [t1 asHTML]