Index: openacs-4/packages/assessment/www/asm-admin/item-edit-general.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit-general.tcl,v
diff -u -r1.12 -r1.13
--- openacs-4/packages/assessment/www/asm-admin/item-edit-general.tcl 7 Aug 2006 01:19:35 -0000 1.12
+++ openacs-4/packages/assessment/www/asm-admin/item-edit-general.tcl 3 Sep 2006 17:00:20 -0000 1.13
@@ -174,6 +174,11 @@
}
set as_item_id $new_item_id
set section_id $new_section_id
+
+ application_data_link::update_links_from \
+ -object_id $as_item_id \
+ -text $question_text
+
} -after_submit {
if {$old_display_type == $display_type} {
ad_returnredirect [export_vars -base "item-edit" {assessment_id section_id as_item_id}]
Index: openacs-4/packages/assessment/www/asm-admin/item-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/assessment/www/asm-admin/item-edit.tcl,v
diff -u -r1.8 -r1.9
--- openacs-4/packages/assessment/www/asm-admin/item-edit.tcl 12 Jul 2006 06:01:40 -0000 1.8
+++ openacs-4/packages/assessment/www/asm-admin/item-edit.tcl 3 Sep 2006 17:00:20 -0000 1.9
@@ -41,9 +41,24 @@
{description:text(textarea) {label "[_ assessment.Description]"} {html {rows 5 cols 80}} {value $description} {help_text "[_ assessment.item_Description_help]"}}
}
-if {[db_0or1row get_item_content {}]} {
+set linked_objects [application_data_link::get_links_from -object_id $as_item_id]
+if {[llength $linked_objects]} {
+ foreach l $linked_objects {
+ acs_object::get -object_id $l -array object
+ if {$object(object_type) eq "content_item"} {
+ set object(object_type) [content::item::get_content_type -item_id $l]
+ }
+ set link_type o
+ if {$object(object_type) eq "image"} {
+ set link_type image
+ }
+ if {$object(object_type) eq "content_revision"} {
+ set link_type file
+ }
+ append links "$object(title)
"
+ }
ad_form -extend -name item_edit -form {
- {content:text(inform),optional {label "[_ assessment.item_display_Content]"} {value {$content_name}} {help_text "[_ assessment.item_Content_help]"}}
+ {content:text(inform),optional {label "[_ assessment.item_display_Content]"} {value {$links}} {help_text "[_ assessment.item_Content_help]"}}
}
}