[%# Parameters We Are Expecting: ============================ action: The URL for the the 'action button', will implicitly append dir and file url params. dirs_only: Display the 'action button' only for directories or symlinks to directories. files_only: Display the 'action button' only for file items (the inverse of dirs_only). content: The HTML contents of the action button item (name and icon) %] [% SET dir = RAW_FORM.item('dir'); SET homedir = CPANEL.homedir; SET homedir = homedir.replace('/$', ''); # Normalize dir SET dir = '/' _ dir.split('/').grep('[^/\s]').join('/') _ '/'; SET dir = dir.replace('//','/') %] [% PROCESS "_assets/mime_types_icon_classes.tt" #Get the MimeTypesIconClasses hash %] [% SET list_files_response = execute ("Fileman", "list_files", { dir => dir, include_mime => 1, show_hidden => 1 }); IF list_files_response.status != 0; SET list_of_files = list_files_response.data; SET up_one = dir.split('/').slice(0,-2).join('/'); %]
| [% locale.maketext('Name') %] | [% locale.maketext('Size') %] | [% locale.maketext('Actions') %] | |||
|---|---|---|---|---|---|
| [%# Deliberately removed whitespace to prevent annoying underlines in the wrong spot from a:hover css %] [%- IF entry.type == 'link' -%][%- END -%][%entry.file.html()%] | [% UNLESS files_only %] [% INCLUDE button %] [% END %] | [% ELSE %][%entry.file.html()%] | [% entry.humansize.html() %] | [% UNLESS dirs_only %] [% INCLUDE button %] [% END %] | [% END %]|
| [% locale.maketext('No files or folders are available.') %] | |||||