Commit 1e862189 authored by Frank Bergmann's avatar Frank Bergmann

- Added path + name option for mkdir operation

parent 324a1c71
...@@ -17,12 +17,17 @@ ad_library { ...@@ -17,12 +17,17 @@ ad_library {
# Constants # Constants
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# File
ad_proc -public im_file_status_active {} { return 91000 } ad_proc -public im_file_status_active {} { return 91000 }
ad_proc -public im_file_status_deleted {} { return 91002 } ad_proc -public im_file_status_deleted {} { return 91002 }
ad_proc -public im_file_type_default {} { return 91100 } ad_proc -public im_file_type_default {} { return 91100 }
# File Version
ad_proc -public im_file_version_status_active {} { return 91200 } ad_proc -public im_file_version_status_active {} { return 91200 }
ad_proc -public im_file_version_status_deleted {} { return 91202 } ad_proc -public im_file_version_status_deleted {} { return 91202 }
ad_proc -public im_file_version_type_default {} { return 91300 } ad_proc -public im_file_version_type_default {} { return 91300 }
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
......
...@@ -7,12 +7,13 @@ ad_page_contract { ...@@ -7,12 +7,13 @@ ad_page_contract {
} { } {
{ project_id:integer "" } { project_id:integer "" }
{ path ""} { path ""}
{ name ""}
} }
set user_id [ad_conn user_id] set user_id [ad_conn user_id]
set package_id [ad_conn package_id] set package_id [ad_conn package_id]
set package_id [db_string package "select min(package_id) from apm_packages where package_key = 'file-storage'" -default $package_id] set package_id [db_string package "select min(package_id) from apm_packages where package_key = 'file-storage'" -default $package_id]
ns_log Notice "mkdir: path=$path, project_id=$project_id" ns_log Notice "mkdir: path=$path, name=$name, project_id=$project_id"
if {"" ne $project_id} { if {"" ne $project_id} {
set folder_id [im_rest_fs_folder_for_object -object_id $project_id] set folder_id [im_rest_fs_folder_for_object -object_id $project_id]
...@@ -21,6 +22,7 @@ if {"" ne $project_id} { ...@@ -21,6 +22,7 @@ if {"" ne $project_id} {
set file_id [db_nextval "acs_object_id_seq"] set file_id [db_nextval "acs_object_id_seq"]
if {"" ne $name} { set path "$path/$name" }
set path_pieces [split $path "/"] set path_pieces [split $path "/"]
set parent_pieces [lrange $path_pieces 0 end-1] set parent_pieces [lrange $path_pieces 0 end-1]
set folder_name [lindex $path_pieces end] set folder_name [lindex $path_pieces end]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment