- |
+ |
- @contents.name@
-( new )
+ @contents.name@
+
|
|
@@ -25,21 +30,21 @@
- |
+ |
- @contents.name@
-( new )
+ @contents.name@
+
|
-
- [
+
+
-
+ [
edit
|
-
+
delete
@@ -50,18 +55,18 @@
@contents.last_modified@ |
- |
+ |
-
+
@contents.name@
- ( new )
+
|
[
-
+
view details
]
Index: openacs-4/packages/file-storage/www/folder-chunk.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-chunk.tcl,v
diff -u -r1.7 -r1.8
--- openacs-4/packages/file-storage/www/folder-chunk.tcl 10 Sep 2002 22:22:56 -0000 1.7
+++ openacs-4/packages/file-storage/www/folder-chunk.tcl 17 Sep 2002 21:03:27 -0000 1.8
@@ -19,12 +19,44 @@
set viewing_user_id [acs_magic_object "the_public"]
}
+permission::require_permission -party_id $viewing_user_id -object_id $folder_id -privilege "read"
+
if {![exists_and_not_null n_past_days]} {
set n_past_days 99999
}
+if {![exists_and_not_null fs_url]} {
+ set fs_url ""
+}
+
set folder_name [fs::get_object_name -object_id $folder_id]
+db_multirow -extend { write_p delete_p admin_p read_p} contents select_folder_contents {} {
+ set file_upload_name [fs::remove_special_file_system_characters -string $file_upload_name]
+ if { $type == "url" } {
+ #url is the only type that uses this in the UI and permission checking is expensive.
+ set admin_p [permission::permission_p -party_id $viewing_user_id -object_id $object_id -privilege "admin"]
+ if { $admin_p } {
+ set write_p 1
+ set delete_p 1
+ set read_p 1
+ } else {
+ set write_p [permission::permission_p -party_id $viewing_user_id -object_id $object_id -privilege "write"]
+ set delete_p [permission::permission_p -party_id $viewing_user_id -object_id $object_id -privilege "delete"]
+ if {!$write_p && !$delete_p} {
+ set read_p [permission::permission_p -party_id $viewing_user_id -object_id $object_id -privilege "read"]
+ } else {
+ set read_p 1
+ }
+ }
+ } else {
+ set admin_p 0
+ set write_p 0
+ set delete_p 0
+ set read_p 0
+ }
+}
+
set rows [fs::get_folder_contents \
-folder_id $folder_id \
-user_id $viewing_user_id \
Index: openacs-4/packages/file-storage/www/folder-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-delete.tcl,v
diff -u -r1.3 -r1.4
--- openacs-4/packages/file-storage/www/folder-delete.tcl 5 Sep 2002 09:29:00 -0000 1.3
+++ openacs-4/packages/file-storage/www/folder-delete.tcl 17 Sep 2002 21:03:27 -0000 1.4
@@ -56,6 +56,8 @@
ad_returnredirect "index?folder_id=$parent_id"
+ ad_script_abort
+
} else {
# they still need to confirm
@@ -64,6 +66,4 @@
set context [fs_context_bar_list -final "Delete" $folder_id]
- ad_return_template
-
}
\ No newline at end of file
Index: openacs-4/packages/file-storage/www/folder-edit-2-oracle.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/folder-edit-2-oracle.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/file-storage/www/folder-edit-2-oracle.xql 17 Sep 2002 21:03:27 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+ oracle8.1.6
+
+
+
+ begin
+ content_folder.rename (
+ folder_id => :folder_id,
+ label => :folder_name
+ );
+ end;
+
+
+
+
Index: openacs-4/packages/file-storage/www/folder-edit-2-postgresql.xql
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/folder-edit-2-postgresql.xql,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/file-storage/www/folder-edit-2-postgresql.xql 17 Sep 2002 21:03:27 -0000 1.1
@@ -0,0 +1,17 @@
+
+
+
+ postgresql7.1
+
+
+
+ select content_folder__rename (
+ :folder_id,
+ null, -- name
+ :folder_name, -- label
+ null -- description
+ );
+
+
+
+
Index: openacs-4/packages/file-storage/www/folder-edit-2.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/Attic/folder-edit-2.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/file-storage/www/folder-edit-2.tcl 17 Sep 2002 21:03:27 -0000 1.1
@@ -0,0 +1,36 @@
+ad_page_contract {
+ Script to rename a folder.
+
+ @author Andrew Grumet (aegrumet@alum.mit.edu)
+ @creation-date 24 Jun 2002
+ @cvs-id $Id: folder-edit-2.tcl,v 1.1 2002/09/17 21:03:27 jeffd Exp $
+} {
+ folder_id:integer,notnull
+ folder_name:trim,notnull
+} -validate {
+ valid_folder -requires {folder_id:integer} {
+ if ![fs_folder_p $folder_id] {
+ ad_complain "The specified folder does not exist."
+ }
+ }
+}
+
+set user_id [ad_conn user_id]
+
+ad_require_permission $folder_id admin
+
+# get their IP
+
+set creation_ip [ad_conn peeraddr]
+
+# strip out spaces from the name
+
+#We can't rename the item because this breaks the syllabus
+#portlet. aegrumet/2002-08-28
+#regsub -all { +} [string tolower $folder_name] {_} name
+
+db_exec_plsql folder_rename {}
+
+ad_returnredirect "?folder_id=$folder_id"
+
+
Index: openacs-4/packages/file-storage/www/folder-edit.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-edit.adp,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/file-storage/www/folder-edit.adp 17 Sep 2002 21:03:27 -0000 1.1
@@ -0,0 +1,20 @@
+
+Edit Folder
+@context_bar@
+
+
+
\ No newline at end of file
Index: openacs-4/packages/file-storage/www/folder-edit.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/folder-edit.tcl,v
diff -u
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ openacs-4/packages/file-storage/www/folder-edit.tcl 17 Sep 2002 21:03:27 -0000 1.1
@@ -0,0 +1,28 @@
+ad_page_contract {
+ form to edit a folder
+
+ @author Andrew Grumet (aegrumet@alum.mit.edu)
+ @creation-date 24 Jun 2002
+ @cvs-id $Id: folder-edit.tcl,v 1.1 2002/09/17 21:03:27 jeffd Exp $
+} {
+ folder_id:integer,notnull
+} -validate {
+ valid_folder -requires {parent_id:integer} {
+ if ![fs_folder_p $folder_id] {
+ ad_complain "The specified folder does not exist."
+ }
+ }
+} -properties {
+ folder_id:onevalue
+ context_bar:onevalue
+}
+
+ad_require_permission $folder_id admin
+
+# set templating datasources
+
+set context_bar [fs_context_bar_list -final "Edit" $folder_id]
+
+set folder_name [fs_get_folder_name $folder_id]
+
+ad_return_template
Index: openacs-4/packages/file-storage/www/index.adp
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/index.adp,v
diff -u -r1.16 -r1.17
--- openacs-4/packages/file-storage/www/index.adp 6 Sep 2002 21:50:38 -0000 1.16
+++ openacs-4/packages/file-storage/www/index.adp 17 Sep 2002 21:03:27 -0000 1.17
@@ -3,68 +3,55 @@
@folder_name@
@context@
-
-
-
Index: openacs-4/packages/file-storage/www/version-delete.tcl
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/version-delete.tcl,v
diff -u -r1.5 -r1.6
--- openacs-4/packages/file-storage/www/version-delete.tcl 5 Sep 2002 09:29:00 -0000 1.5
+++ openacs-4/packages/file-storage/www/version-delete.tcl 17 Sep 2002 21:03:27 -0000 1.6
@@ -50,11 +50,14 @@
# Redirect to the folder, instead of the latest revision (which does not exist anymore)
ad_returnredirect "index?folder_id=$parent_id"
+ ad_script_abort
+
} else {
# Ok, we don't have to do anything fancy, just redirect to th last revision
ad_returnredirect "file?file_id=$item_id"
-
+
+ ad_script_abort
}
} else {
@@ -67,5 +70,4 @@
and revision_id = :version_id"
set context [fs_context_bar_list -final "Delete Version" $item_id]
- ad_return_template
}
Index: openacs-4/packages/file-storage/www/graphics/new.gif
===================================================================
RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/www/graphics/new.gif,v
diff -u
Binary files differ
| | | |