Index: openacs-4/packages/file-storage/tcl/file-storage-callback-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-callback-procs.tcl,v diff -u -r1.13 -r1.14 --- openacs-4/packages/file-storage/tcl/file-storage-callback-procs.tcl 10 Jul 2018 08:20:38 -0000 1.13 +++ openacs-4/packages/file-storage/tcl/file-storage-callback-procs.tcl 10 Jul 2018 09:39:30 -0000 1.14 @@ -10,10 +10,54 @@ @cvs-id $Id$ } -namespace eval fs::folder_chunk {} - # Define file storage callbacks +namespace eval fs:: {} + +ad_proc -public -callback fs::folder_new { + {-package_id:required} + {-folder_id:required} +} { + Append extra logics to folder creation. +} - + +ad_proc -public -callback fs::folder_edit { + {-package_id:required} + {-folder_id:required} +} { + Append extra logics to folder editing. +} - + +ad_proc -public -callback fs::folder_delete { + {-package_id:required} + {-folder_id:required} +} { + Append extra logics to folder deletion. +} - + +ad_proc -public -callback fs::file_new { + {-package_id:required} + {-file_id:required} +} { + Append extra logics to file creation. +} - + +ad_proc -public -callback fs::file_edit { + {-package_id:required} + {-file_id:required} +} { + Append extra logics to file editing. +} - + +ad_proc -public -callback fs::file_delete { + {-package_id:required} + {-file_id:required} +} { + Append extra logics to file deletion. +} - + +namespace eval fs::folder_chunk {} + ad_proc -public -callback fs::folder_chunk::add_bulk_actions { {-bulk_variable:required} {-folder_id:required} @@ -55,7 +99,7 @@ @author Jowell S. Sabino (jowellsabino@netscape.net) @creation-date 2005-06-13 - returns a datasource for the search package + Returns a datasource for the search package this is the content that will be indexed by the full text search engine. @@ -90,7 +134,7 @@ } { Copy a folder to another class or community } { -#get the destiny's root folder + #get the destiny's root folder set parent_id [dotlrn_fs::get_community_root_folder -community_id $selected_community] set new_folder_id [fs_folder_copy -old_folder_id $object_id -new_parent_id $parent_id -mode $mode] @@ -102,7 +146,7 @@ {-package_id:required} {-project_id:required} } { - create a new folder for each new project + Create a new folder for each new project } { set pm_name [pm::project::name -project_item_id $project_id] @@ -122,96 +166,93 @@ #Callbacks for application-track ad_proc -callback application-track::getApplicationName -impl file_storage {} { - callback implementation - } { - return "file_storage" - } + Callback implementation +} { + return "file_storage" +} - ad_proc -callback application-track::getGeneralInfo -impl file_storage {} { - callback implementation - } { +ad_proc -callback application-track::getGeneralInfo -impl file_storage {} { + Callback implementation +} { - db_1row my_query { - select count(1) as result - from acs_objects a, acs_objects b - where b.object_id = :comm_id - and a.tree_sortkey between b.tree_sortkey - and tree_right(b.tree_sortkey) - and a.object_type = 'file_storage_object' - } - - - return "$result" - } + db_1row my_query { + select count(1) as result + from acs_objects a, acs_objects b + where b.object_id = :comm_id + and a.tree_sortkey between b.tree_sortkey + and tree_right(b.tree_sortkey) + and a.object_type = 'file_storage_object' + } + + + return "$result" +} - ad_proc -callback application-track::getSpecificInfo -impl file_storage {} { - callback implementation - } { - - upvar $query_name my_query - upvar $elements_name my_elements - - set my_query { - - SELECT f.name as name, f.file_id, f.type as type, f.content_size as size, - fo.name as folder_name, - to_char(f.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified, - to_char(o.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_date, - (select site_node__url(site_nodes.node_id) - from site_nodes, acs_objects - where site_nodes.object_id = file_storage__get_package_id(f.parent_id) and acs_objects.object_id = f.file_id) as url, - com.community_id as class_id - FROM fs_files f,fs_folders fo,dotlrn_communities_full com,acs_objects o, acs_objects o2 - WHERE f.file_id = o.object_id - and com.community_id=:class_instance_id - and o2.object_id= file_storage__get_package_id(f.parent_id) - and o2.context_id=com.package_id - and fo.folder_id = f.parent_id - - } - - - set my_elements { - name { - label "Name" - display_col name - html {align center} - - } - type { - label "Type" - display_col type - html {align center} - - } - folder { - label "Folder" - display_col folder_name - html {align center} - } - size { - label "Size (bytes)" - display_col size - html {align center} - - } - last_modification_date { - label "Last_Modification_Date" - display_col last_modified - html {align center} - } - post_date { - label "Post_Date" - display_col creation_date - html {align center} - - } - - } - - - } +ad_proc -callback application-track::getSpecificInfo -impl file_storage {} { + Callback implementation +} { + upvar $query_name my_query + upvar $elements_name my_elements + + set my_query { + + SELECT f.name as name, f.file_id, f.type as type, f.content_size as size, + fo.name as folder_name, + to_char(f.last_modified, 'YYYY-MM-DD HH24:MI:SS') as last_modified, + to_char(o.creation_date, 'YYYY-MM-DD HH24:MI:SS') as creation_date, + (select site_node__url(site_nodes.node_id) + from site_nodes, acs_objects + where site_nodes.object_id = file_storage__get_package_id(f.parent_id) and acs_objects.object_id = f.file_id) as url, + com.community_id as class_id + FROM fs_files f,fs_folders fo,dotlrn_communities_full com,acs_objects o, acs_objects o2 + WHERE f.file_id = o.object_id + and com.community_id=:class_instance_id + and o2.object_id= file_storage__get_package_id(f.parent_id) + and o2.context_id=com.package_id + and fo.folder_id = f.parent_id + + } + + set my_elements { + name { + label "Name" + display_col name + html {align center} + + } + type { + label "Type" + display_col type + html {align center} + + } + folder { + label "Folder" + display_col folder_name + html {align center} + } + size { + label "Size (bytes)" + display_col size + html {align center} + + } + last_modification_date { + label "Last_Modification_Date" + display_col last_modified + html {align center} + } + post_date { + label "Post_Date" + display_col creation_date + html {align center} + + } + + } +} + # Local variables: # mode: tcl # tcl-indent-level: 4 Index: openacs-4/packages/file-storage/tcl/file-storage-install-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/file-storage/tcl/file-storage-install-procs.tcl,v diff -u -r1.15 -r1.16 --- openacs-4/packages/file-storage/tcl/file-storage-install-procs.tcl 7 Aug 2017 23:48:11 -0000 1.15 +++ openacs-4/packages/file-storage/tcl/file-storage-install-procs.tcl 10 Jul 2018 09:39:30 -0000 1.16 @@ -171,44 +171,6 @@ } } -ad_proc -public -callback fs::folder_new { - {-package_id:required} - {-folder_id:required} -} { -} - -ad_proc -public -callback fs::folder_edit { - {-package_id:required} - {-folder_id:required} -} { -} - -ad_proc -public -callback fs::folder_delete { - {-package_id:required} - {-folder_id:required} -} { -} - -ad_proc -public -callback fs::file_new { - {-package_id:required} - {-file_id:required} -} { -} - -ad_proc -public -callback fs::file_edit { - {-package_id:required} - {-file_id:required} -} { -} - -ad_proc -public -callback fs::file_delete { - {-package_id:required} - {-file_id:required} -} { -} - - - # Local variables: # mode: tcl # tcl-indent-level: 4