Index: openacs-4/contrib/packages/simulation/lib/sim-objects.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-objects.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/simulation/lib/sim-objects.adp 12 Nov 2003 15:24:02 -0000 1.1 @@ -0,0 +1,7 @@ +

+ + +

+ » Create new object +

+
\ No newline at end of file Index: openacs-4/contrib/packages/simulation/lib/sim-objects.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/sim-objects.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/simulation/lib/sim-objects.tcl 12 Nov 2003 15:24:02 -0000 1.1 @@ -0,0 +1,108 @@ +simulation::include_contract { + Displays a list of simulation objects for the current simulation package instance. + + @author Joel Aufrecht + @creation-date 2003-11-12 + @cvs-id $Id: sim-objects.tcl,v 1.1 2003/11/12 15:24:02 peterm Exp $ +} { + display_mode { + allowed_values {edit display} + default_value display + } + size { + allowed_values {short long} + default_value long + } +} + +set package_id [ad_conn package_id] + +if { ![exists_and_not_null parent_id] } { + set parent_id [bcms::folder::get_id_by_package_id -parent_id 0] +} + +set elements { + object_type_pretty { + label "Type" + orderby upper(ot.pretty_name) + } + title { + label "Name" + orderby r.title + link_url_col view_url + } +} + +if { [string equal $display_mode "edit"] } { + # Put an edit link first + set elements [concat { + edit { + sub_class narrow + link_url_col edit_url + display_template { + Edit + } + } + } $elements] +} + +if { [string equal $size "long"] } { + set elements [concat $elements { + description { + label "Description" + orderby r.description + } + }] +} + +if { [string equal $display_mode "edit"] } { + # Put a delete link last + set elements [concat $elements { + delete { + sub_class narrow + link_url_col delete_url + display_template { + Edit + } + } + }] +} + +template::list::create \ + -name objects \ + -multirow objects \ + -elements $elements + +db_multirow -extend { edit_url view_url delete_url } objects select_objects " + select i.item_id, + i.name, + r.title, + r.description, + r.mime_type, + i.content_type, + ot.pretty_name as object_type_pretty + from cr_folders f, + cr_items i, + cr_revisions r, + acs_object_types ot + where f.package_id = :package_id + and i.parent_id = f.folder_id + and r.revision_id = i.live_revision + and ot.object_type = i.content_type + [template::list::orderby_clause -orderby -name "objects"] +" { + set description [string_truncate -len 200 $description] + set edit_url [export_vars -base "object-edit" { item_id }] + set delete_url [export_vars -base "object-delete" { item_id }] + + switch -glob $mime_type { + text/* - {} { + set view_url [export_vars -base "object/$name"] + } + default { + set view_url [export_vars -base "object-content/$name"] + } + } +} + +set create_object_url [export_vars -base object-edit { parent_id }] Index: openacs-4/contrib/packages/simulation/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/index.adp,v diff -u -r1.15 -r1.16 --- openacs-4/contrib/packages/simulation/www/index.adp 12 Nov 2003 14:51:16 -0000 1.15 +++ openacs-4/contrib/packages/simulation/www/index.adp 12 Nov 2003 15:24:03 -0000 1.16 @@ -28,7 +28,7 @@

CITYBUILD

-

+
Index: openacs-4/contrib/packages/simulation/www/object-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/object-list.adp,v diff -u -r1.4 -r1.5 --- openacs-4/contrib/packages/simulation/www/object-list.adp 11 Nov 2003 15:32:46 -0000 1.4 +++ openacs-4/contrib/packages/simulation/www/object-list.adp 12 Nov 2003 15:24:03 -0000 1.5 @@ -2,12 +2,8 @@ @page_title;noquote@ @context;noquote@ -

+ -

- » Create new object -

-

Map XML

@@ -22,4 +18,4 @@

» Generate Map XML file and send notifications

-
\ No newline at end of file + Index: openacs-4/contrib/packages/simulation/www/object-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/Attic/object-list.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/contrib/packages/simulation/www/object-list.tcl 11 Nov 2003 15:32:46 -0000 1.11 +++ openacs-4/contrib/packages/simulation/www/object-list.tcl 12 Nov 2003 15:24:03 -0000 1.12 @@ -13,80 +13,6 @@ set package_id [ad_conn package_id] set admin_p [permission::permission_p -object_id $package_id -privilege admin] -if { ![exists_and_not_null parent_id] } { - set parent_id [bcms::folder::get_id_by_package_id -parent_id 0] -} - -template::list::create \ - -name objects \ - -multirow objects \ - -elements { - edit { - sub_class narrow - link_url_col edit_url - display_template { - Edit - } - } - object_type_pretty { - label "Type" - orderby upper(ot.pretty_name) - } - title { - label "Name" - orderby r.title - link_url_col view_url - } - description { - label "Description" - orderby r.description - } - delete { - sub_class narrow - link_url_col delete_url - display_template { - Edit - } - } - } - - -set package_id [ad_conn package_id] - -db_multirow -extend { edit_url view_url delete_url } objects select_objects " - select i.item_id, - i.name, - r.title, - r.description, - r.mime_type, - i.content_type, - ot.pretty_name as object_type_pretty - from cr_folders f, - cr_items i, - cr_revisions r, - acs_object_types ot - where f.package_id = :package_id - and i.parent_id = f.folder_id - and r.revision_id = i.live_revision - and ot.object_type = i.content_type - [template::list::orderby_clause -orderby -name "objects"] -" { - set description [string_truncate -len 200 $description] - set edit_url [export_vars -base "object-edit" { item_id }] - set delete_url [export_vars -base "object-delete" { item_id }] - - switch -glob $mime_type { - text/* - {} { - set view_url [export_vars -base "object/$name"] - } - default { - set view_url [export_vars -base "object-content/$name"] - } - } -} - -set create_object_url [export_vars -base object-edit { parent_id }] - set notification_widget [notification::display::request_widget \ -type [simulation::notification::xml_map::type_short_name] \ -object_id [ad_conn package_id] \ Index: openacs-4/packages/simulation/lib/sim-objects.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-objects.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/simulation/lib/sim-objects.adp 12 Nov 2003 15:24:02 -0000 1.1 @@ -0,0 +1,7 @@ +

+ + +

+ » Create new object +

+
\ No newline at end of file Index: openacs-4/packages/simulation/lib/sim-objects.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/sim-objects.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/simulation/lib/sim-objects.tcl 12 Nov 2003 15:24:02 -0000 1.1 @@ -0,0 +1,108 @@ +simulation::include_contract { + Displays a list of simulation objects for the current simulation package instance. + + @author Joel Aufrecht + @creation-date 2003-11-12 + @cvs-id $Id: sim-objects.tcl,v 1.1 2003/11/12 15:24:02 peterm Exp $ +} { + display_mode { + allowed_values {edit display} + default_value display + } + size { + allowed_values {short long} + default_value long + } +} + +set package_id [ad_conn package_id] + +if { ![exists_and_not_null parent_id] } { + set parent_id [bcms::folder::get_id_by_package_id -parent_id 0] +} + +set elements { + object_type_pretty { + label "Type" + orderby upper(ot.pretty_name) + } + title { + label "Name" + orderby r.title + link_url_col view_url + } +} + +if { [string equal $display_mode "edit"] } { + # Put an edit link first + set elements [concat { + edit { + sub_class narrow + link_url_col edit_url + display_template { + Edit + } + } + } $elements] +} + +if { [string equal $size "long"] } { + set elements [concat $elements { + description { + label "Description" + orderby r.description + } + }] +} + +if { [string equal $display_mode "edit"] } { + # Put a delete link last + set elements [concat $elements { + delete { + sub_class narrow + link_url_col delete_url + display_template { + Edit + } + } + }] +} + +template::list::create \ + -name objects \ + -multirow objects \ + -elements $elements + +db_multirow -extend { edit_url view_url delete_url } objects select_objects " + select i.item_id, + i.name, + r.title, + r.description, + r.mime_type, + i.content_type, + ot.pretty_name as object_type_pretty + from cr_folders f, + cr_items i, + cr_revisions r, + acs_object_types ot + where f.package_id = :package_id + and i.parent_id = f.folder_id + and r.revision_id = i.live_revision + and ot.object_type = i.content_type + [template::list::orderby_clause -orderby -name "objects"] +" { + set description [string_truncate -len 200 $description] + set edit_url [export_vars -base "object-edit" { item_id }] + set delete_url [export_vars -base "object-delete" { item_id }] + + switch -glob $mime_type { + text/* - {} { + set view_url [export_vars -base "object/$name"] + } + default { + set view_url [export_vars -base "object-content/$name"] + } + } +} + +set create_object_url [export_vars -base object-edit { parent_id }] Index: openacs-4/packages/simulation/www/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/index.adp,v diff -u -r1.15 -r1.16 --- openacs-4/packages/simulation/www/index.adp 12 Nov 2003 14:51:16 -0000 1.15 +++ openacs-4/packages/simulation/www/index.adp 12 Nov 2003 15:24:03 -0000 1.16 @@ -28,7 +28,7 @@

CITYBUILD

-

+
Index: openacs-4/packages/simulation/www/object-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/Attic/object-list.adp,v diff -u -r1.4 -r1.5 --- openacs-4/packages/simulation/www/object-list.adp 11 Nov 2003 15:32:46 -0000 1.4 +++ openacs-4/packages/simulation/www/object-list.adp 12 Nov 2003 15:24:03 -0000 1.5 @@ -2,12 +2,8 @@ @page_title;noquote@ @context;noquote@ -

+ -

- » Create new object -

-

Map XML

@@ -22,4 +18,4 @@

» Generate Map XML file and send notifications

-
\ No newline at end of file + Index: openacs-4/packages/simulation/www/object-list.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/Attic/object-list.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/simulation/www/object-list.tcl 11 Nov 2003 15:32:46 -0000 1.11 +++ openacs-4/packages/simulation/www/object-list.tcl 12 Nov 2003 15:24:03 -0000 1.12 @@ -13,80 +13,6 @@ set package_id [ad_conn package_id] set admin_p [permission::permission_p -object_id $package_id -privilege admin] -if { ![exists_and_not_null parent_id] } { - set parent_id [bcms::folder::get_id_by_package_id -parent_id 0] -} - -template::list::create \ - -name objects \ - -multirow objects \ - -elements { - edit { - sub_class narrow - link_url_col edit_url - display_template { - Edit - } - } - object_type_pretty { - label "Type" - orderby upper(ot.pretty_name) - } - title { - label "Name" - orderby r.title - link_url_col view_url - } - description { - label "Description" - orderby r.description - } - delete { - sub_class narrow - link_url_col delete_url - display_template { - Edit - } - } - } - - -set package_id [ad_conn package_id] - -db_multirow -extend { edit_url view_url delete_url } objects select_objects " - select i.item_id, - i.name, - r.title, - r.description, - r.mime_type, - i.content_type, - ot.pretty_name as object_type_pretty - from cr_folders f, - cr_items i, - cr_revisions r, - acs_object_types ot - where f.package_id = :package_id - and i.parent_id = f.folder_id - and r.revision_id = i.live_revision - and ot.object_type = i.content_type - [template::list::orderby_clause -orderby -name "objects"] -" { - set description [string_truncate -len 200 $description] - set edit_url [export_vars -base "object-edit" { item_id }] - set delete_url [export_vars -base "object-delete" { item_id }] - - switch -glob $mime_type { - text/* - {} { - set view_url [export_vars -base "object/$name"] - } - default { - set view_url [export_vars -base "object-content/$name"] - } - } -} - -set create_object_url [export_vars -base object-edit { parent_id }] - set notification_widget [notification::display::request_widget \ -type [simulation::notification::xml_map::type_short_name] \ -object_id [ad_conn package_id] \