Index: openacs-4/packages/lors/lib/course-structure.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lib/course-structure.adp,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lors/lib/course-structure.adp 13 Jun 2006 02:16:23 -0000 1.3 +++ openacs-4/packages/lors/lib/course-structure.adp 6 Apr 2007 19:27:00 -0000 1.4 @@ -147,6 +147,10 @@ </tr> </table> </div> +<if @extra_admin_html@ not nil> + @extra_admin_html;noquote@ +</if> + <table class="list" cellpadding="3" cellspacing="1" width="70%"> <tr class="list-header"> <th class="list" valign="top" style="background-color: #e0e0e0; font-weight: bold;" colspan="2"> @@ -168,6 +172,4 @@ </table> - - -<listtemplate name="blah"></listtemplate> \ No newline at end of file +<listtemplate name="blah"></listtemplate> Index: openacs-4/packages/lors/lib/course-structure.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lib/course-structure.tcl,v diff -u -r1.7 -r1.8 --- openacs-4/packages/lors/lib/course-structure.tcl 29 Dec 2006 02:32:59 -0000 1.7 +++ openacs-4/packages/lors/lib/course-structure.tcl 6 Apr 2007 19:27:00 -0000 1.8 @@ -10,6 +10,8 @@ @cvs-id $Id$ @param man_id manifest id of course + @param exclude list of cr_items.item_ids of ims_cp_items to exclude from + the display (optional) } set package_id [ad_conn package_id] set community_id [dotlrn_community::get_community_id] @@ -96,16 +98,26 @@ set pretty_types_map {as_sections Questions ::xowiki::Page Content} template::multirow create blah course_name delete down folder_id fs_package_id hasmetadata href identifierref indent isshared item_id item_title object_id org_id res_identifier type up db_multirow organizations organizations { } { } -template::multirow foreach organizations { - set total_items [db_string items_count {select count(*) from ims_cp_items where org_id=:org_id} -default 0] +if {[info exists exclude] && [llength $exclude]} { + set exclude_where " and i.ims_item_id not in ([template::util::tcl_to_sql_list $exclude]) " +} else { + set exclude_where "" + set exclude {} +} + +template::multirow foreach organizations { + + set total_items [db_string items_count "select count(*) from ims_cp_items i where org_id=:org_id $exclude_where" -default 0] # We get the indent of the items in this org_id - set indent_list [lorsm::get_items_indent -org_id $org_id] + set indent_list [lorsm::get_items_indent -org_id $org_id -exclude $exclude] template::util::list_of_lists_to_array $indent_list indent_array ns_log notice "BEFORE MULTIROW [template::multirow size blah]" + db_multirow blah blah "" { - - set indent [string repeat " " [expr {$indent_array($item_id)-1}]] + if {[info exists indent_array($item_id)]} { + set indent [string repeat " " [expr {$indent_array($item_id)-1}]] + } else { set indent 1 } if {$type eq "webcontent" && ![string equal $identifierref {}]} { set href "[apm_package_url_from_id_mem $fs_package_id]view/[db_string select_folder_key {select key from fs_folders where folder_id = :folder_id}]/[lorsm::fix_url -url $identifierref]" } else { @@ -132,7 +144,7 @@ set sharer_url [export_vars -base sharer {man_id folder_id return_url}] set formater_url [export_vars -base formater {man_id return_url}] -set add_type_options [list [list Questions assessment] [list Content wiki]] +set add_type_options [list [list Questions assessment] [list "Site Content" wiki] [list "Course Content" webcontent]] ad_form -name add-new -action object-new -export {man_id} -form { {add_type:text(select) {label ""} {options $add_type_options}} {add_new:text(submit) {label {[_ acs-kernel.common_Add]}}} Index: openacs-4/packages/lors/lib/course-structure.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lib/course-structure.xql,v diff -u -r1.3 -r1.4 --- openacs-4/packages/lors/lib/course-structure.xql 13 Jun 2006 02:16:24 -0000 1.3 +++ openacs-4/packages/lors/lib/course-structure.xql 6 Apr 2007 19:27:00 -0000 1.4 @@ -166,6 +166,7 @@ ) AND m.man_id = :man_id + $exclude_where ORDER BY i.sort_order,o.tree_sortkey,o.object_id Index: openacs-4/packages/lors/lib/object-new.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/lors/lib/object-new.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/lors/lib/object-new.tcl 12 Jun 2006 01:52:19 -0000 1.2 +++ openacs-4/packages/lors/lib/object-new.tcl 6 Apr 2007 19:27:00 -0000 1.3 @@ -31,7 +31,10 @@ lappend options [list $title $item_id] } } - + webcontent { + ad_returnredirect [export_vars -base item-add-edit {man_id}] + ad_script_abort + } } set search_p 0 @@ -85,12 +88,14 @@ -res_id $res_id } + # FIXME see if anyone is using this resource # already. objects should be # able to be resources # without being tied to one manifest, # since you can use # a resource in more than one course and # it doesn't make # sense to have a seperate row every time # we reuse an - # object + # object DAVEB 2070321 - of course, it adds complexity and + # special handling, and this works for now. } }