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.1 -r1.2
--- openacs-4/contrib/packages/bcms-ui-base/bcms-ui-base.info 27 Aug 2003 17:33:49 -0000 1.1
+++ openacs-4/contrib/packages/bcms-ui-base/bcms-ui-base.info 22 Sep 2003 07:36:46 -0000 1.2
@@ -17,7 +17,11 @@
-
+
+
+
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 -r1.1 -r1.2
--- openacs-4/contrib/packages/bcms-ui-base/resources/item-list.adp 27 Aug 2003 17:33:49 -0000 1.1
+++ openacs-4/contrib/packages/bcms-ui-base/resources/item-list.adp 22 Sep 2003 07:36:46 -0000 1.2
@@ -43,100 +43,93 @@
-
+
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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/resources/search-postgresql.xql 22 Sep 2003 07:36:46 -0000 1.1
@@ -0,0 +1,56 @@
+
+
+
+ postgresql7.2
+
+
+
+
+ select * from (
+ select i.item_id,
+ i.name,
+ content_item__get_path(i.item_id, r.item_id) as path,
+ 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,
+ i.live_revision,
+ i.latest_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, 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
+ $openfts_where
+ [template::list::page_where_clause -key i.item_id -and -name search_results]
+ ) results
+ where 1 = 1
+ [template::list::filter_where_clauses -and -name search_results]
+ [template::list::orderby_clause -orderby -name search_results]
+
+
+
+
+
+
+ select * from (
+ select item_id,
+ name,
+ 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,
+ 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
+ where tree_ancestor_p(r.tree_sortkey, i.tree_sortkey)
+ and ao.object_id = i.item_id
+ $openfts_where
+ ) results
+ where 1 = 1
+ [template::list::filter_where_clauses -and -name search_results]
+ [template::list::orderby_clause -orderby -name search_results]
+
+
+
+
+
Index: openacs-4/contrib/packages/bcms-ui-base/resources/search.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/resources/search.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/resources/search.adp 22 Sep 2003 07:36:46 -0000 1.1
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/resources/search.tcl 22 Sep 2003 07:36:46 -0000 1.1
@@ -0,0 +1,141 @@
+ad_page_contract {
+ display search results
+
+
+} {
+ 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 {$display_search_results} {
+
+ set root_folder_id [parameter::get -parameter root_folder_id]
+
+ set addtnl_where_list {}
+ if {[exists_and_not_null content_search]} {
+ set openfts_where "and txt.fts_index @@ '\\\'$content_search\\\'' and txt.tid = i.live_revision"
+ set openfts_from ", txt"
+ } else {
+ set openfts_where ""
+ set openfts_from ""
+ }
+
+ set package_url [ad_conn package_url]
+
+ if {![info exists folder_id]} {
+ set folder_id [parameter::get -parameter root_folder_id]
+ }
+
+ # we need to construct the pass on bulk action export vars
+ # 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
+ append bulk_action_export_vars_filter "
+ $export_var {
+ add_url_eval {[export_vars $export_var]}
+ }
+ "
+ }
+ set filters "
+ display_search_results {}
+ title_search {
+ where_clause {title ilike '%' || :title_search || '%'}
+ }
+ name_search {
+ where_clause {name ilike '%' || :name_search || '%'}
+ }
+ content_search {}
+ content_type_search {
+ where_clause {content_type = :content_type_search}
+ }
+ $bulk_action_export_vars_filter
+ "
+
+ template::list::create \
+ -name search_results \
+ -multirow search_results \
+ -key item_id \
+ -pass_properties { package_url } \
+ -bulk_actions $bulk_actions \
+ -bulk_action_export_vars $bulk_action_export_vars \
+ -elements {
+ name {
+ label "Name"
+ link_url_eval {${package_url}manage/switch-type?manage_type=content&return_url=[ad_urlencode "${package_url}$path"]}
+ }
+ title {
+ label "Title"
+ }
+ content_type {
+ label "Type"
+ display_template {
+
+
+
+
+
+
+ }
+ html { style "width:70px" }
+ }
+ last_modified {
+ label "Last Modified"
+ html { style "width:180px" }
+ }
+ } \
+ -filters $filters \
+ -orderby {
+ default_value name,asc
+ name {
+ orderby name
+ }
+ title {
+ orderby title
+ }
+ content_type {
+ orderby content_type
+ }
+ last_modified {
+ orderby last_modified
+ }
+ } \
+ -page_size 5 \
+ -page_groupsize 2 \
+ -page_flush_p 1 \
+ -page_query_name get_results_page_query
+
+
+ db_multirow search_results get_results "SQL"
+
+
+ set title "Search Results"
+
+} else {
+ template::form::create simpleform
+ 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
+ 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
+ }
+
+ # we need to put this dummy one even we dont use it
+ template::list::create \
+ -name search_results \
+ -multirow search_results \
+ -key item_id \
+ -elements {}
+
+ set title "Search"
+
+}
Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/category-view.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/category-view.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/category-view.adp 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,23 @@
+
+@title@
+@context@
+@context_action@
+@context_help@
+
+
+
+
+
+
Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/category-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/category-view.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/category-view.tcl 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,61 @@
+ad_page_contract {
+ views a category and list the categories underneath it
+}
+
+
+set package_url [ad_conn package_url]
+set current_url [ad_return_url -urlencode]
+
+set root_url [ad_conn package_url]
+set extra_url [ad_conn extra_url]
+if [string equal $extra_url ""] {
+ # we don't have a category, so we will display the root categories
+ bcms::category::list_categories -multirow_name category_list
+
+ set heading_label "Root Category"
+
+ set context_action "
+ Add Category"
+
+ set context [list "Root Categories"]
+} else {
+ # we have a category so lets use the last category_id on the url
+ set current_url_list [ad_conn urlv]
+ set category_id [lindex $current_url_list [expr [llength $current_url_list] - 1]]
+
+ array set category [bcms::category::get_category -category_id $category_id]
+
+ bcms::category::list_categories -parent_id $category_id -multirow_name category_list
+
+ set heading_label "Sub Category"
+
+ set context_action "
+ Edit this Category
+ Delete this Category
+ Add Category"
+
+ set context_list [bcms::widget::category_context -category_id $category_id]
+ set context_list [linsert $context_list 0 [list "$root_url" "Root Categories"]]
+ set context [lrange $context_list 0 [expr [llength $context_list] - 2]]
+ lappend context $category(heading)
+}
+
+
+template::list::create \
+ -pass_properties { heading_label } \
+ -name category_list \
+ -multirow category_list \
+ -key category_id \
+ -elements {
+ heading {
+ label "$heading_label"
+ link_url_eval "$category_id/"
+ }
+ description {
+ label "Description"
+ }
+ }
+
+set context_help ""
+set title "View Categories"
+
Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/default.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/Attic/default.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/default.adp 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1 @@
+Current content type does not have a template yet
Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/default.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/Attic/default.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/default.tcl 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,62 @@
+# serve the correct template based from the manage type,
+# its its in the content manage type, then return the template according to
+# the content type
+
+# this page also set an array current_item if the manage type is
+# content or template
+
+
+# check what are we managing: category, templates or contents
+set manage_type [ad_get_client_property -default content [ad_conn package_id] manage_type]
+switch -exact $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]
+ }
+ content {
+ set root_id [parameter::get -parameter root_folder_id]
+ }
+ category {
+ ad_return_template category-view
+ return
+ }
+ search {
+ ad_return_template search-view
+ return
+ }
+}
+
+set root_url [ad_conn package_url]
+set extra_url [ad_conn extra_url]
+if [string equal $extra_url ""] {set extra_url "/"}
+
+# get the item by url
+array set current_item [bcms::item::get_item_by_url -root_id $root_id -url "$extra_url"]
+
+# check to see if there is a content item for this url.
+if {[array size current_item] > 0} {
+
+ # lets check if we need to have / on the url
+ # if its a folder we need to add / and redirect
+ set current_url_list [ad_conn urlv]
+ set current_url [ad_conn url]
+ if {![regexp {/$} $current_url] \
+ && [string equal $current_item(content_type) "content_folder"]} {
+ ad_returnredirect "$current_url/"
+ ad_script_abort
+ }
+
+ # return the correct template of a particular content type
+ if {[string equal "content_folder" $current_item(content_type)]} {
+ ad_return_template folder-view
+ } elseif {[string equal "content_revision" $current_item(content_type)]} {
+ ad_return_template page-view
+ } elseif {[string equal "content_template" $current_item(content_type)]} {
+ ad_return_template template-view
+ }
+
+} else {
+ ns_returnnotfound
+ ad_script_abort
+}
+
Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/folder-view.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/folder-view.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/folder-view.adp 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,8 @@
+
+@title@
+@context@
+@context_action@
+@context_help@
+1
+
+
Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/folder-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/folder-view.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/folder-view.tcl 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,158 @@
+ad_page_contract {
+ lists the items under a folder. we need to use different queries on templates and actions
+} {
+ {orderby:optional}
+ {page:optional}
+}
+
+
+set current_url [ad_return_url -urlencode]
+set return_url [ad_return_url]
+
+array set folder [bcms::folder::get_folder -folder_id $current_item(item_id)]
+
+set package_url [ad_conn package_url]
+set current_item_id $current_item(item_id)
+set context_action [list]
+
+set manage_type [ad_get_client_property -default content [ad_conn package_id] manage_type]
+# check to see if we are managing content or template, they differ in action and queries
+if {[string equal $manage_type "content"]} {
+ template::list::create \
+ -name item_list \
+ -multirow item_list \
+ -pass_properties { package_url current_item_id current_url } \
+ -key item_id \
+ -bulk_actions {
+ "Delete" "${package_url}manage/delete-item" "Delete checked items"
+ "Move" "${package_url}manage/move-item" "Move checked items"
+ } \
+ -bulk_action_export_vars {
+ return_url
+ } \
+ -actions {
+ Edit "${package_url}manage/folder-edit?folder_id=$current_item_id&return_url=$current_url" "Edit this Folder"
+ "Use Categories" "${package_url}manage/folder-set-category?folder_id=$current_item_id&return_url=$current_url" "Categorize Contents on the Folder"
+ } \
+ -elements {
+ name {
+ label "Name"
+ link_url_col name
+ }
+ title {
+ label "Title"
+ }
+ content_type {
+ label "Type"
+ display_template {
+
+
+
+
+
+
+ }
+ html { style "width:70px" }
+ }
+ last_modified {
+ label "Last Modified"
+ html { style "width:180px" }
+ }
+ } \
+ -orderby {
+ default_value name,asc
+ name {
+ orderby name
+ }
+ title {
+ orderby title
+ }
+ content_type {
+ orderby content_type
+ }
+ last_modified {
+ orderby last_modified
+ }
+ } \
+ -page_size 5 \
+ -page_groupsize 2 \
+ -page_query {
+ select i.item_id,
+ i.name,
+ i.live_revision,
+ i.latest_revision,
+ i.publish_status,
+ i.content_type,
+ i.storage_type,
+ i.tree_sortkey,
+ last_modified,
+ r.title,
+ r.description
+ from cr_items i, cr_revisionsx r
+ where
+ i.parent_id = $current_item(item_id)
+ and i.latest_revision = r.revision_id and content_type = 'content_revision'
+ union
+
+ select i.item_id,
+ i.name,
+ i.live_revision,
+ i.latest_revision,
+ i.publish_status,
+ i.content_type,
+ i.storage_type,
+ i.tree_sortkey,
+ null as last_modified,
+ f.label as title,
+ f.description
+ from cr_items i, cr_folders f
+ where
+ i.parent_id = $current_item(item_id)
+ and i.item_id = f.folder_id
+ [template::list::orderby_clause -orderby -name item_list]
+ } \
+ -page_flush_p 1
+
+
+ bcms::item::list_items -parent_id $current_item(item_id) -multirow_name item_list -additional_columns [list creation_user] -orderby [template::list::orderby_clause -name item_list] -show_only [template::list::page_get_ids -name item_list]
+
+ set context_action "
+ Edit this Folder
+ Template this Folder
+ Use Categories
+ Add a Folder
+ Add a Page"
+
+ set context_help "This is a content folder. You can see the contents of the folder on your right. You may click the actions that can be performed on this folder on your left."
+ set title "View Folder Contents"
+} else {
+ template::list::create \
+ -name item_list \
+ -multirow item_list \
+ -pass_properties { package_url } \
+ -key template_id \
+ -bulk_actions {
+ "Delete" "${package_url}manage/template-delete" "Delete checked items"
+ } \
+ -bulk_action_export_vars {
+ return_url
+ } \
+ -elements {
+ title {
+ label "Template Title"
+ link_url_col name
+ }
+ }
+ bcms::template::list_templates -parent_id $current_item(item_id) -multirow_name item_list
+
+ set context_action "Add a Template"
+
+ set context_help "This is a template folder. You can see available templates on your right, you can add templates here"
+ set title "View Templates"
+}
+
+set context [bcms::widget::item_context -item_id $current_item(item_id) -root_id $root_id]
+set context [lrange $context 0 [expr [llength $context] - 2]]
+lappend context "$folder(label)"
+
+
Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/master.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/master.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/master.adp 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,56 @@
+
+
+
+@title@
+
+
+
+
+
+
+
+
@title@
+
+
+
+
@context_bar@
+
+
+
+
+
+
+
+ @context_action@
+
+
+
+
+ @context_help@
+
+
+ no help available
+
+
+
+
+
+
+
+
+
+
+
+
Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/master.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/master.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/master.tcl 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,9 @@
+set package_url [ad_conn package_url]
+set current_url [ad_return_url]
+
+if {[info exists context]} {
+ set context_bar [ad_context_bar_html $context]
+} else {
+ set context_bar [ad_context_bar]
+}
+set manage_type [ad_get_client_property -default content [ad_conn package_id] manage_type]
Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/page-view.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/page-view.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/page-view.adp 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,14 @@
+
+@title@
+@context@
+@context_action@
+@context_help@
+1
+
+
+Page Name: @current_item.name@
+Title: @page_revision.title@
+Description: @page_revision.description@
+
+Content:
@page_revision.content@
+
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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/page-view.tcl 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,41 @@
+ad_page_contract {
+ view a page revision, if no revision_id is passed then latest revision is used
+} {
+ {revision_id:optional,naturalnum $current_item(latest_revision)}
+}
+
+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 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"
+
+ set context_help "You can edit this page, etc."
+
+ set title "View Page"
+ set context [bcms::widget::item_context -item_id $current_item(item_id) -root_id $root_id]
+ set context [lrange $context 0 [expr [llength $context] - 2]]
+ lappend context "$page_revision(title)"
+
+} else {
+ set context_action "
+View Version(s)"
+
+ set context_help "This is a version of a page. You can only view this page"
+
+ set title "View Page Version"
+ set context [bcms::widget::item_context -item_id $current_item(item_id) -root_id $root_id]
+ lappend context "version $revision_id"
+
+}
+
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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/search-view.adp 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,8 @@
+
+@title@
+@context@
+
+
+
Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/search-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/search-view.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/search-view.tcl 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,20 @@
+ad_page_contract {
+ display search results
+} {
+ {name_search:optional ""}
+ {title_search:optional ""}
+ {content_search:optional ""}
+ {display_search_results:optional 0}
+ {orderby:optional ""}
+ {page:optional 1}
+}
+
+if {$display_search_results} {
+ set title "Search Results"
+} else {
+ set title "Search Form"
+}
+
+set package_url [ad_conn package_url]
+set context [list [list $package_url "Search"] $title]
+
Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/template-view.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/template-view.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/template-view.adp 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,12 @@
+
+@title@
+@context@
+@context_action@
+@context_help@
+
+
+@template_revision.title@
+@template_revision.description@
+
+@template_revision.content@
+
Index: openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/template-view.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/template-view.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/bcms-ui-base/template-view.tcl 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,36 @@
+ad_page_contract {
+ view a template revision, if no revision_id is passed then latest revision is used
+} {
+ {revision_id:optional,naturalnum $current_item(latest_revision)}
+}
+
+array set template_revision [bcms::revision::get_revision -revision_id $revision_id]
+
+set current_url [ad_return_url -urlencode]
+set package_url [ad_conn package_url]
+set context_action [list]
+lappend context_action "Edit This Template"
+lappend context_action "Delete This Template"
+
+set revision_action ""
+append revision_action ""
+lappend context_action $revision_action
+
+lappend context_action "Add Version"
+lappend context_action "Write/Publish This Template"
+
+set context_help ""
+
+set title "View Template"
+set context [bcms::widget::item_context -item_id $current_item(item_id) -root_id $root_id]
+set context [lrange $context 0 [expr [llength $context] - 2]]
+lappend context "$template_revision(title)"
Index: openacs-4/contrib/packages/bcms-ui-base/templates/public/default.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/public/Attic/default.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/public/default.adp 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,14 @@
+
+
+
+
+default template
+
+
Index: openacs-4/contrib/packages/bcms-ui-base/templates/public/default.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/public/Attic/default.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/public/default.tcl 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,47 @@
+ad_page_contract {
+ serve the correct template based from what is template assigned
+ on the cms_context of public
+} {
+}
+
+set root_id [bcms::folder::get_bcms_root_folder]
+set root_url [ad_conn package_url]
+set extra_url [ad_conn extra_url]
+if [string equal $extra_url ""] {set extra_url "/"}
+
+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]
+}
+
+# get the item by url
+array set current_item [bcms::item::get_item_by_url -root_id $root_id -url "$extra_url"]
+
+# check to see if there is a content item for this url.
+# array size 1 there is no live item in this url
+# array size 0 there is no item in this url
+if {[array size current_item] > 1} {
+
+ # lets check if we need to have / on the url
+ # if its a folder we need to add / and redirect
+ set current_url_list [ad_conn urlv]
+ set current_url [ad_conn url]
+ if {![regexp {/$} $current_url] \
+ && [string equal $current_item(content_type) "content_folder"]} {
+ ad_returnredirect "$current_url/"
+ ad_script_abort
+ }
+
+ # get the template for this item
+ array set one_template [bcms::template::get_template -item_id $current_item(item_id) -context public]
+
+ if {[array size one_template] > 0} {
+ ad_return_template /templates/public/$one_template(name)
+ }
+
+} else {
+ ns_returnnotfound
+ ad_script_abort
+}
+
Index: openacs-4/contrib/packages/bcms-ui-base/templates/public/folder.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/templates/public/Attic/folder.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/templates/public/folder.adp 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,5 @@
+
+
+new folder template
+
+
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 -r1.1 -r1.2
--- openacs-4/contrib/packages/bcms-ui-base/www/index.vuh 27 Aug 2003 17:33:49 -0000 1.1
+++ openacs-4/contrib/packages/bcms-ui-base/www/index.vuh 22 Sep 2003 07:36:47 -0000 1.2
@@ -1,8 +1,5 @@
-ad_page_contract {
- checks if this bcms instance in configured and then dispatches to the default
- template of the cms_context
-} {
-}
+# 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]
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 -r1.1 -r1.2
--- openacs-4/contrib/packages/bcms-ui-base/www/style.css 27 Aug 2003 17:33:49 -0000 1.1
+++ openacs-4/contrib/packages/bcms-ui-base/www/style.css 22 Sep 2003 07:36:47 -0000 1.2
@@ -28,6 +28,10 @@
text-decoration: underline;
}
+span.img-alt {
+ display: none;
+}
+
/* start - form template styles */
fieldset.formtemplate {
@@ -109,6 +113,137 @@
/* end - form template styles */
+
+/* start - list template style for item-list.adp */
+
+div.list {
+ width: 100%;
+ background-color: #AAAAAA;
+}
+
+div.list table.list-data {
+ width: 100%;
+}
+
+div.list div.list-paginator .prev-group {
+ background-image: url(/bcms-ui-base/bcms-ui-base-images/arrow-first.png);
+ background-repeat: no-repeat;
+ padding-left: 20px;
+}
+
+div.list div.list-paginator .prev-page {
+ background-image: url(/bcms-ui-base/bcms-ui-base-images/arrow-left.png);
+ background-repeat: no-repeat;
+ padding-left: 20px;
+}
+
+div.list div.list-paginator .next-group {
+ background-image: url(/bcms-ui-base/bcms-ui-base-images/arrow-last.png);
+ background-repeat: no-repeat;
+ padding-left: 20px;
+}
+
+div.list div.list-paginator .next-page {
+ background-image: url(/bcms-ui-base/bcms-ui-base-images/arrow-right.png);
+ background-repeat: no-repeat;
+ padding-left: 20px;
+}
+
+div.list table.list-data tr.list-header th {
+ background-color: #7590AE;
+ color: #FFFFFF;
+ border: 1px solid #000000;
+}
+
+div.list table.list-data tr.list-header th {
+ color: #FFFFFF;
+}
+
+div.list table.list-data tr.list-header a {
+ color: #FFFFFF;
+}
+
+div.list table.list-data tr.list-header th a.sort-desc {
+ background-image: url(/bcms-ui-base/bcms-ui-base-images/arrow-down.png);
+ background-repeat: no-repeat;
+ color: #FFFFFF;
+ padding-left: 20px;
+}
+
+div.list table.list-data tr.list-header th a.sort-asc {
+ background-image: url(/bcms-ui-base/bcms-ui-base-images/arrow-up.png);
+ background-repeat: no-repeat;
+ color: #FFFFFF;
+ padding-left: 20px;
+}
+
+div.list table.list-data tr.list-odd {
+ background-color: #FFFFFF;
+}
+
+div.list table.list-data tr.list-even {
+ background-color: #CCCCCC;
+}
+
+div.list table.list-data .list-narrow {
+ width: 25px;
+}
+
+div.list div.list-paginator {
+ text-align: center;
+ clear: both;
+}
+
+div.list div.list-actions {
+ background: #333F33;
+ clear: both;
+ width: 100%;
+ height: 30px;
+ margin: 2px;
+ padding: 8px 2px 2px 2px;
+}
+
+div.list div.list-actions .list-action {
+ color: #000000;
+ display: block;
+ float: left;
+ background: #AAAAAA;
+ border: 3px outset #AAAAAA;
+ padding: 2px;
+ margin-left: 5px;
+}
+
+div.list div.list-bulk-actions {
+ width: 100%;
+ height: 30px;
+ clear: both;
+ margin: 2px;
+ padding: 2px;
+}
+
+div.list div.list-bulk-actions .list-button {
+ color: #FFFFFF;
+ float: left;
+ background: #333F33;
+ border: 3px outset #333F33;
+ padding: 2px;
+ margin-left: 5px;
+}
+
+#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;
+}
+
+/* end - list template style for item-list.adp */
+
div.tabs {
background-color: #FFFFFF;
height: 25px;
@@ -268,24 +403,3 @@
}
/* 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/bcms-ui-base-images/arrow-down.png
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/arrow-down.png,v
diff -u
Binary files differ
Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/arrow-first.png
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/arrow-first.png,v
diff -u
Binary files differ
Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/arrow-last.png
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/arrow-last.png,v
diff -u
Binary files differ
Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/arrow-left.png
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/arrow-left.png,v
diff -u
Binary files differ
Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/arrow-right.png
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/arrow-right.png,v
diff -u
Binary files differ
Index: openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/arrow-up.png
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/bcms-ui-base-images/arrow-up.png,v
diff -u
Binary files differ
Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/relate-item.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/relate-item.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/www/manage/relate-item.adp 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,11 @@
+
+@title@
+@return_url@
+
+
+
+
+
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
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/www/manage/relate-item.tcl 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,57 @@
+ad_page_contract {
+ relate item_id_one with one or more content item
+} {
+ item_id_one:notnull
+ item_id:optional,multiple
+ {name_search:optional ""}
+ {title_search:optional ""}
+ {content_search:optional ""}
+ {display_search_results:optional 0}
+ {page:optional 1}
+ {orderby:optional ""}
+ return_url: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
+ }
+
+ ad_returnredirect $return_url
+ ad_script_abort
+}
+
+set package_url [ad_conn package_url]
+set content_type_search content_revision
+set bulk_actions {"Relate" "${package_url}manage/relate-item" "Relate checked items"}
+set bulk_action_export_vars {item_id_one return_url}
+
+
+template::list::create \
+ -name related_items \
+ -multirow related_items \
+ -key rel_id \
+ -pass_properties { package_url } \
+ -bulk_actions {
+ "Unrelate" "${package_url}manage/unrelate-item" "Unrelate checked items"
+ } \
+ -bulk_action_export_vars {
+ return_url
+ } \
+ -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
+
+
+
+
+set title "Relate Content"
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 -r1.1 -r1.2
--- openacs-4/contrib/packages/bcms-ui-base/www/manage/switch-type.tcl 27 Aug 2003 17:33:49 -0000 1.1
+++ openacs-4/contrib/packages/bcms-ui-base/www/manage/switch-type.tcl 22 Sep 2003 07:36:47 -0000 1.2
@@ -2,26 +2,31 @@
change what are managing, content or template
} {
manage_type:notnull
+ return_url:optional
}
-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
}
+ search {
+ ad_set_client_property -persistent t [ad_conn package_id] manage_type search
+ }
default {
ns_log error "bcms-ui-base: unknown manage type"
error "unknown manage_type, valid are content, template, category"
}
}
+if {[info exists return_url]} {
+ ad_returnredirect $return_url
+} else {
+ ad_returnredirect [ad_conn package_url]
+}
Index: openacs-4/contrib/packages/bcms-ui-base/www/manage/unrelate-item.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/contrib/packages/bcms-ui-base/www/manage/unrelate-item.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/contrib/packages/bcms-ui-base/www/manage/unrelate-item.tcl 22 Sep 2003 07:36:47 -0000 1.1
@@ -0,0 +1,11 @@
+ad_page_contract {
+ remove a relation of an item
+} {
+ rel_id:naturalnum,notnull
+ return_url:notnull
+}
+
+bcms::item::unrelate_item -rel_id $rel_id
+
+ad_returnredirect $return_url
+ad_script_abort