Index: openacs-4/contrib/packages/bcms/sql/postgresql/bcms-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/sql/postgresql/bcms-create.sql,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/bcms/sql/postgresql/bcms-create.sql 4 Oct 2003 08:53:05 -0000 1.5 +++ openacs-4/contrib/packages/bcms/sql/postgresql/bcms-create.sql 5 Oct 2003 12:28:03 -0000 1.6 @@ -23,9 +23,8 @@ --select acs_attribute__create_attribute ('bcms_navlink', 'sort_key', 'integer', 'Sort Key', 'Sort Keys', null, null, null, 1, 1, null, 'type_specific', 'f'); -- create the relations, bcms_page may relate to another page, file, image ---select content_type__register_relation_type ('bcms_page', 'bcms_page', 'pages', '0', null); ---select content_type__register_relation_type ('bcms_page', 'bcms_file', 'files', '0', null); ---select content_type__register_relation_type ('bcms_page', 'image', 'images', '0', null); +select content_type__register_relation_type ('content_revision', 'content_revision', 'pages', '0', null); +select content_type__register_relation_type ('content_revision', 'image', 'images', '0', null); create or replace function bcms__get_title(integer, varchar) returns varchar as ' Index: openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs-postgresql.xql,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs-postgresql.xql 4 Aug 2003 11:19:46 -0000 1.2 +++ openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs-postgresql.xql 5 Oct 2003 12:28:03 -0000 1.3 @@ -43,7 +43,7 @@ where f.folder_id = i.item_id and i.tree_sortkey between p.tree_sortkey and tree_right(p.tree_sortkey) - and i.item_id <> p.item_id + $addtnl_where order by i.tree_sortkey Index: openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs.tcl 4 Oct 2003 08:53:05 -0000 1.5 +++ openacs-4/contrib/packages/bcms/tcl/bcms-folder-procs.tcl 5 Oct 2003 12:28:03 -0000 1.6 @@ -194,6 +194,7 @@ {-prepend_path "./"} {-multirow_name bcms_list_folders} {-return_list:boolean false} + {-include_parent:boolean} } { similar to list_folders but also gives the subfolders underneath it gives some more addtional columns @@ -203,6 +204,7 @@ @param multirow_name you can supply your own multirow name @param return_list if supplied it returns a list of ns_sets otherwise it returns a multirow uses the multirow_name if given + @param include_parent if supplied, it will also include info about the parent @return this columns: folder_id, name, parent_id, label, has_child_folders, has_child_symlinks, package_id, level, parent_level, path @@ -217,6 +219,12 @@ set parent_id [get_bcms_root_folder] } + if {[info exists include_parent_p]} { + set addtnl_where "" + } else { + set addtnl_where "and i.item_id <> p.item_id" + } + if $return_list_p { # return a list of lists return [db_list_of_ns_sets get_cr_folders "SQL"] Index: openacs-4/contrib/packages/bcms/tcl/bcms-item-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-item-procs-postgresql.xql,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/bcms/tcl/bcms-item-procs-postgresql.xql 4 Oct 2003 08:53:05 -0000 1.5 +++ openacs-4/contrib/packages/bcms/tcl/bcms-item-procs-postgresql.xql 5 Oct 2003 12:28:03 -0000 1.6 @@ -101,7 +101,8 @@ select i.item_id, i.name, i.live_revision, i.latest_revision, i.publish_status, - i.content_type, i.storage_type, ir.rel_id, ir.order_n + i.content_type, i.storage_type, ir.rel_id, ir.order_n, + content_item__get_path(i.item_id, ir.item_id) as path $addtnl_select from cr_items i, cr_item_rels ir $addtnl_from Index: openacs-4/contrib/packages/bcms/tcl/bcms-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-procs.tcl,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/packages/bcms/tcl/bcms-procs.tcl 4 Oct 2003 08:53:05 -0000 1.3 +++ openacs-4/contrib/packages/bcms/tcl/bcms-procs.tcl 5 Oct 2003 12:28:03 -0000 1.4 @@ -201,18 +201,13 @@ if {![info exists creation_user_id]} { set creation_user_id [ad_conn user_id] } if {![info exists creation_ip]} { set creation_ip [ad_conn peeraddr] } - # get the file properties - set upload_filename [template::util::file::get_property filename $upload_file] - set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] - set upload_mime_type [template::util::file::get_property mime_type $upload_file] - db_transaction { set file_id [bcms::item::create_item -item_name $file_name -parent_id $folder_id -content_type $content_type \ -storage_type file -creation_user_id $creation_user_id -creation_ip $creation_ip] set revision_id [bcms::revision::upload_file_revision -item_id $file_id \ - -title $title -description $description \ - -upload_filename $upload_filename -upload_tmpfile $upload_tmpfile -mime_type $upload_mime_type \ + -title $title -description $description \ + -upload_file $upload_file \ -creation_user_id $creation_user_id -creation_ip $creation_ip] } Index: openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl,v diff -u -r1.5 -r1.6 --- openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl 4 Oct 2003 08:53:05 -0000 1.5 +++ openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.tcl 5 Oct 2003 12:28:03 -0000 1.6 @@ -47,13 +47,15 @@ set addtnl_values "" set addtnl_properties_list {} set addtnl_values_list {} - foreach {property value} $additional_properties { - lappend addtnl_properties_list $property - lappend addtnl_values_list :__$property - set __$property $value + if {[exists_and_not_null additional_properties]} { + foreach {property value} $additional_properties { + lappend addtnl_properties_list $property + lappend addtnl_values_list :__$property + set __$property $value + } + set addtnl_properties ",[join $addtnl_properties_list ","]" + set addtnl_values ",[join $addtnl_values_list ","]" } - set addtnl_properties ",[join $addtnl_properties_list ","]" - set addtnl_values ",[join $addtnl_values_list ","]" if ![info exists content_type] { set content_type [bcms::item::get_content_type -item_id $item_id] @@ -75,9 +77,8 @@ {-title:required} {-content_type} {-description ""} - {-upload_tmpfile:required} - {-upload_filename:required} - {-mime_type "application/octet-stream"} + {-upload_file:required} + {-mime_type} {-creation_user_id} {-creation_ip} {-additional_properties} @@ -105,9 +106,11 @@ } set table_name [bcms::get_table_name -object_type $content_type] - set file_extension [string trimleft [file extension $upload_filename] "."] - if [string equal $file_extension ""] { - ad_return_complaint 1 "please specify file extension" + # get the file properties + set upload_filename [template::util::file::get_property filename $upload_file] + set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] + if {![info exists mime_type]} { + set mime_type [template::util::file::get_property mime_type $upload_file] } # check the mime type if it does not exists insert it if ![db_0or1row check_mime "SQL"] { @@ -119,32 +122,25 @@ set addtnl_values "" set addtnl_properties_list {} set addtnl_values_list {} - foreach {property value} $additional_properties { - lappend addtnl_properties_list $property - lappend addtnl_values_list :__$property - set __$property $value + if {[exists_and_not_null additional_properties]} { + foreach {property value} $additional_properties { + lappend addtnl_properties_list $property + lappend addtnl_values_list :__$property + set __$property $value + } + set addtnl_properties ",[join $addtnl_properties_list ","]" + set addtnl_values ",[join $addtnl_values_list ","]" } - set addtnl_properties ",[join $addtnl_properties_list ","]" - set addtnl_values ",[join $addtnl_values_list ","]" db_transaction { - # if we are editing a existing revision then lets get the next object_id - if ![info exists revision_id] { - set revision_id [bcms::get_next_objectid] - set insert_revision_p 1 - } else { - set insert_revision_p 0 - } - + set revision_id [bcms::get_next_objectid] # create the file in the file system and get its name and size set tmp_filename [cr_create_content_file $item_id $revision_id $upload_tmpfile] set tmp_filesize [cr_file_size $tmp_filename] # since we are using the file system we will set content to the filename in the fs set content $tmp_filename - if {$insert_revision_p} { - db_dml insert_revision "SQL" - } + db_dml insert_revision "SQL" db_dml update_file_size "SQL" } @@ -168,15 +164,37 @@ } } -# TODO: need to rehash this for binary content later ad_proc -public bcms::revision::get_revision { {-revision_id:required} + {-additional_properties} } { Get the revision info on a single revision - returns an array that contains item_id, name, title, description, + + @param revision_id revision_id of the version you want to retrieve + @param additional_properties a list of property names that you add to the array returned + + @returns an array that contains item_id, name, title, description, content, content_type, publish_status, latest_revision, live_revision, storage_type + and whatever additional_properties is supplied } { + set addtnl_select "" + set addtnl_from "" + set addtnl_where "" + # lets determine the content type and query from that view + if {[info exists additional_properties]} { + if {[db_0or1row get_1revision "SQL" -column_array one_revision]} { + set content_type [bcms::item::get_content_type -item_id $one_revision(item_id)] + set table_name [bcms::get_table_name -object_type $content_type] + + set addtnl_select ", x.[join $additional_properties ", x."]" + set addtnl_from ", ${table_name}x x" + set addtnl_where "and r.revision_id = x.revision_id" + } else { + error "unable to determine content type" + } + } + if {[db_0or1row get_1revision "SQL" -column_array one_revision]} { return [array get one_revision] } else { @@ -190,10 +208,10 @@ {-title} {-description} {-content} - {-upload_tmpfile} + {-upload_file} {-mime_type} } { - Edit a revision's title, description and content + Edit a revision's title, description, mime type, content and binary content } { set update_list [list] @@ -211,9 +229,30 @@ lappend update_list "mime_type = :mime_type" } - set update_string [join $update_list ","] - db_dml update_revision "SQL" + db_transaction { + if {[info exists upload_file]} { + # if we are uploading a file, then overwrite the existing one + array set one_revision [bcms::revision::get_revision -revision_id $revision_id] + set item_id $one_revision(item_id) + # create the file in the file system and get its name and size + set upload_tmpfile [template::util::file::get_property tmp_filename $upload_file] + set tmp_filename [cr_create_content_file $item_id $revision_id $upload_tmpfile] + set tmp_filesize [cr_file_size $tmp_filename] + set content $tmp_filename + if {![info exists content]} { + lappend update_list "content = :content" + } + lappend update_list "content_length = :tmp_filesize" + if {![info exists mime_type]} { + set mime_type [template::util::file::get_property mime_type $upload_file] + lappend update_list "mime_type = :mime_type" + } + } + set update_string [join $update_list ","] + db_dml update_revision "SQL" + } + } ad_proc -public bcms::revision::delete_revision { Index: openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.xql,v diff -u -r1.3 -r1.4 --- openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.xql 4 Oct 2003 08:53:05 -0000 1.3 +++ openacs-4/contrib/packages/bcms/tcl/bcms-revision-procs.xql 5 Oct 2003 12:28:03 -0000 1.4 @@ -20,9 +20,9 @@ - select mime_type + select 1 from cr_mime_types - where file_extension = :file_extension + where mime_type = :mime_type @@ -46,10 +46,10 @@ select i.item_id, i.name, r.title, r.description, r.content, - i.content_type, i.publish_status, i.live_revision, i.latest_revision, i.storage_type - from cr_revisions r, cr_items i + i.content_type, i.publish_status, i.live_revision, i.latest_revision, i.storage_type $addtnl_select + from cr_revisions r, cr_items i $addtnl_from where r.revision_id = :revision_id - and i.item_id = r.item_id + and i.item_id = r.item_id $addtnl_where Index: openacs-4/contrib/packages/bcms-ui-base/bcms-ui-base.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/bcms-ui-base.info,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/bcms-ui-base/bcms-ui-base.info 22 Sep 2003 07:36:46 -0000 1.2 +++ openacs-4/contrib/packages/bcms-ui-base/bcms-ui-base.info 5 Oct 2003 12:28:03 -0000 1.3 @@ -12,16 +12,14 @@ Base BCMS UI to provide the minimum set of UI functionality. Base BCMS UI to provide the minimum set of UI functionality. You can copy this package and extend it to create your own. - + - - + + Index: openacs-4/contrib/packages/bcms-ui-base/resources/image-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/resources/image-form.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/bcms-ui-base/resources/image-form.tcl 4 Oct 2003 08:44:51 -0000 1.1 +++ openacs-4/contrib/packages/bcms-ui-base/resources/image-form.tcl 5 Oct 2003 12:28:03 -0000 1.2 @@ -50,8 +50,8 @@ {title:text(text) {label "Title"}} {description:text(textarea),optional {html {rows 5 cols 80}} {label "Description"}} - {width:integer(text) {label "Width"}} - {height:integer(text) {label "Height"}} + {width:integer(text),optional {label "Width"}} + {height:integer(text),optional {label "Height"}} {upload_image:file(file),optional {label "Image"}} {folder_id:integer(hidden),optional {value $folder_id}} {image_id:integer(hidden),optional {value $image_id}} @@ -65,19 +65,26 @@ } } -edit_request { - array set one_revision [bcms::revision::get_revision -revision_id $revision_id] + array set one_revision [bcms::revision::get_revision -revision_id $revision_id -additional_properties {width height}] set image_id $one_revision(item_id) set image_name $one_revision(name) set title $one_revision(title) set content $one_revision(content) set description $one_revision(description) + set width $one_revision(width) + set height $one_revision(height) - ad_set_form_values image_id image_name title content description + ad_set_form_values image_id image_name title content description width height } -edit_data { - bcms::revision::set_revision -revision_id $revision_id \ - -title $title -description $description + if {[exists_and_not_null upload_image]} { + bcms::revision::set_revision -revision_id $revision_id \ + -title $title -description $description -mime_type $upload_mime_type -upload_file $upload_file + } else { + bcms::revision::set_revision -revision_id $revision_id \ + -title $title -description $description + } if {[info exists image_name]} { bcms::item::set_item -item_id $image_id -name $image_name # we have renamed the image, we need to redirect on the new name @@ -98,19 +105,17 @@ if {![info exists creation_user_id]} { set creation_user_id [ad_conn user_id] } if {![info exists creation_ip]} { set creation_ip [ad_conn peeraddr] } - # get the file properties - set upload_filename [template::util::file::get_property filename $upload_image] - set upload_tmpfile [template::util::file::get_property tmp_filename $upload_image] - set upload_mime_type [template::util::file::get_property mime_type $upload_image] - db_transaction { set file_id [bcms::item::create_item -item_name $image_name -parent_id $folder_id -content_type image \ -storage_type file -creation_user_id $creation_user_id -creation_ip $creation_ip] + set additional_properties {} + if {[exists_and_not_null width]} { lappend additional_properties "width $width" } + if {[exists_and_not_null height]} { lappend additional_properties "height $height" } set revision_id [bcms::revision::upload_file_revision -item_id $file_id \ -title $title -description $description \ - -upload_filename $upload_filename -upload_tmpfile $upload_tmpfile -mime_type $upload_mime_type \ - -creation_user_id $creation_user_id -creation_ip $creation_ip -additional_properties "width $width height $height"] + -upload_file $upload_image \ + -creation_user_id $creation_user_id -creation_ip $creation_ip -additional_properties $additional_properties] } Index: openacs-4/contrib/packages/bcms-ui-base/resources/search-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/resources/search-postgresql.xql,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/bcms-ui-base/resources/search-postgresql.xql 22 Sep 2003 07:36:46 -0000 1.1 +++ openacs-4/contrib/packages/bcms-ui-base/resources/search-postgresql.xql 5 Oct 2003 12:28:03 -0000 1.2 @@ -20,6 +20,7 @@ (select tree_sortkey, item_id from cr_items where item_id = :root_folder_id) r $openfts_from where tree_ancestor_p(r.tree_sortkey, i.tree_sortkey) and ao.object_id = i.item_id + and i.item_id <> r.item_id $openfts_where [template::list::page_where_clause -key i.item_id -and -name search_results] ) results @@ -33,17 +34,18 @@ select * from ( - select item_id, - name, - parent_id, + select i.item_id, + i.name, + i.parent_id, case when i.content_type = 'content_folder' then content_folder__get_label(i.item_id) else bcms__get_title(i.item_id, 'latest') end as title, - live_revision, - content_type, + i.live_revision, + i.content_type, to_char(ao.last_modified,'YYYY-MM-DD HH:MM AM') as last_modified from cr_items i, acs_objects ao, - (select tree_sortkey from cr_items where item_id = :root_folder_id) r $openfts_from + (select tree_sortkey, item_id from cr_items where item_id = :root_folder_id) r $openfts_from where tree_ancestor_p(r.tree_sortkey, i.tree_sortkey) and ao.object_id = i.item_id + and i.item_id <> r.item_id $openfts_where ) results where 1 = 1 Index: openacs-4/contrib/packages/bcms-ui-base/resources/search.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/resources/search.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/bcms-ui-base/resources/search.tcl 4 Oct 2003 08:44:51 -0000 1.2 +++ openacs-4/contrib/packages/bcms-ui-base/resources/search.tcl 5 Oct 2003 12:28:03 -0000 1.3 @@ -1,21 +1,17 @@ -ad_page_contract { - display search results +# display search results - supply the following vars: - name_search:optional - title_search:optional - content_search:optional - content_type_search:optional - {display_search_results:optional 0} - {bulk_actions:optional ""} - {bulk_action_export_vars:optional ""} - {orderby:optional} - {page:optional} +# supply the following vars: +# name_search:optional +# title_search:optional +# content_search:optional +# content_type_search:optional +# {display_search_results:optional 0} +# {bulk_actions:optional ""} +# {bulk_action_export_vars:optional ""} +# {orderby:optional} +# {page:optional} -} { -} - if {[info exists name_search] && [empty_string_p $name_search]} { unset name_search } @@ -28,6 +24,15 @@ if {[info exists content_type_search] && [empty_string_p $content_type_search]} { unset content_type_search } +if {![info exists display_search_results]} { + set display_search_results 0 +} +if {![info exists bulk_actions]} { + set bulk_actions "" +} +if {![info exists bulk_action_export_vars]} { + set bulk_action_export_vars "" +} if {$display_search_results} { @@ -52,14 +57,18 @@ # on the local tcl name space and also add them to the filters set bulk_action_export_vars_filter "" foreach export_var $bulk_action_export_vars { - upvar 1 $export_var $export_var + if {![info exists $export_var]} { + # lets just make sure that it does not exist on the local namespace + upvar 1 $export_var $export_var + } append bulk_action_export_vars_filter " $export_var { add_url_eval {[export_vars $export_var]} } " } set filters " + $bulk_action_export_vars_filter display_search_results {} title_search { where_clause {title ilike '%' || :title_search || '%'} @@ -71,7 +80,6 @@ content_type_search { where_clause {content_type = :content_type_search} } - $bulk_action_export_vars_filter " template::list::create \ @@ -138,10 +146,15 @@ template::element::create simpleform name_search -widget text -label "Name" -datatype string -optional template::element::create simpleform title_search -widget text -label "Title" -datatype string -optional template::element::create simpleform content_search -widget text -label "Published Content" -datatype string -optional + if {[exists_and_not_null content_type_search]} { + template::element::create simpleform content_type_search -widget hidden -value $content_type_search + } template::element::create simpleform display_search_results -widget hidden -value 1 foreach export_var $bulk_action_export_vars { upvar 1 $export_var export_var_local - template::element::create simpleform $export_var -widget hidden -value $export_var_local -datatype string + if {![template::element::exists simpleform $export_var]} { + template::element::create simpleform $export_var -widget hidden -value $export_var_local -datatype string + } } # we need to put this dummy one even we dont use it Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/page-view.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/page-view.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/page-view.tcl 4 Oct 2003 08:46:40 -0000 1.2 +++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/page-view.tcl 5 Oct 2003 12:28:03 -0000 1.3 @@ -6,19 +6,19 @@ array set page_revision [bcms::revision::get_revision -revision_id $revision_id] -set current_url [ad_return_url -urlencode] -set current_url_unencoded [ad_return_url] +set return_url [ad_return_url] set package_url [ad_conn package_url] # we will only allow edits on the latest version, else you can only view them if {$revision_id == $page_revision(latest_revision)} { set context_action " -Edit this Page -Template this Page -Publish this Page -Categorize this Page -View Version(s) -Relate Page" +Edit this Page +Template this Page +Publish this Page +Categorize this Page +View Version(s) +Relate Page +Relate Image" set context_help "You can edit this page, etc." Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/search-view.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/search-view.adp,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/search-view.adp 4 Oct 2003 08:46:40 -0000 1.2 +++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/search-view.adp 5 Oct 2003 12:28:03 -0000 1.3 @@ -2,5 +2,5 @@ @title@ @context@ - + Index: openacs-4/contrib/packages/bcms-ui-base/templates/public/default_template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/public/default_template.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/bcms-ui-base/templates/public/default_template.tcl 4 Oct 2003 08:46:41 -0000 1.1 +++ openacs-4/contrib/packages/bcms-ui-base/templates/public/default_template.tcl 5 Oct 2003 12:28:03 -0000 1.2 @@ -47,7 +47,14 @@ } } else { - ns_returnnotfound - ad_script_abort + if {[array size current_item] > 0} { + # lets check if there is an item, but its not published + # lets redirect to switch context + ad_returnredirect [export_vars -base "[ad_conn package_url]manage/switch-context" {{cms_context bcms-ui-base} {return_url [ad_return_url]}}] + ad_script_abort + } else { + ns_returnnotfound + ad_script_abort + } } Index: openacs-4/contrib/packages/bcms-ui-base/www/admin/set-root-folder.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/admin/set-root-folder.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/bcms-ui-base/www/admin/set-root-folder.tcl 27 Aug 2003 17:33:49 -0000 1.1 +++ openacs-4/contrib/packages/bcms-ui-base/www/admin/set-root-folder.tcl 5 Oct 2003 12:28:03 -0000 1.2 @@ -3,7 +3,7 @@ } { } -bcms::folder::tree_folders -parent_id [bcms::folder::get_cr_root_folder] -multirow_name folders +bcms::folder::tree_folders -parent_id [bcms::folder::get_cr_root_folder] -multirow_name folders -include_parent set current_root_folder_id [parameter::get -parameter root_folder_id] Index: openacs-4/contrib/packages/bcms-ui-base/www/admin/set-template-folder.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/admin/set-template-folder.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/contrib/packages/bcms-ui-base/www/admin/set-template-folder.tcl 27 Aug 2003 17:33:49 -0000 1.1 +++ openacs-4/contrib/packages/bcms-ui-base/www/admin/set-template-folder.tcl 5 Oct 2003 12:28:03 -0000 1.2 @@ -4,7 +4,7 @@ } { } -bcms::folder::tree_folders -parent_id [bcms::template::get_cr_root_template_folder] -multirow_name folders +bcms::folder::tree_folders -parent_id [bcms::template::get_cr_root_template_folder] -multirow_name folders -include_parent set current_template_folder_id [parameter::get -parameter template_folder_id] Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/relate-item.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/relate-item.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/contrib/packages/bcms-ui-base/www/manage/relate-item.tcl 4 Oct 2003 08:47:32 -0000 1.2 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/relate-item.tcl 5 Oct 2003 12:28:03 -0000 1.3 @@ -10,21 +10,22 @@ {display_search_results:optional 0} {orderby:optional name,asc} {page:optional 1} + {content_type_search:notnull} + {relation_type:notnull} } if {[info exists item_id]} { foreach related_object_id $item_id { - bcms::item::relate_item -relation_type pages -item_id $item_id_one -related_object_id $related_object_id + bcms::item::relate_item -relation_type $relation_type -item_id $item_id_one -related_object_id $related_object_id } ad_returnredirect $return_url ad_script_abort } set package_url [ad_conn package_url] -set content_type_search content_revision set bulk_actions [list "Relate" "${package_url}manage/relate-item" "Relate checked items"] -set bulk_action_export_vars {item_id_one return_url} +set bulk_action_export_vars {item_id_one return_url content_type_search relation_type} template::list::create \ -name related_items \ @@ -38,15 +39,14 @@ -elements { name { label "Name" - link_url_col name } title { label "Title" } } -bcms::item::list_related_items -item_id $item_id_one -relation_tag pages -multirow_name related_items -revision latest +bcms::item::list_related_items -item_id $item_id_one -relation_tag $relation_type -multirow_name related_items -revision latest set title "Relate Content"