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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/bcms-ui-base.info 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,24 @@ + + + + + BCMS UI Base + BCMS UI Base + f + f + + + Jun Yamog + 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/category-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/resources/category-form.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/resources/category-form.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,57 @@ +ad_page_contract { + a form to create or edit a category + + this file is meant to be included with the following parameters + + category_id - if you are editing a category + parent_id - if you are adding a subcategory + return_url - requires a return_url, so after creating or editing a category it redirect to this url +} { +} + +if {![info exists parent_id]} { + set parent_id "" +} + + +ad_form -name simpleform -form { + + category_id:key + + {heading:text(text) {html {style "width: 20em"}} {label "Category Heading"}} + {description:text(textarea) {html {style "width: 40em; height: 20em"}} {label "Description"}} + {parent_id:integer(hidden),optional {value $parent_id}} + {return_url:text(hidden) {value $return_url}} + +} -edit_request { + + array set category [bcms::category::get_category -category_id $category_id] + set heading $category(heading) + set description $category(description) + +} -edit_data { + + bcms::category::set_category -category_id $category_id -heading $heading -description $description + +} -new_data { + + set creation_user_id [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + + bcms::category::create_category -heading $heading -description $description -parent_id $parent_id \ + -creation_user_id $creation_user_id -creation_ip $creation_ip + +} -after_submit { + + ad_returnredirect $return_url + ad_script_abort + +} + + +ad_return_template "/packages/bcms-ui-base/resources/simple-form" + + + + + Index: openacs-4/contrib/packages/bcms-ui-base/resources/folder-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/resources/folder-form.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/resources/folder-form.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,77 @@ +ad_page_contract { + a form to create or edit a folder + + this file is meant to be included with the following parameters + + folder_id - if you are editing a folder + parent_id - if you are creating a folder + create_index_p - if true will create a blank page named "index" on the new folder, defaults to true + return_url - requires a return_url, so after creating or editing a folder it redirect to this url + +} { +} + +# initialize the vars that don't exist +if {![info exists parent_id]} { + if {![info exists folder_id]} { + error "you are likely going to use this form to create a new folder, please include a parent_id parameter" + } + set parent_id "" +} +if {![info exists create_index_p]} { + set create_index_p true +} + +ad_form -name simpleform -form { + + folder_id:key + + {folder_name:text(text) {help_text {no spaces, no special characters}} {label "Folder Name"}} + {folder_label:text(text) {label "Folder Label"}} + {create_index_p:boolean(hidden),optional {value $create_index_p}} + {parent_id:integer(hidden),optional {value $parent_id}} + {return_url:text(hidden) {value $return_url}} + +} -edit_request { + + array set folder [bcms::folder::get_folder -folder_id $folder_id] + set folder_name $folder(name) + set folder_label $folder(label) + +} -edit_data { + + bcms::folder::set_folder -folder_id $folder_id -name $folder_name -label $folder_label + +} -new_data { + + set creation_user_id [ad_conn user_id] + set creation_ip [ad_conn peeraddr] + + db_transaction { + # now that we have all the data create the folder + set folder_id [bcms::folder::create_folder -name $folder_name -folder_label $folder_label -parent_id $parent_id] + + if {$create_index_p} { + # create the index page for the folder + set item_id [bcms::item::create_item -item_name index -parent_id $folder_id -content_type content_revision \ + -storage_type text -creation_user_id $creation_user_id -creation_ip $creation_ip] + + # create an initial revision, a blank page + set revision_id [bcms::revision::add_revision -item_id $item_id \ + -title $folder_label -content "" -description "" \ + -mime_type "text/html" \ + -creation_user_id $creation_user_id -creation_ip $creation_ip] + } + + } + +} -after_submit { + + ad_returnredirect $return_url + ad_script_abort + +} + + +ad_return_template "/packages/bcms-ui-base/resources/simple-form" + Index: openacs-4/contrib/packages/bcms-ui-base/resources/folder-tree.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/resources/folder-tree.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/resources/folder-tree.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,259 @@ + + + + + + + +
+ @list_properties.bulk_action_export_chunk@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + << + + + << + + + +  <  + + +  <  + + + + +   \@paginator_pages.page@ + + +   \@paginator_pages.page@ + + + + +  >  + + +  >  + + + + >> + + + >> + + +
+ + @actions.label@ + +
+ + + @elements.label@ + v^ + + + @elements.label@ + + + + @elements.label@ + +
+ @list_properties.no_data@ +
+   +
+ @list_properties.groupby_label@: +
+ +
+ + @elements.aggregate_group_label@ + + + \@@list_properties.multirow@.@elements.aggregate_group_col@@ + +
+   +
+ + @elements.aggregate_label@ + + + \@@list_properties.multirow@.@elements.aggregate_col@@ + +
+ + @bulk_actions.label@ + +
+ + Index: openacs-4/contrib/packages/bcms-ui-base/resources/form-template.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/resources/form-template.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/resources/form-template.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,99 @@ +
+ + +
+ Unable to process the form due the following problem(s): +
    + + + + +
  1. + + \@formerror.@elements.id@\@ + +
  2. +
    +
    +
    + +
+
+
+
+ + + + + + @elements.section@ + + + + + + + + +
+ + +
+
+
+ + + + + + + + + + + + + + + +
+ +
+ \@formgroup.widget@ + +
+
+
+
+
+ + +
+
+
+ + + +
+
+
+ + +
+
+ +
+
+
+ + + +
+
+
+
+
+ +
Index: openacs-4/contrib/packages/bcms-ui-base/resources/item-list.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/resources/item-list.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/resources/item-list.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,283 @@ + + + + + + + + + +
+ @list_properties.bulk_action_export_chunk@ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + << + + + << + + + +  <  + + +  <  + + + + +   \@paginator_pages.page@ + + +   \@paginator_pages.page@ + + + + +  >  + + +  >  + + + + >> + + + >> + + +
+ + @actions.label@ + +
+ + + @elements.label@ + v^ + + + @elements.label@ + + + + @elements.label@ + +
+ @list_properties.no_data@ +
+   +
+ @list_properties.groupby_label@: +
+ +
+ + @elements.aggregate_group_label@ + + + \@@list_properties.multirow@.@elements.aggregate_group_col@@ + +
+   +
+ + @elements.aggregate_label@ + + + \@@list_properties.multirow@.@elements.aggregate_col@@ + +
+ + @bulk_actions.label@ + +
+ + Index: openacs-4/contrib/packages/bcms-ui-base/resources/page-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/resources/page-form.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/resources/page-form.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,104 @@ +ad_page_contract { + a form to create or edit a page + + this file is meant to be included with the following parameters + + folder_id - if you are creating a new page + page_id - if you are creating a new revision of a page + revision_id - if you are editing a page revision + return_url - requires a return_url, so after creating or editing a folder it redirect to this url + +} { + {page_name:optional ""} +} + +# check if the parameters exists and set them to their defaults +if {![info exists folder_id]} { + if {![info exists page_id] && ![info exists revision_id]} { + error "folder_id does not exists, please pass in the folder_id if you are creating a new page" + } + set folder_id "" +} +if {![info exists page_id]} { + if {![info exists folder_id] && ![info exists revision_id]} { + error "page_id does not exists, please pass in the page_id if you are creating a new revision" + } + set page_id "" +} + +# lets get an existing page with name $page_name +if {![string equal $page_name ""]} { + array set existing_page [bcms::item::get_item_by_url -root_id $folder_id -url $page_name] +} + +ad_form -name simpleform -form { + revision_id:key +} + +if {![string equal $folder_id ""] || [info exists revision_id]} { + ad_form -extend -name simpleform -form { + {page_name:text(text) {help_text {no spaces, no special characters}} {label "Page Name"}} + } -validate { + {page_name + {([array size existing_page] == 0) || ([info exists page_id] && ($existing_page(item_id) == $page_id))} + "Page Name already exists,
please use another Page Name" + } + } +} + +ad_form -extend -name simpleform -form { + + {title:text(text) {label "Title"}} + {description:text(textarea),optional {html {rows 5 cols 80}} {label "Description"}} + {content:text(textarea),optional {html {rows 20 cols 80}} {label "Body"}} + {folder_id:integer(hidden),optional {value $folder_id}} + {page_id:integer(hidden),optional {value $page_id}} + {return_url:text(hidden) {value $return_url}} + +} -edit_request { + + array set one_revision [bcms::revision::get_revision -revision_id $revision_id] + set page_id $one_revision(item_id) + set page_name $one_revision(name) + set title $one_revision(title) + set content $one_revision(content) + set description $one_revision(description) + + ad_set_form_values page_id page_name title content description + +} -edit_data { + + bcms::revision::set_revision -revision_id $revision_id \ + -title $title -content $content -description $description + if {[info exists page_name]} { + bcms::item::set_item -item_id $page_id -name $page_name + # we have renamed the page, we need to redirect on the new name + set path [ns_set get [lindex [bcms::item::get_item_path -item_id $page_id -prepend_path [ad_conn package_url] -return_list -no_parent] 0] path] + ad_returnredirect $path + } + +} -new_data { + + if {![string equal $page_id ""]} { + # just create the revision the page is existing + set revision_id [bcms::revision::add_revision -item_id $page_id \ + -title $title -content $content -description $description \ + -mime_type "text/html"] + } elseif {![string equal $folder_id ""] && ![string equal $page_name ""]} { + # if the page does not exists, create the page and revision + set page_id [bcms::create_page -page_name $page_name -folder_id $folder_id -mime_type "text/html" \ + -title $title -description $description -page_body $content] + } else { + ns_log notice "bcms: page not created" + } + +} -after_submit { + + ad_returnredirect $return_url + ad_script_abort + +} + +ad_return_template "/packages/bcms-ui-base/resources/simple-form" + + Index: openacs-4/contrib/packages/bcms-ui-base/resources/simple-form.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/resources/simple-form.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/resources/simple-form.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1 @@ + Index: openacs-4/contrib/packages/bcms-ui-base/resources/template-form.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/resources/template-form.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/resources/template-form.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,101 @@ +ad_page_contract { + a form to create or edit a tempalte + + this file is meant to be included with the following parameters + + folder_id - if you are creating a new template + template_id - if you are creating a new revision of a template + revision_id - if you are editing a template revision + return_url - requires a return_url, so after creating or editing a folder it redirect to this url + +} { + {template_name:optional ""} +} + +# check if the parameters exists and set them to their defaults +if {![info exists folder_id]} { + if {![info exists template_id] && ![info exists revision_id]} { + error "folder_id does not exists, please pass in the folder_id if you are creating a new tempate" + } + set folder_id "" +} +if {![info exists template_id]} { + if {![info exists folder_id] && ![info exists revision_id]} { + error "template_id does not exists, please pass in the template_id if you are creating a new revision" + } + set template_id "" +} + +# lets get an existing template with name $template_name +if {![string equal $template_name ""]} { + array set existing_template [bcms::item::get_item_by_url -root_id $folder_id -url $template_name] +} + +ad_form -name simpleform -form { + revision_id:key +} + +if {![string equal $folder_id ""]} { + ad_form -extend -name simpleform -form { + {template_name:text(text) {label "Template Name"}} + } -validate { + {template_name + {([array size existing_template] == 0) || ([info exists template_id] && ($existing_template(item_id) == $template_id))} + "Template Name already exists,
please use another Template Name" + } + } +} + + +ad_form -extend -name simpleform -form { + + {title:text(text) {label "Title"}} + {description:text(textarea),optional {html {rows 5 cols 80}} {label "Description"}} + {content:text(textarea),optional {html {rows 20 cols 80}} {label "Template Content"}} + {folder_id:integer(hidden),optional {value $folder_id}} + {template_id:integer(hidden),optional {value $template_id}} + {return_url:text(hidden) {value $return_url}} + +} -edit_request { + + array set one_revision [bcms::revision::get_revision -revision_id $revision_id] + set template_id $one_revision(item_id) + set template_name $one_revision(name) + set title $one_revision(title) + set content $one_revision(content) + set description $one_revision(description) + + ad_set_form_values template_id template_name title content description + +} -edit_data { + + bcms::revision::set_revision -revision_id $revision_id \ + -title $title -content $content -description $description + +} -new_data { + + if {![string equal $template_id ""]} { + # just create the revision the template is existing + set revision_id [bcms::template::add_template -template_id $template_id \ + -title $title -content $content -description $description] + } elseif {![string equal $folder_id ""] && ![string equal $template_name ""]} { + # if the template does not exists, create the template and revision + db_transaction { + set template_id [bcms::template::create_template -template_name $template_name -parent_id $folder_id] + set revision_id [bcms::template::add_template -template_id $template_id \ + -title $title -content $content -description $description] + } + } else { + ns_log notice "bcms: template not created" + } + +} -after_submit { + + ad_returnredirect $return_url + ad_script_abort + +} + +ad_return_template "/packages/bcms-ui-base/resources/simple-form" + + Index: openacs-4/contrib/packages/bcms-ui-base/tcl/bcms-ui-base-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/tcl/bcms-ui-base-procs-postgresql.xql,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/tcl/bcms-ui-base-procs-postgresql.xql 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,16 @@ + + + + postgresql7.2 + + + + select case when count(*) = 0 then true else false end + from cr_items + where content_type = 'content_folder' + and item_id in ($item_ids) + and not content_folder__is_empty(item_id) + + + + Index: openacs-4/contrib/packages/bcms-ui-base/tcl/bcms-ui-base-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/tcl/bcms-ui-base-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/tcl/bcms-ui-base-procs.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,108 @@ +ad_library { + + Procs specific for for this BCMS UI (bcms-ui-base) + + @author Jun Yamog + @creation-date Aug 2003 + @cvs-id $Id: bcms-ui-base-procs.tcl,v 1.1 2003/08/27 17:33:49 juny Exp $ + +} + + +namespace eval bcms::ui::base {} + +ad_proc -public bcms::ui::base::move_url { + {-items_to_move:required} + {-destination_folder:required} + {-return_url:required} + {-redirect_to_folder "0"} +} { + returns the link to move an item to another folder + + @param items_to_move a list of item_id you wish to move + @param destination_folder folder_id of where the item will be be moved + @param return_url after moving, redirects to this url + @param redirect_to_folder if set to 1 then it will rebuild the return_url pointing to the new + folder being moved to + + @returns a link, normally used for the list builder +} { + set item_id $items_to_move + set folder_id $destination_folder + + # redirect the destination folder, normally you will need to do this if one of the item_id + # is the current return_url. So you will not redirect to a item that has moved + if {$redirect_to_folder} { + set path_list [bcms::item::get_item_path -item_id $destination_folder -prepend_path [ad_conn package_url] -return_list -no_parent] + set path "[ns_set get [lindex $path_list 0] path]" + set return_url $path + } + + set url [export_vars -url -base "[ad_conn package_url]manage/move-item" {item_id:multiple folder_id redirect_to_folder return_url}] + return $url +} + + +ad_proc -public bcms::ui::base::delete_url { + {-items_to_delete:required} + {-return_url:required} + {-confirm:boolean} +} { + returns the link to delete the items + + @param items_to_delete a list of item_id you wish to delet + @param return_url after deleting, move to this url + @param confirm if passed it will generate a link that will delete the items + without confirmation + + @returns a link to delete the items, but if a folder that will be deleted is not empty + it will return a null string +} { + set item_id $items_to_delete + + set item_ids [join $item_id ", "] + set can_delete_p [db_string can_delete "SQL"] + if {[string equal $can_delete_p "t"]} { + return [export_vars -url -base "[ad_conn package_url]manage/delete-item" {item_id:multiple confirm_p return_url}] + } else { + return {} + } +} + +ad_proc -public bcms::ui::base::apply_template_url { + {-item_id:required} + {-template_id:required} + {-return_url:required} +} { + returns a link to apply the template + + @param item_id id of the item to apply the template to + @param template_id id of which template to use + @param return_url after applying the template, redirect to this url + + @returns a link to apply the template +} { + + set url [export_vars -url -base "[ad_conn package_url]manage/apply-template" {item_id template_id return_url}] + return $url + +} + +ad_proc -public bcms::ui::base::delete_template_url { + {-templates_to_delete:required} + {-return_url:required} +} { + returns the link to delete the templates, use this when the user has confirmed + + @param templates_to_delete a list of template_id you wish to delet + @param return_url after deleting, move to this url + + @returns a link to delete the templates +} { + set confirm_p 1 + set template_id $templates_to_delete + + return [export_vars -url -base "[ad_conn package_url]manage/template-delete" {template_id:multiple confirm_p return_url}] + +} + Index: openacs-4/contrib/packages/bcms-ui-base/www/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/index.vuh 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,23 @@ +ad_page_contract { + checks if this bcms instance in configured and then dispatches to the default + template of the cms_context +} { +} + +set root_id [parameter::get -parameter root_folder_id -default 0] +set template_folder_id [parameter::get -parameter template_folder_id -default 0] + +if { ($root_id == 0) || ($template_folder_id == 0)} { + + ns_log notice "redirecting to admin pages to properly set this bcms UI instance" + ad_returnredirect admin + ad_script_abort + +} + +# route to the default template of the current cms_context +set cms_context [ad_get_client_property -default public [ad_conn package_id] cms_context] +set file "/templates/$cms_context/default" +rp_internal_redirect $file + + Index: openacs-4/contrib/packages/bcms-ui-base/www/style.css =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/Attic/style.css,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/style.css 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,291 @@ +body, div, p, th, td, li, dl, dd { + font-family: Lucida, Arial, Helvetica, sans-serif; + font-size: 13px; +} +code, pre { + font-family: 'Andale Mono', Courier, monospace; + font-size: 13px; +} +h2, h3, h4 { + font-family: Tahoma, Verdana, Helvetica, Arial, sans-serif; +} + +body { + margin: 0px 0px 0px 0px; + padding: 0px; +} + +a { + text-decoration: none; + color: #1A3757; +} + +a:visited { + color: #1A3757; +} + +a:hover { + text-decoration: underline; +} + +/* start - form template styles */ + +fieldset.formtemplate { + border: solid 1px #1B2846; + padding:5px; + margin: 1% 1% 1% 1%; +} + +fieldset.formtemplate legend { + font-weight:bold; + color: #FFFFFF; + background-color: #1B2846; +} + +div.formtemplate { + margin: 0% 0% 0% 0%; +} + +div.formtemplate div.oneelement { + clear: both; + border-top: 1px solid #CCCCC; + border-bottom: 1px solid #CCCCCC; +} + +div.formtemplate div.oneelement label { + float: left; + padding-left: 5%; + width: 15%; +} + +div.formtemplate div.oneelement label.witherror { + background-image: url(/bcms-ui-base/bcms-ui-base-images/warning-small.png); + background-repeat: no-repeat; + color: #FF0000; +} + +div.formtemplate div.oneelement .formfield { + float: right; + width: 75%; + padding: 2px; +} + +div.formtemplate div.oneelement .formgroup { + clear:both; +} + +div.formtemplate div.oneelement .formgroup input { + float:left; +} + +div.formtemplate div.oneelement .formgroup label { + float:left; +} + +div.formtemplate div.oneelement .formhelp { + float: left; + color: #666666; + background-color: #FFFFFF; + text-align: center; + width: 50%; +} + +div.formtemplate .button { + text-align: center; + background-color: #CCCCCC; +} + +div.formtemplate .formerror { + background-image: url(/bcms-ui-base/bcms-ui-base-images/warning.png); + background-repeat: no-repeat; + background-color: #FFFFFF; + color: #FF0000; + padding-left: 35px; +} + +div.formtemplate .formerror li.formerrorelement { + color: #FF0000; +} + +/* end - form template styles */ + +div.tabs { + background-color: #FFFFFF; + height: 25px; + margin: 10px 0px 0px 0px; +} + +div.tabs a.active { + background-color: #7590AE; + border-style: outset; + border-bottom: none; + border-color: #7590AE; + border-width: 3px; + color: #FFFFFF; + top: 8px; + padding: 5px; +} + +div.tabs a { + background-color: #CCCCCC; + border-style: solid; + border-bottom: none; + border-color: #666666; + border-width: 1px; + color: #333333; + font-size: 12px; + margin: 0px 0px 0px 0px; + padding: 4px; + position: relative; + top: 6px; +} + +/* master template styles */ + +#topnav { + background-color: #7590AE; + padding: 5px; + right: 10px; + background-color: #7590AE; + border-style: outset; + border-color: #7590AE; + border-width: 3px; +} + +#switch-context-form { + float: right; + margin: 0px 0px 0px 0px; + position: absolute; + right: 5px; +} + +#contextbar { + clear: both; +} + +#title { + float: left; + font-weight: bold; + color: #FFFFFF; +} + +#main { + margin: 0px 0px 0px 0px; + background-color: #CCCCCC; + width: 1024px; +} + +#contextpane { + background-image: url(/bcms-ui-base/bcms-ui-base-images/blue_stripe.png); + float: left; + width: 194px; + padding: 2px; +} + +#contextaction { + background-color: #FFFFFF; + border: solid 1px #1B2846; + margin: 2px 5px 2px 5px; + padding: 5px; +} + +a.contextaction { + color: #7590AE; + white-space: nowrap; + display: block; +} + +a.contextaction:hover { + color: #FFFFFF; + background-color: #3D5A9B; +} + +#contexthelp { + background-image: url(/bcms-ui-base/bcms-ui-base-images/bulb.png); + background-repeat: no-repeat; + background-color: #FFFFFF; + border: solid 1px #1B2846; + margin: 2px 5px 2px 5px; + padding: 5px; +} + +#contexthelp p { + text-align: justify; + margin: 10px 0px 10px 0px; + text-indent: 30px; +} + +#contentpane { + float: right; + margin: 0% 0% 0% 0%; + width: 824px; +} + +/* end - master template styles */ + +/* contextaction styles */ + +#folder-edit { + background-image: url(/bcms-ui-base/bcms-ui-base-images/folder-edit.png); + background-repeat: no-repeat; + padding-left: 20px; +} + +#move-item { + background-image: url(/bcms-ui-base/bcms-ui-base-images/move-item.png); + background-repeat: no-repeat; + padding-left: 20px; +} + +#delete-item { + background-image: url(/bcms-ui-base/bcms-ui-base-images/delete-item.png); + background-repeat: no-repeat; + padding-left: 20px; +} + +#apply-template { + background-image: url(/bcms-ui-base/bcms-ui-base-images/apply-template.png); + background-repeat: no-repeat; + padding-left: 20px; +} + +#folder-add { + background-image: url(/bcms-ui-base/bcms-ui-base-images/folder-add.png); + background-repeat: no-repeat; + padding-left: 20px; +} + +#page-add { + background-image: url(/bcms-ui-base/bcms-ui-base-images/page-add.png); + background-repeat: no-repeat; + padding-left: 20px; +} + +#page-edit { + background-image: url(/bcms-ui-base/bcms-ui-base-images/page-edit.png); + background-repeat: no-repeat; + padding-left: 20px; +} + +/* end - contextaction styles */ + +tr.list-even { + cursor: pointer; +} + +tr.list-odd { + cursor: pointer; +} + + +#Move-bulkaction { + background-image: url(/bcms-ui-base/bcms-ui-base-images/move-item.png); + background-repeat: no-repeat; + padding-left: 20px; +} + +#Delete-bulkaction { + background-image: url(/bcms-ui-base/bcms-ui-base-images/delete-item.png); + background-repeat: no-repeat; + padding-left: 20px; +} Index: openacs-4/contrib/packages/bcms-ui-base/www/admin/create-folder.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/admin/create-folder.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/admin/create-folder.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,5 @@ + +@title@ +@context@ + + Index: openacs-4/contrib/packages/bcms-ui-base/www/admin/create-folder.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/admin/create-folder.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/admin/create-folder.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,9 @@ +ad_page_contract { + create a subfolder +} { + parent_id:notnull,integer + return_url:notnull +} + +set title "Create Sub-Folder" +set context [list [list $return_url "Set Folder"] $title] Index: openacs-4/contrib/packages/bcms-ui-base/www/admin/index.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/admin/index.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/admin/index.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,8 @@ + + +

Configure this BCMS UI instance

+ + Index: openacs-4/contrib/packages/bcms-ui-base/www/admin/set-parameter.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/admin/set-parameter.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/admin/set-parameter.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,11 @@ +ad_page_contract { + sets the package parameter based from the name and value +} { + parameter_name:notnull + value:notnull + return_url:notnull +} + +parameter::set_value -parameter $parameter_name -value $value + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms-ui-base/www/admin/set-root-folder.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/admin/set-root-folder.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/admin/set-root-folder.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,30 @@ + +@title@ +@context@ + + + + + + + + + + + + + + + + +
Path
+ @folders.path@ + + make this folder your root folder + + create a subfolder + + current root folder + + create a subfolder +
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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/admin/set-root-folder.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,14 @@ +ad_page_contract { + this page is set the root_folder_id and template_folder_id of this package instance +} { +} + +bcms::folder::tree_folders -parent_id [bcms::folder::get_cr_root_folder] -multirow_name folders + +set current_root_folder_id [parameter::get -parameter root_folder_id] + +set current_url [ad_return_url -urlencode] + +set title "Set Folder" +set context [list $title] + Index: openacs-4/contrib/packages/bcms-ui-base/www/admin/set-template-folder.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/admin/set-template-folder.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/admin/set-template-folder.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,30 @@ + +@title@ +@context@ + + + + + + + + + + + + + + + + +
Path
+ @folders.path@ + + make this folder your template folder + + create a subfolder + + current template folder + + create a subfolder +
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 --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/admin/set-template-folder.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,14 @@ +ad_page_contract { + this page is set the root_folder_id and template_folder_id of this package instance + TODO revisit this page to make sure its able to handle multi level folders +} { +} + +bcms::folder::tree_folders -parent_id [bcms::template::get_cr_root_template_folder] -multirow_name folders + +set current_template_folder_id [parameter::get -parameter template_folder_id] + +set current_url [ad_return_url -urlencode] + +set title "Set Folder" +set context [list $title] Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/apply-template.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/apply-template.png,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/blue_stripe.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/blue_stripe.png,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/bulb.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/bulb.png,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/delete-item.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/delete-item.png,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/folder-add.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/folder-add.png,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/folder-edit.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/folder-edit.png,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/folder.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/folder.png,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/move-item.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/move-item.png,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/page-add.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/page-add.png,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/page-edit.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/page-edit.png,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/page.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/page.png,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/warning-small.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/warning-small.png,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/warning.png =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/warning.png,v diff -u Binary files differ Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/apply-template.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/apply-template.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/apply-template.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,6 @@ + +@title@ +@context_help@ +@return_url@ + + Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/apply-template.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/apply-template.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/apply-template.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,34 @@ +ad_page_contract { + apply a template to an item +} { + item_id:notnull,naturalnum + template_id:optional,naturalnum + return_url:notnull +} + +if {[info exists template_id]} { + + bcms::template::apply_template -item_id $item_id -template_id $template_id -context public + ad_returnredirect $return_url + +} else { + + template::list::create \ + -name template_list \ + -pass_properties { item_id return_url } \ + -multirow template_list \ + -key item_id \ + -elements { + title { + label "Title/Label" + link_url_eval {[bcms::ui::base::apply_template_url -item_id $item_id -template_id $template_id -return_url $return_url]} + } + content_type { + label "Content Type" + } + } + bcms::template::list_templates -parent_id [parameter::get -parameter template_folder_id] -multirow_name template_list + + set title "Apply Template" + set context_help "" +} Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/categorize-item.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/categorize-item.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/categorize-item.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,8 @@ + +@title@ +@return_url@ + +
+@title@ + +
Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/categorize-item.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/categorize-item.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/categorize-item.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,39 @@ +ad_page_contract { + set the categeries of a particular item +} { + item_id:naturalnum,notnull + folder_id:naturalnum,notnull + return_url:notnull + category_id:naturalnum,multiple,optional +} + +if {[info exists category_id]} { + # process the category assignments + + bcms::item::clear_categories -item_id $item_id + foreach category $category_id { + bcms::item::assign_category -item_id $item_id -category_id $category + } + ad_returnredirect $return_url + ad_script_abort + +} else { + # display the form to select the categories + set parent_id [lindex [bcms::item::get_categories -item_id $folder_id] 0] + set option_list [bcms::widget::extract_values -list_of_ns_sets \ + [bcms::category::tree_categories -parent_id $parent_id -return_list] \ + -keys_to_extract {path category_id}] + + set category_list [bcms::item::get_categories -item_id $item_id] + + template::form::create simpleform + template::element::create simpleform category_id -widget multiselect \ + -datatype integer -label "Categories" -options $option_list -values $category_list + template::element::create simpleform return_url -widget hidden -datatype text -value $return_url + template::element::create simpleform item_id -widget hidden -datatype integer -value $item_id + template::element::create simpleform folder_id -widget hidden -datatype integer -value $folder_id + + + set title "Set Category" + +} Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/delete-item.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/delete-item.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/delete-item.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,12 @@ + +@title@ +@return_url@ + + + + + Delete + + + Unable to delete, one or more folders are not empty + Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/delete-item.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/delete-item.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/delete-item.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,55 @@ +ad_page_contract { + delete items +} { + item_id:notnull,naturalnum,multiple + {confirm_p:optional,boolean 0} + return_url:notnull +} + + +if {$confirm_p} { + + db_transaction { + foreach one_item $item_id { + bcms::item::delete_item -item_id $one_item + } + } + ad_returnredirect $return_url + + +} else { + + template::list::create \ + -name delete_list \ + -multirow delete_list \ + -key item_id \ + -elements { + title { + label "Item" + } + can_delete { + label "Can be deleted" + } + } + + set item_ids [join $item_id ", "] + db_multirow delete_list get_to_be_deleted " + select i.item_id, + i.name, + i.live_revision, + i.latest_revision, + i.publish_status, + i.content_type, + i.storage_type, + i.tree_sortkey, + 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, + case when i.content_type = 'content_folder' then content_folder__is_empty(i.item_id) else true end as can_delete + from cr_items i + where + i.item_id in ($item_ids)" + + set confirm_link [bcms::ui::base::delete_url -items_to_delete $item_id -return_url $return_url -confirm] + + set title "Delete" + +} Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-add.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,9 @@ + +@title@ +@context_help@ +@return_url@ + +
+@title@ + +
Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-add.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,11 @@ +ad_page_contract { + create a subfolder +} { + parent_id:notnull,integer + return_url:notnull +} + +set title "Add Folder" +set context_help "Enter the folder name which will be part of the url. And the folder label" + + Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/Attic/folder-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-edit.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,11 @@ + +@title@ +@context_help@ +@return_url@ + +
+@title@ + +
+ + Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/Attic/folder-edit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-edit.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + edi a folder +} { + folder_id:notnull,naturalnum + return_url:notnull +} + +set title "Edit Folder" +set context_help "Enter the folder name which will be part of the url. And the folder label" + Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-set-category.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-set-category.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-set-category.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,22 @@ + +@title@ +@return_url@ + + +
+ Assigned Root Category +
+
+ +
@category.heading@
+
+
+ +
@category.description@
+
+
+
+
+ + + Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-set-category.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-set-category.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/folder-set-category.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,56 @@ +ad_page_contract { + set the root category to be used by this folder's content +} { + folder_id:integer,notnull + category_id:naturalnum,optional + return_url:notnull +} + +if {[info exists category_id]} { + # we need to assign the root category_id to this folder_id + bcms::item::assign_category -item_id $folder_id -category_id $category_id +} + +set categories [bcms::item::get_categories -item_id $folder_id] +if {[llength $categories] > 0} { + # if its already assigned a category, display it only + set category_id [lindex $categories 0] + array set category [bcms::category::get_category -category_id $category_id] + + # there is a bug listtemplate seems not to obey if, we will create + # a blank list template + # TODO fix this bug + template::list::create \ + -name category_list \ + -multirow category_list \ + -elements {} + +} else { + # we need to display the root categories + + set package_url [ad_conn package_url] + set return_url_encoded [ad_urlencode $return_url] + + bcms::category::list_categories -multirow_name category_list + + template::list::create \ + -pass_properties { folder_id return_url_encoded package_url } \ + -name category_list \ + -multirow category_list \ + -key category_id \ + -elements { + category_id { + label "Root Category" + display_col heading + link_url_eval "${package_url}manage/folder-set-category?folder_id=$folder_id&category_id=$category_id&return_url=$return_url_encoded" + } + description { + label "Description" + } + } + +} + + + +set title "Assign Root Category" Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/master.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/master.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,19 @@ +set manage_type [ad_get_client_property -default content [ad_conn package_id] manage_type] +if {[string equal $manage_type "template"]} { + #if we are on template manage_type then we need to use the template folder not the page folder + set root_id [parameter::get -parameter template_folder_id] +} else { + set root_id [bcms::folder::get_bcms_root_folder] +} + +if {![info exists context_url]} { + set context_url [ad_conn package_url] +} +set root_url [ad_conn package_url] +regexp "${root_url}(\[^ ?\]*)" $context_url match_p context_url +array set current_item [bcms::item::get_item_by_url -root_id $root_id -url "/$context_url"] + +set context [bcms::widget::item_context -item_id $current_item(item_id) -root_id $root_id] +lappend context "$title" + +ad_return_template "/templates/bcms-ui-base/master" Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/move-item.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/move-item.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/move-item.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,5 @@ + +@title@ +@return_url@ + + Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/move-item.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/move-item.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/move-item.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,41 @@ +ad_page_contract { + moves item_id to folder_id +} { + item_id:notnull,naturalnum,multiple + folder_id:optional,integer + return_url:notnull + {redirect_to_folder:optional,boolean 0} +} + +# we already have a destination folder, that means move the items +# otherwise list the folders +if {[info exists folder_id]} { + + foreach one_item $item_id { + bcms::item::set_item -item_id $one_item -parent_id $folder_id + } + + ad_returnredirect $return_url + +} else { + + template::list::create \ + -name folder_tree \ + -pass_properties { item_id redirect_to_folder return_url } \ + -multirow folder_tree \ + -key folder_id \ + -elements { + label { + label "Folder" + link_url_eval {[bcms::ui::base::move_url -items_to_move "$item_id" -destination_folder $folder_id -redirect_to_folder $redirect_to_folder -return_url $return_url]} + } + level { + label "Level" + } + } + + bcms::folder::tree_folders -parent_id [bcms::folder::get_bcms_root_folder] -prepend_path [ad_conn package_url] -multirow_name folder_tree + + set title "Move" + +} Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/page-add-revision.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/Attic/page-add-revision.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/page-add-revision.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,16 @@ +ad_page_contract { + copies a new page revision +} { + revision_id:notnull,naturalnum + return_url:notnull +} + +array set page [bcms::revision::get_revision -revision_id $revision_id] + +if {[array size page] > 0} { + bcms::revision::copy_revision -revision_id $revision_id +} else { + error "revision does not exist" +} + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/page-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/page-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/page-add.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,9 @@ + +@title@ +@context_help@ +@return_url@ + +
+@title@ + +
Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/page-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/page-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/page-add.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + create a page +} { + folder_id:notnull,integer + return_url:notnull +} + + +set title "Add Page" +set context_help "You may add a new page, by putting... etc." Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/page-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/Attic/page-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/page-edit.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,9 @@ + +@title@ +@context_help@ +@return_url@ + +
+@title@ + +
Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/page-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/Attic/page-edit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/page-edit.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + edit a page +} { + revision_id:notnull,integer + return_url:notnull +} + + +set title "Edit Page" +set context_help "" Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/page-publish.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/Attic/page-publish.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/page-publish.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,24 @@ +ad_page_contract { + publish this page revision +} { + revision_id:notnull,naturalnum + return_url:notnull +} + +array set page [bcms::revision::get_revision -revision_id $revision_id] + +if {[array size page] > 0} { + #if we are publishing the latest revision then we create a newer version + #so we will not edit the live and latest revision. + if {$page(latest_revision) == $revision_id} { + bcms::revision::copy_revision -revision_id $revision_id + } + # publish it if the revision is not live, otherwise its has already been published + if {$page(live_revision) != $revision_id} { + bcms::revision::set_revision_status -revision_id $revision_id -status live + } +} else { + error "revision does not exist" +} + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/page-revision.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/Attic/page-revision.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/page-revision.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,7 @@ + +@title@ +@context_action@ +@return_url@ + + + Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/page-revision.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/Attic/page-revision.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/page-revision.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,33 @@ +ad_page_contract { + list the revision of a page and its options +} { + page_id:naturalnum,notnull + return_url:notnull +} + +set package_url [ad_conn package_url] +set current_url [ad_return_url -urlencode] + +template::list::create \ + -name revision_list \ + -multirow revision_list \ + -key revision_id \ + -elements { + creation_date {label "Date"} + last_name { + label "Author" + display_template {@revision_list.first_names@ @revision_list.last_name@} + } + revision_id { + display_template {View} + } + + } + +bcms::revision::list_revisions -item_id $page_id -multirow_name revision_list + +array set page [bcms::item::get_item -item_id $page_id -revision latest] + +set context_action "Add Version" + +set title "View Page Version(s)" Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/switch-context.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/switch-context.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/switch-context.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,15 @@ +ad_page_contract { + change the cms context +} { + cms_context:notnull + return_url:notnull +} + +if {[string equal $cms_context "bcms-ui-base"]} { + ad_set_client_property -persistent t [ad_conn package_id] cms_context bcms-ui-base +} elseif {[string equal $cms_context "public"]} { + ad_set_client_property -persistent t [ad_conn package_id] cms_context public +} + + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/switch-type.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/switch-type.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/switch-type.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,27 @@ +ad_page_contract { + change what are managing, content or template +} { + manage_type:notnull +} + +set package_url [ad_conn package_url] + +switch -exact $manage_type { + content { + ad_set_client_property -persistent t [ad_conn package_id] manage_type content + ad_returnredirect $package_url + } + template { + ad_set_client_property -persistent t [ad_conn package_id] manage_type template + ad_returnredirect $package_url + } + category { + ad_set_client_property -persistent t [ad_conn package_id] manage_type category + ad_returnredirect $package_url + } + default { + ns_log error "bcms-ui-base: unknown manage type" + error "unknown manage_type, valid are content, template, category" + } +} + Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/template-add-version.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/template-add-version.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/template-add-version.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,6 @@ + +@title@ +@context_help@ +@return_url@ + + Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/template-add-version.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/template-add-version.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/template-add-version.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + create a version +} { + template_id:notnull,integer + return_url:notnull +} + + +set title "Add Version" +set context_help "" Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/template-add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/template-add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/template-add.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,6 @@ + +@title@ +@context_help@ +@return_url@ + + Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/template-add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/template-add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/template-add.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + create a template +} { + folder_id:notnull,integer + return_url:notnull +} + + +set title "Add Template" +set context_help "" Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/template-delete.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/template-delete.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/template-delete.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,7 @@ + +@title@ +@return_url@ + + + +Delete Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/template-delete.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/template-delete.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/template-delete.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,52 @@ +ad_page_contract { + delete templates +} { + template_id:notnull,naturalnum,multiple + {confirm_p:optional,boolean 0} + return_url:notnull +} + + +if {$confirm_p} { + + db_transaction { + foreach one_item $template_id { + bcms::template::delete_template -template_id $one_item + } + } + ad_returnredirect $return_url + + +} else { + + template::list::create \ + -name delete_list \ + -multirow delete_list \ + -key template_id \ + -elements [subst { + title { + label "Item" + } + }] + + set template_ids [join $template_id ", "] + db_multirow delete_list get_to_be_deleted " + select i.item_id as template_id, + i.name, + i.live_revision, + i.latest_revision, + i.publish_status, + i.content_type, + i.storage_type, + i.tree_sortkey, + r.title + from cr_items i, cr_revisions r + where + i.item_id in ($template_ids) + and r.revision_id = i.latest_revision" + + set confirm_link [bcms::ui::base::delete_template_url -templates_to_delete $template_id -return_url $return_url] + + set title "Delete" + +} Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/template-edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/Attic/template-edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/template-edit.adp 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,6 @@ + +@title@ +@context_help@ +@return_url@ + + Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/template-edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/Attic/template-edit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/template-edit.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,10 @@ +ad_page_contract { + edit a template +} { + revision_id:notnull,integer + return_url:notnull +} + + +set title "Edit Template" +set context_help "" Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/template-write.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/template-write.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/template-write.tcl 27 Aug 2003 17:33:49 -0000 1.1 @@ -0,0 +1,24 @@ +ad_page_contract { + write the template to the file system and set the revision to live +} { + revision_id:notnull,naturalnum + return_url:notnull +} + +set cms_context [parameter::get -parameter cms_context -default ""] + +if {[string equal $cms_context ""]} { + error "no cms context defined" +} + +array set template [bcms::revision::get_revision -revision_id $revision_id] + +if {[array size template] > 0} { + bcms::revision::set_revision_status -revision_id $revision_id -status live + set template_file "[acs_root_dir]/templates/${cms_context}/${template(name)}.adp" + template::util::write_file $template_file $template(content) +} else { + error "revision does not exist" +} + +ad_returnredirect $return_url Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/category/add.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/category/add.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/category/add.adp 27 Aug 2003 17:33:50 -0000 1.1 @@ -0,0 +1,8 @@ + +@title@ +@return_url@ + +
+@title@ + +
Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/category/add.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/category/add.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/category/add.tcl 27 Aug 2003 17:33:50 -0000 1.1 @@ -0,0 +1,8 @@ +ad_page_contract { + add a category +} { + {parent_id:naturalnum,optional ""} + return_url:notnull +} + +set title "Add Category" Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/category/edit.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/category/edit.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/category/edit.adp 27 Aug 2003 17:33:50 -0000 1.1 @@ -0,0 +1,8 @@ + +@title@ +@return_url@ + +
+@title@ + +
Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/category/edit.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/category/edit.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/category/edit.tcl 27 Aug 2003 17:33:50 -0000 1.1 @@ -0,0 +1,8 @@ +ad_page_contract { + edit a category +} { + category_id:naturalnum,notnull + return_url:notnull +} + +set title "Edit Category" Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/category/master.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/category/master.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/contrib/packages/bcms-ui-base/www/manage/category/master.tcl 27 Aug 2003 17:33:50 -0000 1.1 @@ -0,0 +1,15 @@ +set root_url [ad_conn package_url] + +if {![info exists context_url]} { + set context_url [ad_conn package_url] +} + +regexp {.*/([0-9]+)/*$} $context_url match_p category_id + +array set category [bcms::category::get_category -category_id $category_id] + +set context_list [bcms::widget::category_context -category_id $category_id] +set context [linsert $context_list 0 [list "$root_url" "Root Categories"]] +lappend context $title + +ad_return_template "/templates/bcms-ui-base/master"