{* $Id$ *} {title help="File Galleries" admpage="fgal"} {if $edit_mode eq 'y' and $galleryId eq 0} {tr}Create a File Gallery{/tr} {else} {if $edit_mode eq 'y'} {tr}Edit Gallery:{/tr} {/if} {tr}{$name}{/tr} {/if} {/title}
{if ! $js}{/if}
{if $galleryId gt 0} {* main navigation buttons under the page title *} {* {if $treeRootId eq $prefs.fgal_root_id && ( $tiki_p_list_file_galleries eq 'y' or (!isset($tiki_p_list_file_galleries) and $tiki_p_view_file_gallery eq 'y') )} {button _icon_name="list" _text="{tr}List{/tr}" href="?"} {/if} *} {if $tiki_p_create_file_galleries eq 'y' and $edit_mode ne 'y'} {button _keepall='y' _icon_name="create" _type="link" _text="{tr}Create{/tr}" edit_mode=1 parentId=$galleryId cookietab=1} {/if} {if $tiki_p_admin_file_galleries eq 'y' or (not empty($user) and $user eq $gal_info.user and $gal_info.type eq 'user' and $tiki_p_userfiles eq 'y')} {if $edit_mode eq 'y' or $dup_mode eq 'y'} {button _keepall='y' _icon_name="view" _text="{tr}Browse{/tr}" galleryId=$galleryId} {/if} {/if} {if $tiki_p_admin_file_galleries eq 'y' or $user eq $gal_info.user or $gal_info.public eq 'y'} {if $tiki_p_upload_files eq 'y'} {button _keepall='y' _icon_name="upload" _type="link" _text="{tr}Upload{/tr}" href="tiki-upload_file.php" galleryId=$galleryId} {/if} {if $tiki_p_upload_files eq 'y' and $prefs.feature_draw eq 'y'} {button _keepall='y' _icon_name="post" _type="link" _text="{tr}Draw{/tr}" href="tiki-edit_draw.php" galleryId=$galleryId} {/if} {if $tiki_p_upload_files eq 'y' and $prefs.wikiplugin_diagram eq 'y'} {button _keepall='y' _icon_name="chart" _type="link" _text="{tr}Create Diagram{/tr}" href="tiki-editdiagram.php" galleryId=$galleryId newDiagram='1'} {/if} {if $prefs.feature_file_galleries_batch eq "y" and $tiki_p_batch_upload_file_dir eq 'y'} {button _keepall='y' _icon_name="file-archive" _type="link" _text="{tr}Batch{/tr}" href="tiki-batch_upload_files.php" galleryId=$galleryId} {/if} {/if} {else} {if $treeRootId eq $prefs.fgal_root_id && ( $edit_mode eq 'y' or $dup_mode eq 'y')} {button _icon_name="list" _text="{tr}List{/tr}" href='?' _class="btn-info"} {/if} {if $tiki_p_create_file_galleries eq 'y' and $edit_mode ne 'y'} {button _icon_name="create" _keepall='y' _text="{tr}Create{/tr}" edit_mode="1" parentId="-1" galleryId="0"} {/if} {if $tiki_p_upload_files eq 'y'} {button _icon_name="export" _text="{tr}Upload{/tr}" href="tiki-upload_file.php"} {/if} {/if} {if $edit_mode neq 'y' and $prefs.fgal_show_slideshow eq 'y' and $gal_info.show_slideshow eq 'y'} {button _icon_name="chart" _text="{tr}SlideShow{/tr}" href="#" _onclick="javascript:window.open('tiki-list_file_gallery.php?galleryId=$galleryId&slideshow','','menubar=no,width=600,height=500,resizable=yes');return false;"} {/if} {if $edit_mode neq 'y' and $prefs.h5p_enabled eq 'y' and $tiki_p_upload_files eq 'y' and $tiki_p_h5p_edit eq 'y'} {icon name='plus'} {tr}Create H5P{/tr} {jq}$(".create-h5p").clickModal({title: "{tr}Create H5P{/tr}", size: "modal-lg"});{/jq} {/if}
{if $edit_mode neq 'y' and $gal_info.description neq ''}
{$gal_info.description|escape|nl2br}
{/if} {if !empty($filegals_manager)} {remarksbox type="tip" title="{tr}Tip{/tr}"}{tr}Be careful to set the right permissions on the files you link to{/tr}.{/remarksbox}
{/if} {if isset($fileChangedMessage) and $fileChangedMessage neq ''} {remarksbox type="note" title="{tr}Note{/tr}"} {$fileChangedMessage}
{ticket}
{/remarksbox} {/if} {if $user and $prefs.feature_user_watches eq 'y' and isset($category_watched) && $category_watched eq 'y'}
{tr}Watched by categories:{/tr} {section name=i loop=$watching_categories} {button _keepall='y' _text=$watching_categories[i].name|escape href="tiki-browse_categories.php" parentId=$watching_categories[i].categId} {/section}
{/if} {if !empty($fgal_diff)} {remarksbox type="note" title="{tr}Modifications{/tr}"} {foreach from=$fgal_diff item=fgp_prop key=fgp_name name=change} {tr}Property {$fgp_name} Changed{/tr} {/foreach} {/remarksbox} {/if} {if $edit_mode eq 'y'}
{include file='edit_file_gallery.tpl'} {elseif $dup_mode eq 'y'} {include file='duplicate_file_gallery.tpl'} {else} {if $view neq 'page'} {if $prefs.fgal_elfinder_feature neq 'y' or $view neq 'finder'}
{if $prefs.fgal_search eq 'y'}
{include file='find.tpl' find_show_num_rows = 'y' find_show_categories_multi='y' find_durations=$find_durations find_show_sub='y' find_in="
  • {tr}Name{/tr}
  • {tr}Filename{/tr}
  • {tr}Description{/tr}
"}
{/if} {if ($prefs.fgal_search_in_content eq 'y' or $prefs.fgal_search eq 'y') and $galleryId > 0}
{if $prefs.fgal_search_in_content eq 'y'}
{/if} {if $prefs.fgal_search eq 'y'}
{/if}
{/if}
{/if} {else}
{ticket}

{pagination_links cant=$cant step=$maxRecords offset=$offset} tiki-list_file_gallery.php?galleryId={$galleryId}&maxWidth={$maxWidth}&maxRecords={$maxRecords}&view={$view} {/pagination_links}
{/if} {if $prefs.fgal_quota_show neq 'n' and $gal_info.quota}
{if $gal_info.usedSize neq null} {capture name='use'} {math equation="round((100*x)/(1024*1024*y),0)" x=$gal_info.usedSize y=$gal_info.quota} {/capture} {capture name='left_percent'} {math equation="round(100-(100*x)/(1024*1024*y),0)" x=$gal_info.usedSize y=$gal_info.quota} {/capture} {capture name='left'} {math equation="round(y - x/(1024*1024),0)" y=$gal_info.quota x=$gal_info.usedSize} {/capture} {/if} {if $prefs.fgal_quota_show neq 'text_only'}{if $gal_info.usedSize neq null}
{/if} {if $gal_info.usedSize eq null}
{/if} {/if} {if $prefs.fgal_quota_show neq 'y'} {if $gal_info.usedSize eq null}
{$gal_info.quota} MB left
{else}
{$smarty.capture.left} MB left
{/if} {/if}
{/if} {if $prefs.fgal_elfinder_feature eq 'y' and $view eq 'finder'}
{jq} var elfoptions = initElFinder({ defaultGalleryId: {{$galleryId}}, defaultVolumeId: {{$volumeId}}, deepGallerySearch:1, requestType: 'post', getFileCallback: function(file,elfinder) { window.handleFinderFile(file,elfinder); }, height: 600 }); var elFinderInstnce = $(".elFinderDialog").elfinder(elfoptions).elfinder('instance'); elFinderInstnce.customData['ticket'] = $(".elFinderDialog").data('ticket'); // when changing folders update the buttons in the navebar above elFinderInstnce.bind("open", function (data) { $.getJSON($.service('file_finder', 'finder'), { cmd: "tikiFileFromHash", hash: data.data.cwd.hash }).done(function (data) { var href = ''; $(".t_navbar a").each(function () { href = $(this).attr("href"); if (href) { // avoid chosen select replacements href = href.replace(/(galleryId|objectId|parentId|watch_object)=\d+/, '$1=' + data.galleryId); $(this).attr("href", href); } }); }); }); window.handleFinderFile = function (file, elfinder) { var hash = ""; if (typeof file === "string") { var m = file.match(/target=([^&]*)/); if (!m || m.length < 2) { return false; // error? } hash = m[1]; } else { hash = file.hash; } $.ajax({ type: 'POST', url: $.service('file_finder', 'finder'), dataType: 'json', data: { cmd: "tikiFileFromHash", {{if !empty($filegals_manager)}} filegals_manager: "{{$filegals_manager}}", {{/if}} {{if !empty($insertion_syntax)}} insertion_syntax: "{{$insertion_syntax}}", {{/if}} hash: hash }, success: function (data) { {{if !empty($filegals_manager)}} window.opener.insertAt('{{$filegals_manager}}', processFgalSyntax(data), false, false, true); checkClose(); {{/if}} } }); }; {/jq} {else} {include file='list_file_gallery.tpl'} {/if} {if $galleryId gt 0 && $prefs.feature_file_galleries_comments == 'y' && ($tiki_p_read_comments == 'y' || $tiki_p_post_comments == 'y' || $tiki_p_edit_comments == 'y')}
{icon name="comments"} {tr}Comments{/tr} {jq} $('#comment-toggle').comment_toggle(); {/jq}
{/if} {/if} {if $galleryId>0} {if $edited eq 'y'} {remarksbox type="tip" title="{tr}Information{/tr}"} {tr}You can access the file gallery using the following URL:{/tr} {$url}?galleryId={$galleryId} {/remarksbox} {/if} {/if}