Index: openacs-4/packages/static-pages/tcl/static-pages-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/static-pages/tcl/static-pages-procs.tcl,v diff -u -r1.8 -r1.9 --- openacs-4/packages/static-pages/tcl/static-pages-procs.tcl 3 Dec 2001 16:58:46 -0000 1.8 +++ openacs-4/packages/static-pages/tcl/static-pages-procs.tcl 15 Dec 2001 01:39:28 -0000 1.9 @@ -7,7 +7,6 @@ @cvs-id $Id$ } - ad_proc -public sp_sync_cr_with_filesystem { { -file_add_proc "" @@ -19,7 +18,7 @@ fs_root root_folder_id { - static_page_regexp {\.html?$} + static_page_regexp {} } } { Synchronize the content repository with the file system. @@ -60,6 +59,8 @@ set fs_trimmed [string trimright $fs_root "/"] set fs_trimmed_length [string length $fs_trimmed] + set static_page_regexp "\.[join [split [string trim [ad_parameter -package_id [nsv_get static_pages package_id] AllowedExtensions]] " "] "$|\."]$" + foreach file [ad_find_all_files $fs_root] { if { [regexp -nocase $static_page_regexp $file match] } { # Chop the starting path off of the full pathname and split it up: @@ -393,50 +394,82 @@ } { set filename [ad_conn file] set sp_filename [sp_get_relative_file_path $filename] - + set page_id [util_memoize [list sp_get_page_id $sp_filename]] + set package_id [nsv_get static_pages package_id] + + set file [ad_conn file] + ad_conn -set subsite_id [site_node_closest_ancestor_package "acs-subsite"] + # If the page is in the db, serve it carefully; otherwise just dump it out. if { $page_id >= 0 } { - set page_info [util_memoize [list sp_get_page_info_query $page_id]] + set page_info [util_memoize [list sp_get_page_info_query $page_id]] - # We only show the link here if the_public has - # general_comments_create privilege on the page. Why the_public - # rather than the current user? Because we don't want admins to - # be seeing "Add a comment" links on non-commentable pages. - # - set comment_link "" - if { [ad_permission_p -user_id [acs_magic_object the_public] $page_id general_comments_create] } { + # We only show the link here if the_public has + # general_comments_create privilege on the page. Why the_public + # rather than the current user? Because we don't want admins to + # be seeing "Add a comment" links on non-commentable pages. + # + set comment_link "" + if { [ad_permission_p -user_id [acs_magic_object the_public] $page_id general_comments_create] } { - append comment_link "