$templates.shared.doctype {= include "templates.shared.util.convert_name_to_integer_string"; subroutine(encode_display(string the_string), ( the_string = replace_all(the_string, "$", "$"); the_string; )); string pathname_request; string invalid_pathname; bool path_is_valid = false; bool pathname_request_is_file = false; bool show_path_not_found_alert = false; # clean file info node if (node_exists("volatile.file_info")) then ( delete_node("volatile.file_info"); ); # if this is a request with a defined pathname if (node_exists("volatile.pathname_request")) then ( pathname_request = volatile.pathname_request; # decode the pathname string # pathname_request = decode_pathname(pathname_request); debug_message("\n\n#### pathname request (encoded): " . pathname_request . "\n"); # ----------------------- # decode pathname_request # ----------------------- if (node_exists("volatile.dat")) then ( delete_node("volatile.dat"); ); split(pathname_request, "-", "volatile.dat"); pathname_request = ""; node item; foreach item "volatile.dat" ( pathname_request .= ascii_to_char(node_value(item)); ); debug_message("\n\n#### pathname request (decoded): " . pathname_request . "\n"); # ---------------------- # check if path is valid # ---------------------- path_is_valid = file_exists(pathname_request); debug_message("#### pathname request (decoded): " . pathname_request . "\n"); debug_message("#### path is valid: " . path_is_valid . "\n"); if (path_is_valid) then ( get_file_info(pathname_request, "volatile.file_info"); node file_info = "volatile.file_info"; debug_message("\n\nfile_info:\n" . node_as_string(file_info) . "\n\n"); string type = node_value(subnode_by_name(file_info, "type")); debug_message("pathname_request: " . replace_all(pathname_request, '$', 'DOLLAR') . "\n"); debug_message("file exists: " . path_is_valid . "\n"); if (type eq "file") then ( pathname_request_is_file = true; pathname_request = node_value(subnode_by_name(file_info, "parent")); ); # get the parent of the pathname_request which is used to move the directory one level up # get new "file info" because the pathname_request could have been modified above! delete_node(file_info); get_file_info(pathname_request, "volatile.file_info"); file_info = "volatile.file_info"; string parent_directory = convert_name_to_integer_string(node_value(subnode_by_name(file_info, "parent"))); ) else ( show_path_not_found_alert = true; invalid_pathname = pathname_request; invalid_pathname = replace_all(invalid_pathname, "\\", "\\u005C"); invalid_pathname = replace_all(invalid_pathname, "'", "\'"); pathname_request = ""; ); ) else ( # if there is no pathname defined yet (first time load) pathname_request = ""; ); =} {= expand(templates.shared.content_type); =} {= # hide contents until all frames are loaded '\n'; =}