Index: openacs-4/packages/acs-tcl/acs-tcl.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/acs-tcl.info,v diff -u -r1.22 -r1.23 --- openacs-4/packages/acs-tcl/acs-tcl.info 11 Jul 2002 00:57:52 -0000 1.22 +++ openacs-4/packages/acs-tcl/acs-tcl.info 19 Jul 2002 23:17:15 -0000 1.23 @@ -7,17 +7,17 @@ t t - + oracle postgresql - ACS Core Team + ACS Core Team The Tcl library procedures that comprise the ACS Kernel. - 2001-03-06 - ArsDigita Corporation + 2002-05-15 + OpenACS - + Index: openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl,v diff -u -r1.9 -r1.10 --- openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 10 Jul 2002 20:06:00 -0000 1.9 +++ openacs-4/packages/acs-tcl/tcl/form-processing-procs.tcl 19 Jul 2002 23:17:15 -0000 1.10 @@ -738,7 +738,7 @@ foreach {element_name validate_expr error_message} $validate_element { if { ![template::element error_p $form_name $element_name] && \ ![uplevel #$level [list expr $validate_expr]] } { - template::element set_error $form_name $element_name $error_message + template::element set_error $form_name $element_name [subst $error_message] } } } Index: openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 12 May 2002 20:57:02 -0000 1.4 +++ openacs-4/packages/acs-tcl/tcl/navigation-procs.tcl 19 Jul 2002 23:17:15 -0000 1.5 @@ -12,11 +12,16 @@ } -ad_proc ad_context_bar { args } { +ad_proc ad_context_bar { + -node_id + args +} { Returns a Yahoo-style hierarchical navbar. Includes "Your Workspace" or "Administration" if applicable, and the subsite if not global. + @param node_id If provided work up from this node, otherwise the current node + } { set context [list] @@ -25,7 +30,10 @@ lappend context [list "[ad_pvt_home]" "[ad_pvt_home_name]"] } - set node_id [ad_conn node_id] + if { ![info exists node_id] } { + set node_id [ad_conn node_id] + } + db_foreach context { select site_node.url(node_id) as url, object_id, acs_object.name(object_id) as object_name, Index: openacs-4/packages/acs-templating/acs-templating.info =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/acs-templating.info,v diff -u -r1.7 -r1.8 --- openacs-4/packages/acs-templating/acs-templating.info 9 Mar 2002 02:00:02 -0000 1.7 +++ openacs-4/packages/acs-templating/acs-templating.info 19 Jul 2002 23:17:15 -0000 1.8 @@ -30,7 +30,12 @@ + + + + + @@ -57,6 +62,7 @@ + Index: openacs-4/packages/acs-templating/resources/forms/confirm-button.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/resources/forms/confirm-button.tcl,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/resources/forms/confirm-button.tcl 12 May 2002 20:57:02 -0000 1.2 +++ openacs-4/packages/acs-templating/resources/forms/confirm-button.tcl 19 Jul 2002 23:17:15 -0000 1.3 @@ -12,7 +12,6 @@ # There's one exception - we set the special form element "__confirmed_p" true. This # informs ad_form that the use has indeed confirmed the submission. -ns_log Notice "Huh?" multirow create __form_contents__ __key__ __value__ if { ![empty_string_p [set __form__ [ns_getform]]] } { @@ -31,5 +30,3 @@ } } - -ns_log Notice "Huh? done" Index: openacs-4/packages/acs-templating/resources/forms/plain.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/resources/forms/plain.adp,v diff -u -r1.2 -r1.3 --- openacs-4/packages/acs-templating/resources/forms/plain.adp 12 May 2002 20:57:02 -0000 1.2 +++ openacs-4/packages/acs-templating/resources/forms/plain.adp 19 Jul 2002 23:17:15 -0000 1.3 @@ -7,7 +7,7 @@ - @elements.section@ + @elements.section@ Index: openacs-4/packages/acs-templating/resources/forms/plainest.adp =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/resources/forms/plainest.adp,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-templating/resources/forms/plainest.adp 19 Jul 2002 23:17:15 -0000 1.1 @@ -0,0 +1,86 @@ + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
@elements.section@
+ +
@elements.label@   + +
   +
+
+
+ + + + + + + +
\@formgroup.widget@\@formgroup.label@
+
+ \@formerror.@elements.id@\@ +
+
+
+ + + + + +
+ \@formerror.@elements.id@\@ +
+
+ +

Index: openacs-4/packages/acs-templating/tcl/0-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/Attic/0-procs.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/acs-templating/tcl/0-procs.tcl 12 Jul 2002 08:39:34 -0000 1.4 +++ openacs-4/packages/acs-templating/tcl/0-procs.tcl 19 Jul 2002 23:17:15 -0000 1.5 @@ -33,6 +33,7 @@ namespace eval util { namespace eval date {} namespace eval currency {} + namespace eval file {} } namespace eval element { Index: openacs-4/packages/acs-templating/tcl/file-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-templating/tcl/file-procs.tcl,v diff -u --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ openacs-4/packages/acs-templating/tcl/file-procs.tcl 19 Jul 2002 23:17:15 -0000 1.1 @@ -0,0 +1,42 @@ +# The new file type returns the list { file_name temp_file_name content_mime_type }. + +ad_proc -public template::data::transform::file { element_ref } { + + upvar $element_ref element + set element_id $element(id) + + # Work around Windows bullshit + set filename [ns_queryget $element_id] + + if { [string equal $filename ""] } { + return "" + } + + regsub -all {\\+} $filename {/} filename + regsub -all { +} $filename {_} filename + set filename [lindex [split $filename "/"] end] + return [list [list $filename [ns_queryget $element_id.tmpfile] [ns_queryget $element_id.content-type]]] + +} + +# Our file widget can't fail + +ad_proc -public template::data::validate::file { value_ref message_ref } { + return 1 +} + +ad_proc -public template::util::file::get_property { what file_list } { + + switch $what { + filename { + return [lindex $file_list 0] + } + tmp_filename { + return [lindex $file_list 1] + } + mime_type { + return [lindex $file_list 2] + } + } + +} Index: openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql 25 May 2002 14:27:49 -0000 1.2 +++ openacs-4/packages/file-storage/sql/oracle/file-storage-package-create.sql 19 Jul 2002 23:17:15 -0000 1.3 @@ -35,6 +35,7 @@ -- Create a file in CR in preparation for actual storage -- Wrapper for content_item.new -- + item_id in cr_items.item_id%TYPE default null, title in cr_items.name%TYPE, folder_id in cr_items.parent_id%TYPE, creation_user in acs_objects.creation_user%TYPE, @@ -263,6 +264,7 @@ -- Create a file in CR in preparation for actual storage -- Wrapper for content_item.new -- + item_id in cr_items.item_id%TYPE default null, title in cr_items.name%TYPE, folder_id in cr_items.parent_id%TYPE, creation_user in acs_objects.creation_user%TYPE, @@ -275,6 +277,7 @@ if new_file.indb_p = 't' then v_item_id := content_item.new( + item_id => new_file.item_id, name => new_file.title, parent_id => new_file.folder_id, creation_user => new_file.creation_user, Index: openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql,v diff -u -r1.2 -r1.3 --- openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql 25 May 2002 14:27:49 -0000 1.2 +++ openacs-4/packages/file-storage/sql/postgresql/file-storage-package-create.sql 19 Jul 2002 23:17:15 -0000 1.3 @@ -155,18 +155,22 @@ -- Create a file in CR in preparation for actual storage -- Wrapper for content_item__new -- + -- DRB: I added this version to allow one to predefine item_id, among other things to + -- make it easier to use with ad_form varchar, -- cr_items.name%TYPE, integer, -- cr_items.parent_id%TYPE, integer, -- acs_objects.creation_user%TYPE, varchar, -- acs_objects.creation_ip%TYPE, - boolean -- store in db? + boolean, -- store in db? + integer -- cr_items.item_id%TYPE, ) returns integer as ' -- cr_items.item_id%TYPE declare new_file__title alias for $1; new_file__folder_id alias for $2; new_file__user_id alias for $3; new_file__creation_ip alias for $4; new_file__indb_p alias for $5; + new_file__item_id alias for $6; v_item_id cr_items.item_id%TYPE; begin @@ -175,7 +179,7 @@ select content_item__new ( new_file__title, -- name new_file__folder_id, -- parent_id - null, -- item_id (default) + new_file__item_id, -- item_id (default) null, -- locale (default) now(), -- creation_date (default) new_file__user_id, -- creation_user @@ -194,7 +198,7 @@ select content_item__new ( new_file__title, -- name new_file__folder_id, -- parent_id - null, -- item_id (default) + new_file__item_id, -- item_id (default) null, -- locale (default) now(), -- creation_date (default) new_file__user_id, -- creation_user @@ -218,8 +222,35 @@ return v_item_id; end;' language 'plpgsql'; + +create function file_storage__new_file( + varchar, -- cr_items.name%TYPE, + integer, -- cr_items.parent_id%TYPE, + integer, -- acs_objects.creation_user%TYPE, + varchar, -- acs_objects.creation_ip%TYPE, + boolean -- store in db? +) returns integer as ' -- cr_items.item_id%TYPE +declare + new_file__title alias for $1; + new_file__folder_id alias for $2; + new_file__user_id alias for $3; + new_file__creation_ip alias for $4; + new_file__indb_p alias for $5; +begin + return file_storage__new_file( + new_file__title, + new_file__folder_id, + new_file__user_id, + new_file__creation_ip, + new_file__indb_p, + null + ); + +end;' language 'plpgsql'; + + create function file_storage__delete_file ( -- -- Delete a file and all its version Index: openacs-4/packages/file-storage/www/file-move-2.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/file-move-2.tcl,v diff -u -r1.4 -r1.5 --- openacs-4/packages/file-storage/www/file-move-2.tcl 25 Sep 2001 16:52:29 -0000 1.4 +++ openacs-4/packages/file-storage/www/file-move-2.tcl 19 Jul 2002 23:17:15 -0000 1.5 @@ -71,9 +71,5 @@ return } - ad_returnredirect "?folder_id=$parent_id" - - -