Index: openacs-4/contrib/packages/simulation/lib/object-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/lib/Attic/object-display.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/contrib/packages/simulation/lib/object-display.tcl 14 Nov 2003 09:48:54 -0000 1.9 +++ openacs-4/contrib/packages/simulation/lib/object-display.tcl 14 Nov 2003 11:40:35 -0000 1.10 @@ -84,7 +84,7 @@ if { [permission::write_permission_p -object_id $item(item_id) -party_id [ad_conn untrusted_user_id]] } { - set edit_url [export_vars -base [ad_conn package_url]object-edit { { item_id $item(item_id) } }] + set edit_url [export_vars -base [ad_conn package_url]citybuild/object-edit { { item_id $item(item_id) } }] set delete_url [export_vars -base [ad_conn package_url]object-delete { { item_id $item(item_id) } }] } @@ -93,12 +93,15 @@ # Serve stylesheet # ##### - -if { [exists_and_not_null content(stylesheet)] } { - array set item [bcms::item::get_item -item_id $content(stylesheet)] - +set related_stylesheets [bcms::item::list_related_items \ + -item_id $item(item_id) \ + -relation_tag stylesheet \ + -return_list] +set first_stylesheet [lindex $related_stylesheets 0] +set stylesheet_id [ns_set get $first_stylesheet item_id] +if { [exists_and_not_null stylesheet_id] } { + array set item [bcms::item::get_item -item_id $stylesheet_id] set stylesheet_url [file join [ad_conn package_url] object-content $item(name)] } else { set stylesheet_url {} } - Index: openacs-4/contrib/packages/simulation/tcl/simulation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/tcl/Attic/simulation-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/contrib/packages/simulation/tcl/simulation-procs.tcl 13 Nov 2003 13:44:36 -0000 1.11 +++ openacs-4/contrib/packages/simulation/tcl/simulation-procs.tcl 14 Nov 2003 11:40:35 -0000 1.12 @@ -15,6 +15,11 @@ ad_proc -public simulation::include_contract { args } { Used to define which parameters an include expecs. +

+ NOTE: This proc is to be replaced with a refactored ad_page_contract that + can function for includes. Lars knows more. +

+ @param args A list where the first element is an explanation of what the include does, who wrote it when etc. The second element is the optional param spec which is an array list where the keys are parameter (variable) @@ -63,10 +68,6 @@

-

- TODO: Have Lars review this proc and then move it into core -

- @author Peter Marklund } { set description [lindex $args 0] Index: openacs-4/contrib/packages/simulation/www/citybuild/object-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/simulation/www/citybuild/Attic/object-edit.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/simulation/www/citybuild/object-edit.tcl 13 Nov 2003 14:55:26 -0000 1.2 +++ openacs-4/contrib/packages/simulation/www/citybuild/object-edit.tcl 14 Nov 2003 11:40:35 -0000 1.3 @@ -15,6 +15,7 @@ # Get data for existing object array set item_info [bcms::item::get_item -item_id $item_id -revision live] item::get_revision_content $item_info(revision_id) + if {! [info exists content(text)] } { set content(text) "" } @@ -640,6 +641,7 @@ from cr_item_rels where item_id = :item_id } { + ns_log Notice "pm debug $related_object_id $relation_tag" set "rel__${relation_tag}__${order_n}" $related_object_id } @@ -678,7 +680,7 @@ delete from cr_item_rels where item_id = :item_id } - + foreach elm $rel_elements { # LARS HACK ALERT: This isn't a particularly pretty way to find all the related objects in the form regexp {__(.+)__} $elm match relation_tag Index: openacs-4/packages/simulation/lib/object-display.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/lib/object-display.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/simulation/lib/object-display.tcl 14 Nov 2003 09:48:54 -0000 1.9 +++ openacs-4/packages/simulation/lib/object-display.tcl 14 Nov 2003 11:40:35 -0000 1.10 @@ -84,7 +84,7 @@ if { [permission::write_permission_p -object_id $item(item_id) -party_id [ad_conn untrusted_user_id]] } { - set edit_url [export_vars -base [ad_conn package_url]object-edit { { item_id $item(item_id) } }] + set edit_url [export_vars -base [ad_conn package_url]citybuild/object-edit { { item_id $item(item_id) } }] set delete_url [export_vars -base [ad_conn package_url]object-delete { { item_id $item(item_id) } }] } @@ -93,12 +93,15 @@ # Serve stylesheet # ##### - -if { [exists_and_not_null content(stylesheet)] } { - array set item [bcms::item::get_item -item_id $content(stylesheet)] - +set related_stylesheets [bcms::item::list_related_items \ + -item_id $item(item_id) \ + -relation_tag stylesheet \ + -return_list] +set first_stylesheet [lindex $related_stylesheets 0] +set stylesheet_id [ns_set get $first_stylesheet item_id] +if { [exists_and_not_null stylesheet_id] } { + array set item [bcms::item::get_item -item_id $stylesheet_id] set stylesheet_url [file join [ad_conn package_url] object-content $item(name)] } else { set stylesheet_url {} } - Index: openacs-4/packages/simulation/tcl/simulation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/tcl/simulation-procs.tcl,v diff -u -r1.11 -r1.12 --- openacs-4/packages/simulation/tcl/simulation-procs.tcl 13 Nov 2003 13:44:36 -0000 1.11 +++ openacs-4/packages/simulation/tcl/simulation-procs.tcl 14 Nov 2003 11:40:35 -0000 1.12 @@ -15,6 +15,11 @@ ad_proc -public simulation::include_contract { args } { Used to define which parameters an include expecs. +

+ NOTE: This proc is to be replaced with a refactored ad_page_contract that + can function for includes. Lars knows more. +

+ @param args A list where the first element is an explanation of what the include does, who wrote it when etc. The second element is the optional param spec which is an array list where the keys are parameter (variable) @@ -63,10 +68,6 @@

-

- TODO: Have Lars review this proc and then move it into core -

- @author Peter Marklund } { set description [lindex $args 0] Index: openacs-4/packages/simulation/www/citybuild/object-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/simulation/www/citybuild/object-edit.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/simulation/www/citybuild/object-edit.tcl 13 Nov 2003 14:55:26 -0000 1.2 +++ openacs-4/packages/simulation/www/citybuild/object-edit.tcl 14 Nov 2003 11:40:35 -0000 1.3 @@ -15,6 +15,7 @@ # Get data for existing object array set item_info [bcms::item::get_item -item_id $item_id -revision live] item::get_revision_content $item_info(revision_id) + if {! [info exists content(text)] } { set content(text) "" } @@ -640,6 +641,7 @@ from cr_item_rels where item_id = :item_id } { + ns_log Notice "pm debug $related_object_id $relation_tag" set "rel__${relation_tag}__${order_n}" $related_object_id } @@ -678,7 +680,7 @@ delete from cr_item_rels where item_id = :item_id } - + foreach elm $rel_elements { # LARS HACK ALERT: This isn't a particularly pretty way to find all the related objects in the form regexp {__(.+)__} $elm match relation_tag