Index: openacs-4/packages/dotlrn-ecommerce/www/pages/fs-cms.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/pages/fs-cms.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-ecommerce/www/pages/fs-cms.adp 26 Jul 2005 00:51:53 -0000 1.1 @@ -0,0 +1,25 @@ + +@current_item.title;noquote@ +@blackbackground_p@ + + + + + +
@sections.folder_label@
+ +

+ + +@current_item.content;noquote@ + + + + +
Index: openacs-4/packages/dotlrn-ecommerce/www/pages/fs-cms.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/pages/fs-cms.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-ecommerce/www/pages/fs-cms.tcl 26 Jul 2005 00:51:53 -0000 1.1 @@ -0,0 +1,69 @@ +ad_page_contract { + serve the correct template based from what is template assigned + on the cms_context of public +} { + file_id +} + + +#content::item::get -item_id $file_id -revision "live" -array_name current_item -resolve_index t +# we can't use content_item::get because table_name for +# file_storage_object is FS_ROOT_FOLDERS!! + +db_1row get_item "select cr.*, + ci.* + from cr_revisions cr, + cr_items ci + where ci.live_revision = cr.revision_id + and ci.item_id=:file_id" -column_array current_item + +if { ![string equal -length 4 "text" $current_item(mime_type)] } { + # It's a file. + cr_write_content -revision_id $current_item(revision_id) + ad_script_abort +} + +set index_p f +if {[string equal "benefits" $current_item(name)] || ([string equal "index" $current_item(name)] && ![string equal "" [ad_conn path_info]])} { + set index_p t + set root_id $current_item(parent_id) + # get the folders under this and use them as sections + db_multirow -extend {pdf_p} sections get_child_folders { + select parent_id as folder_id, + content_folder__get_label(parent_id) as folder_label, + item_id, + content_item__get_title(item_id) as item_label, + content_item__get_path(item_id, :root_id) as item_path, + tree_sortkey + from cr_items + where parent_id in (select folder_id + from cr_folders, cr_items i2 + where folder_id = i2.item_id and i2.parent_id = :root_id) + and live_revision is not null + union + select parent_id as folder_id, + content_folder__get_label(parent_id) as folder_label, + item_id, + content_extlink__get_label(item_id) as item_label, + content_extlink__get_url(item_id) as item_path, + tree_sortkey + from cr_items + where parent_id in (select folder_id + from cr_folders, cr_items i2 + where folder_id = i2.item_id and i2.parent_id = :root_id) + and content_type = 'content_extlink' + order by tree_sortkey + } { + set pdf_p [regexp -- {.+\.pdf$} $item_path] + } +} +#ad_return_complaint 1 "**'[ad_conn path_info]'**" +if {[string equal "index" $current_item(name)] || [string equal "benefits" [string trim [ad_conn path_info]]]} { + set blackbackground_p 1 +} else { + set blackbackground_p 0 +} +ad_return_template + + + Index: openacs-4/packages/dotlrn-ecommerce/www/pages/index.vuh =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/dotlrn-ecommerce/www/pages/index.vuh,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/dotlrn-ecommerce/www/pages/index.vuh 26 Jul 2005 00:51:53 -0000 1.1 @@ -0,0 +1,38 @@ +################## KLUDGE BY STAS ############### +# Try and look up the item in the content repository +################################################# +ad_page_contract { + + @author Unknown + @creation-date Unknown + @cvs-id $Id: index.vuh,v 1.1 2005/07/26 00:51:53 hamiltonc Exp $ +} { + { revision_id "" } +} +set urlv [split [ad_conn path_info] "/"] +set section_id [lindex $urlv 0] +set the_url [join [lrange $urlv 1 end] "/"] + +if {[catch {set pages_folder [dotlrn_ecommerce::section::get_public_folder_id $section_id]} errmsg]} { +# ad_return_complaint 1 "pages_folder '${pages_folder_id}' '${errmsg}'" + ns_returnnotfound +} + +set the_root [ns_info pageroot] + +set content_type "file_storage_object" +if {[string equal "" $the_url]} { + set the_url "/" +} + + +set file_id [content::item::get_id -item_path $the_url -root_folder_id $pages_folder -resolve_index t] +#ad_return_complaint 1 "file_id = '${file_id}'" +if {[string equal "" $file_id]} { +# ad_return_complaint 1 "pages_folder '${pages_folder}' '${errmsg}' the_url '${the_url}' '[ad_conn path_info]' '${urlv}'" + ns_returnnotfound +} + +rp_form_put file_id $file_id + +rp_internal_redirect /packages/dotlrn-ecommerce/lib/fs-cms \ No newline at end of file