{= # # # get_file_items.cfv # # include "templates.util.base_util"; include "templates.util.encoding"; include "templates.util.rbac.rbac_util"; include "templates.file_manager.file_manager_util"; # This subroutine gets the file items # of the given pathname and the specified nodes, # indicated by index_from and index_to # debug_message("\n#### get_file_items.cfv \n"); string session_id = volatile.session_id; bool is_file_manager_permission = get_is_file_manager_permission(); string page_token = v.fp.page_token; if (is_file_manager_permission and get_is_valid_page_token(session_id, "file_manager", page_token)) then ( string item_id = v.fp.item_id; string file_manager_session_id = v.fp.file_manager_session_id; int index_from = v.fp.index_from; int index_to = v.fp.index_to; string pathname_in_utf8 = v.fp.pathname; pathname_in_utf8 = replace_all(pathname_in_utf8, "__HexEsc__5C", "\\"); string pathname_in_local_code_page = convert_utf8_to_local_code_page(pathname_in_utf8); # Get cached node string cached_files_node_name = md5_digest(pathname_in_utf8); string file_manager_sessions_path = "sessions_cache." . session_id . ".fil_man_" . file_manager_session_id; node files = file_manager_sessions_path . "." . cached_files_node_name; string files_dat = get_files_dat(files, index_from, index_to); # # Response # string dat = "{"; dat .= add_json("itemId", item_id, "string"); dat .= add_json("indexFrom", index_from, "int"); dat .= add_json("indexTo", index_to, "int"); dat .= add_json("filesToAdd", files_dat, "obj"); dat = close_json(dat); 'fileManager.getFileItemsResponse(' . dat . ')\n'; ) else ( # No permission to view this resource (URL) display_no_permission_html(); ); =}