{* $Id$ *} {strip} {if $file.isgal eq 1} {if $file.perms.tiki_p_view_file_gallery eq 'y'} {self_link _icon_name='file-archive-open' _menu_text=$menu_text _menu_icon=$menu_icon galleryId=$file.id} {tr}Browse{/tr} {/self_link} {/if} {if $file.perms.tiki_p_create_file_galleries eq 'y'} {self_link _icon_name='edit' _menu_text=$menu_text _menu_icon=$menu_icon edit_mode=1 galleryId=$file.id} {tr}Properties{/tr} {/self_link} {/if} {if $file.perms.tiki_p_upload_files eq 'y' and ( $file.perms.tiki_p_admin_file_galleries eq 'y' or ($user and $file.user eq $user) or $file.public eq 'y' )}
{icon name='upload'} {tr}Upload{/tr}
{/if} {if $file.perms.tiki_p_assign_perm_file_gallery eq 'y'}
{if $file.public neq 'y'} {permission_link mode=text type="file gallery" permType="file galleries" id=$file.id title=$file.name} {else} {permission_link mode=text type="file gallery" permType="file galleries" id=$file.id title=$file.name} {/if}
{/if} {if $prefs.feature_webdav eq 'y'} {assign var=virtual_path value=$file.id|virtual_path:'filegal'} {icon name="file-archive-open"}{tr}Open as WebFolder{/tr} {/if} {if $file.perms.tiki_p_create_file_galleries eq 'y'} {self_link _icon_name='remove' _menu_text=$menu_text _menu_icon=$menu_icon removegal=$file.id _onclick="confirmPopup('{tr}Delete gallery?{/tr}', '{ticket mode=get}')"} {tr}Delete{/tr} {/self_link} {/if} {else} {if $prefs.javascript_enabled eq 'y'} {if $menu_text neq 'y'} {* This is needed for the 'Upload New Version' action to be correctly displayed when there is only an icon menu (or actions in a column of the table) *}
{/if} {/if} {if $file.type|truncate:6:'':true eq 'image/' and $file.perms.tiki_p_download_files eq 'y'} {icon name='view' _menu_text=$menu_text _menu_icon=$menu_icon alt="{tr}Display{/tr}"} {if $file.perms.tiki_p_upload_files eq 'y' and $prefs.feature_draw eq 'y'} {if $file.type eq 'image/svg+xml' or $file.type eq 'image/jpeg' or $file.type eq 'image/gif' or $file.type eq 'image/png' or $file.type eq 'image/tiff' } {icon name='edit' _menu_text=$menu_text _menu_icon=$menu_icon alt="{tr}Edit{/tr}"} {/if} {/if} {elseif $tiki_p_upload_files eq 'y' and $prefs.wikiplugin_diagram eq 'y' and $file.id|file_diagram} {icon name='view' _menu_text=$menu_text _menu_icon=$menu_icon alt="{tr}Display{/tr}"}
{icon name='edit' _menu_text=$menu_text _menu_icon=$menu_icon alt="{tr}Edit{/tr}"}
{elseif $file.type eq 'text/csv' and $prefs.feature_sheet eq 'y'} {icon name='view' _menu_text=$menu_text _menu_icon=$menu_icon alt="{tr}Display{/tr}"} {elseif $prefs.fgal_pdfjs_feature eq 'y' and $file.type eq 'application/pdf'} {icon name='view' _menu_text=$menu_text _menu_icon=$menu_icon alt="{tr}Display{/tr}"} {elseif ($file.type eq 'application/vnd.oasis.opendocument.text' or $file.type eq 'application/octet-stream') and $prefs.feature_docs eq 'y'} {icon name='view' _menu_text=$menu_text _menu_icon=$menu_icon alt="{tr}Display{/tr}"} {if $file.perms.tiki_p_upload_files eq 'y'} {icon name='edit' _menu_text=$menu_text _menu_icon=$menu_icon alt="{tr}Edit{/tr}"} {/if} {elseif $prefs.h5p_enabled eq 'y' and $file.type eq 'application/zip' and preg_match('/\.h5p$/i', $file.filename)} {icon name='view' _menu_text=$menu_text _menu_icon=$menu_icon alt="{tr}Display{/tr}"} {elseif $file.type eq 'application/mxgraph'} {icon name='edit' _menu_text=$menu_text _menu_icon=$menu_icon alt="{tr}Edit{/tr}"} {/if} {if $prefs.fgal_pdfjs_feature eq 'y' and $prefs.fgal_convert_documents_pdf eq 'y' and ($file.type|file_can_convert_to_pdf)} {icon name='view' _menu_text=$menu_text _menu_icon=$menu_icon alt="{tr}Display as PDF{/tr}"} {/if} {if (isset($file.p_download_files) and $file.p_download_files eq 'y') or (!isset($file.p_download_files) and $file.perms.tiki_p_download_files eq 'y')} {if $gal_info.type eq 'podcast' or $gal_info.type eq 'vidcast'} {else} {/if} {if $prefs.feature_file_galleries_save_draft eq 'y' and $file.nbDraft gt 0} {assign var=download_action_title value="{tr}Download current version{/tr}"} {else} {assign var=download_action_title value="{tr}Download{/tr}"} {/if} {icon _menu_text=$menu_text _menu_icon=$menu_icon name='floppy' alt="$download_action_title"} {/if} {icon name='eye' _menu_text=$menu_text _menu_icon=$menu_icon alt="{tr}Browser display{/tr} ({tr}Raw{/tr} / {tr}Download{/tr})"} {if $gal_info.archives gt -1} {if isset($file.nbArchives) and $file.nbArchives gt 0} {assign var=nb_archives value=$file.nbArchives} {icon _menu_text=$menu_text _menu_icon=$menu_icon name='file-archive' alt="{tr}Archives{/tr} ($nb_archives)"} {else} {icon _menu_text=$menu_text _menu_icon=$menu_icon name='file-archive' alt="{tr}Archives{/tr}"} {/if} {assign var=replace_action_title value="{tr}Upload new version{/tr}"} {else} {assign var=replace_action_title value="{tr}Replace{/tr}"} {/if} {if $prefs.feature_file_galleries_save_draft eq 'y'} {if $file.nbDraft gt 0} {assign var=replace_action_title value="{tr}Replace draft{/tr}"} {else} {assign var=replace_action_title value="{tr}Upload draft{/tr}"} {/if} {/if} {* can edit if I am admin or the owner of the file or the locker of the file or if I have the perm to edit file on this gallery *} {if $file.perms.tiki_p_admin_file_galleries eq 'y' or ($file.lockedby and $file.lockedby eq $user) or (!$file.lockedby and (($user and $user eq $file.user) or $file.perms.tiki_p_edit_gallery_file eq 'y'))} {if $file.archiveId == 0} {if $prefs.feature_file_galleries_save_draft eq 'y' and $file.nbDraft gt 0} {self_link _icon_name='ok' _menu_text=$menu_text _menu_icon=$menu_icon validate=$file.fileId galleryId=$file.galleryId _onclick="confirmPopup('{tr}Validate draft?{/tr}', '{ticket mode=get}')"} {tr}Validate your draft{/tr} {/self_link} {self_link _icon_name='remove' _menu_text=$menu_text _menu_icon=$menu_icon draft=remove remove=$file.fileId galleryId=$file.galleryId _onclick="confirmPopup('{tr}Delete draft?{/tr}', '{ticket mode=get}')"} {tr}Delete your draft{/tr} {/self_link} {/if} {if $file.perms.tiki_p_admin_file_galleries eq 'y' or empty($file.locked) or (isset($file.locked) and $file.locked and $file.lockedby eq $user) or $gal_info.lockable ne 'y'} {icon _menu_text=$menu_text _menu_icon=$menu_icon name='upload' alt="{$replace_action_title}"} {if $prefs.fgal_display_properties eq 'y'} {icon _menu_text=$menu_text _menu_icon=$menu_icon name='edit' alt="{tr}Edit properties{/tr}"} {* using & causes an error for some reason - therefore using plain & *} {icon _menu_text=$menu_text _menu_icon=$menu_icon name='tag' alt="{tr}Refresh metadata{/tr}"} {if $view != 'page'} {icon _menu_text=$menu_text _menu_icon=$menu_icon name='textfile' alt="{tr}Page view{/tr}"} {/if} {/if} {/if} {if $file.perms.tiki_p_assign_perm_file_gallery eq 'y'}
{permission_link mode=text type="file" permType="file galleries" id=$file.id title=$file.name parentId=$file.galleryId}
{/if} {if $gal_info.lockable eq 'y' and $file.isgal neq 1} {if $file.lockedby} {* Notify user in confirm message when file is locked by another user *} {if $user && $user !== $file.lockedby} {self_link _icon_name='unlock' _menu_text=$menu_text _menu_icon=$menu_icon lock='n' fileId=$file.fileId galleryId=$file.galleryId _onclick="confirmPopup('{tr _0=$file.lockedby|username}File previously locked by user %0, do you want to unlock it?{/tr}', '{ticket mode=get}')"} {tr}Unlock{/tr} {/self_link} {else}
{ticket}
{/if} {else} {if (isset($file.p_download_files) and $file.p_download_files eq 'y') or (!isset($file.p_download_files) and $file.perms.tiki_p_download_files eq 'y')} {if $prefs.javascript_enabled eq 'y'} {* with javascript, the main page will be reloaded to lock the file and change its lockedby information *} {self_link _icon_name='download' _menu_text=$menu_text _menu_icon=$menu_icon lock='y' fileId=$file.fileId galleryId=$file.galleryId _onclick="confirmPopup('{tr}Download and lock file?{/tr}', '{ticket mode=get}');" _script=$file.fileId|sefurl:file:with_next} {tr}Download and lock{/tr} {/self_link} {else} {* without javascript, the lockedby information won't be refreshed until the user do it itself *} {icon _menu_text=$menu_text _menu_icon=$menu_icon name='download' alt="{tr}Download and lock{/tr}"} {/if} {/if}
{ticket}
{/if} {/if} {/if} {/if} {if $prefs.feature_webdav eq 'y'} {assign var=virtual_path value=$file.fileId|virtual_path} {if $prefs.feature_file_galleries_save_draft eq 'y'} {self_link _icon_name="file-archive-open" _menu_text=$menu_text _menu_icon=$menu_icon _script="javascript:open_webdav('$virtual_path')" _noauto="y" _ajax="n"} {tr}Open your draft in WebDAV{/tr} {/self_link} {else} {self_link _icon_name="file-archive-open" _menu_text=$menu_text _menu_icon=$menu_icon _script="javascript:open_webdav('$virtual_path')" _noauto="y" _ajax="n"} {tr}Open in WebDAV{/tr} {/self_link} {/if} {/if} {if $prefs.feature_share eq 'y' and $tiki_p_share eq 'y'} {icon _menu_text=$menu_text _menu_icon=$menu_icon name='share' alt="{tr}Share a link to this file{/tr}"} {/if} {if $file.perms.tiki_p_admin_file_galleries eq 'y' or (!$file.lockedby and (($user and $user eq $file.user) or ($file.perms.tiki_p_edit_gallery_file eq 'y' and $file.perms.tiki_p_remove_files eq 'y')))} {icon _menu_text=$menu_text _menu_icon=$menu_icon name='remove' alt="{tr}Delete{/tr}"} {/if} {/if} {/strip}