| |
81 |
81 |
set write_p [permission::permission_p -no_cache \ |
| |
82 |
82 |
-party_id [ad_conn user_id] \ |
| |
83 |
83 |
-object_id ${rootfolder_id} \ |
| |
84 |
84 |
-privilege "write"] |
| |
85 |
85 |
if { $write_p } { set rootwrite_p "t" } else { set rootwrite_p "f" } |
| |
86 |
86 |
|
| |
87 |
87 |
lappend options "treerootnode:{text:\"$roottext\", id:\"$rootfolder_id\",\"attributes\":{\"write_p\":\"$rootwrite_p\"}}" |
| |
88 |
88 |
|
| |
89 |
89 |
lappend options "package_id:$package_id" |
| |
90 |
90 |
lappend options "package_url:\"[apm_package_url_from_id $package_id]\"" |
| |
91 |
91 |
lappend options "xmlhttpurl:\"[ajaxfs::get_url]\xmlhttp/\"" |
| |
92 |
92 |
|
| |
93 |
93 |
lappend options "rootfolder:$rootfolder_id" |
| |
94 |
94 |
lappend options "rootfoldername:\"$instance_name\"" |
| |
95 |
95 |
|
| |
96 |
96 |
if { [exists_and_not_null folder_id] && $folder_id != $rootfolder_id } { |
| |
97 |
97 |
lappend options "initOpenFolder:$folder_id" |
| |
98 |
98 |
lappend options "pathToFolder: new Array([ajaxfs::generate_path -folder_id $folder_id])" |
| |
99 |
99 |
} |
| |
100 |
100 |
|
| |
101 |
|
if { [exists_and_not_null public] || [permission::permission_p -no_login -no_cache -party_id [db_string "get_public" "select object_id from acs_magic_objects where name ='the_public'"] -object_id $package_id -privilege "read"] } { |
| |
|
101 |
# if { [exists_and_not_null public] || [permission::permission_p -no_login -no_cache -party_id [db_string "get_public" "select object_id from acs_magic_objects where name ='the_public'"] -object_id $package_id -privilege "read"] } { |
| |
102 |
102 |
lappend options "ispublic:true" |
| |
103 |
|
} |
| |
|
103 |
# } |
| |
104 |
104 |
|
| |
|
105 |
# notification type id |
| |
|
106 |
set notif_type_id [notification::type::get_type_id -short_name fs_fs_notif] |
| |
|
107 |
|
| |
|
108 |
lappend options "notif_type_id:\"$notif_type_id\"" |
| |
|
109 |
|
| |
105 |
110 |
if { [exists_and_not_null layoutdiv] } { |
| |
106 |
111 |
lappend options "layoutdiv:\"$layoutdiv\"" |
| |
107 |
112 |
} |
| |
108 |
113 |
|
| |
109 |
114 |
lappend options "max_file_size:\"$max_file_size\"" |
| |
110 |
115 |
lappend options "create_url:$create_url_p" |
| |
111 |
116 |
lappend options "share_folders:$share_folders_p" |
| |
112 |
117 |
lappend options "multi_file_upload:$multi_file_upload_p" |
| |
113 |
118 |
lappend options "user_id:\"$user_id\"" |
| |
114 |
119 |
lappend options "views_p:\"$views_p\"" |
| |
115 |
120 |
|
| |
116 |
121 |
set options [join $options ","] |
| |
117 |
122 |
|
| |
118 |
123 |
} else { |
| |
119 |
124 |
|
| |
120 |
125 |
ad_return_complaint 1 "Package id is required." |
| |
121 |
126 |
ad_script_abort |
| |
122 |
127 |
|
| |
123 |
128 |
} |