{* $Id$ *} {if !empty($filegals_manager) and !isset($smarty.request.simpleMode)} {assign var=simpleMode value='y'} {else} {assign var=simpleMode value='n'} {/if} {title help="File Galleries" admpage="fgal"}{if $editFileId}{tr}Edit File:{/tr} {$fileInfo.filename}{else}{tr}Upload File{/tr}{/if}{/title} {if !empty($galleryId) or (isset($galleries) and count($galleries) > 0 and $tiki_p_list_file_galleries eq 'y') or (isset($uploads) and count($uploads) > 0)}
{if !empty($galleryId)} {button galleryId="$galleryId" href="tiki-list_file_gallery.php" class="btn btn-primary" _text="{tr}Browse Gallery{/tr}"} {/if} {if isset($galleries) and count($galleries) > 0 and $tiki_p_list_file_galleries eq 'y'} {if !empty($filegals_manager)} {assign var=fgmanager value=$filegals_manager|escape} {button href="tiki-list_file_gallery.php?filegals_manager=$fgmanager" class="btn btn-info" _text="{tr}List Galleries{/tr}"} {else} {button href="tiki-list_file_gallery.php" class="btn btn-info" _text="{tr}List Galleries{/tr}"} {/if} {/if} {if isset($uploads) and count($uploads) > 0} {button href="#upload" class="btn btn-primary" _text="{tr}Upload File{/tr}"} {/if} {if !empty($filegals_manager)} {if $simpleMode eq 'y'}{button simpleMode='n' galleryId=$galleryId href="" class="btn btn-primary" _text="{tr}Advanced mode{/tr}" _ajax="n"}{else}{button galleryId=$galleryId href="" _text="{tr}Simple mode{/tr}" _ajax="n"}{/if}
{/if}
{/if} {if isset($errors) and count($errors) > 0}

{tr}Errors detected{/tr}

{section name=ix loop=$errors} {$errors[ix]}
{/section} {button href="#upload" _text="{tr}Retry{/tr}"}
{/if} {if $prefs.javascript_enabled eq 'y'}
{/if} {if isset($uploads) and count($uploads) > 0} {section name=ix loop=$uploads} {/section}
{if !empty($filegals_manager) && $prefs.javascript_enabled === 'y'} {$uploads[ix].name} ({$uploads[ix].size|kbsize}) {else} {$uploads[ix].name} ({$uploads[ix].size|kbsize}) {/if} {if $prefs.javascript_enabled === 'y'} {button href="#" _flip_id="uploadinfos"|cat:$uploads[ix].fileId _text="{tr}Additional Info{/tr}"} {/if}
{tr}Syntax Tips{/tr}
{tr}Download link using Tiki syntax:{/tr}
[{$uploads[ix].fileId|sefurl:file}|{$uploads[ix].name}]
{tr}Display an image using Tiki syntax:{/tr}
{img src="{$uploads[ix].fileId|sefurl:preview}" link="{$uploads[ix].fileId|sefurl:file}" alt="{$uploads[ix].name}"}
{if $prefs.feature_shadowbox eq 'y'}
{tr}Use as a thumbnail with ShadowBox:{/tr}
{img src="{$uploads[ix].fileId|sefurl:thumbnail}" link="{$uploads[ix].fileId|sefurl:preview}" rel="shadowbox[gallery];type=img" alt="{$name}"}
{/if}
{tr}Download link using HTML:{/tr}
<a href="{$uploads[ix].dllink}">{$uploads[ix].name}</a>

{tr}Upload File{/tr}

{elseif isset($fileChangedMessage)}
{$fileChangedMessage}
{/if} {if $editFileId and isset($fileInfo.lockedby) and $fileInfo.lockedby neq ''} {remarksbox type="note" title="{tr}Info{/tr}" icon="lock"} {if $user eq $fileInfo.lockedby} {tr}You locked the file{/tr} {else} {tr _0=$fileInfo.lockedby}The file has been locked by %0{/tr} {/if} {/remarksbox} {/if}
{capture name=upload_file assign=upload_str}
{if $prefs.javascript_enabled !== 'y' || $prefs.file_galleries_use_jquery_upload neq 'y' or $editFileId} {if $simpleMode neq 'y'}
{if isset($gal_info.type) and ($gal_info.type eq "podcast" or $gal_info.type eq "vidcast")} ({tr}required field for podcasts{/tr}) {/if}
{if isset($gal_info.type) and ($gal_info.type eq "podcast" or $gal_info.type eq "vidcast")}
{tr}Required for podcasts{/tr}. {/if}
{/if} {if $prefs.javascript_enabled !== 'y' || $prefs.file_galleries_use_jquery_upload neq 'y' || $editFileId}
{if $editFileId} {$fileInfo.filename|escape} {/if}
{/if} {else}{* file_galleries_use_jquery_upload = y *} {filegal_uploader} {/if}
{if $simpleMode neq 'y'}
{if !$editFileId and $tiki_p_batch_upload_files eq 'y'}
{/if} {if $prefs.fgal_delete_after eq 'y'}
{if $editFileId} {html_select_duration prefix='deleteAfter' id="deleteAfter" default_value=$fileInfo.deleteAfter} {else} {html_select_duration prefix='deleteAfter[]' id="deleteAfter" default_unit=week} {/if}
{/if} {if $editFileId} {else} {if count($galleries) eq 0} {if !empty($galleryId)} {else} {/if} {elseif empty($groupforalert)}
{else} {/if} {/if}
{user_selector id='user' name='user[]' select=$fileInfo.user editable=$tiki_p_admin_file_galleries}
{if $prefs.feature_file_galleries_author eq 'y'}

{tr}Creator of file, if different from the 'Uploaded by' user{/tr}
{/if} {if !empty($groupforalert)} {if $showeachuser eq 'y'}
{section name=idx loop=$listusertoalert} {/section}
{else} {section name=idx loop=$listusertoalert} {/section} {/if} {/if} {if $editFileId}
{/if} {if $prefs.ocr_enable eq 'y'} {if isset($selectedLanguages) || isset($languages)}
{/if} {if $editFileId || $prefs.ocr_every_file !== 'y' && !$editFileId}
{/if} {/if}
{if $prefs.fgal_limit_hits_per_file eq 'y'}

{tr}Use{/tr} {tr}-1 for no limit{/tr}.
{else} {/if} {* We want comments only on updated files *} {if $prefs.javascript_enabled neq 'y' && $editFileId}
{/if}
{if $prefs.javascript_enabled eq 'y' and !$editFileId} {include file='categorize.tpl'}
{/if} {else} {if $prefs.javascript_enabled eq 'y' and !$editFileId and $category_jail} {include file='categorize.tpl'}
{/if} {/if} {if $prefs.javascript_enabled eq 'y' and !$editFileId} {/if}
{/capture}
{ticket} {if !empty($filegals_manager)} {/if} {if !empty($insertion_syntax)} {/if} {if isset($token_id) and $token_id neq ''} {/if} {$upload_str} {if $editFileId} {include file='categorize.tpl'}
{elseif $prefs.javascript_enabled neq 'y'} {$upload_str} {$upload_str} {include file='categorize.tpl'}
{/if} {if !$editFileId && $prefs.file_galleries_use_jquery_upload neq 'y' && $prefs.javascript_enabled === 'y'}
{/if}
{if !empty($fileInfo.lockedby) and $user ne $fileInfo.lockedby} {icon name="lock"} {tr}The file has been locked by {$fileInfo.lockedby}{/tr} {/if}
{if !$editFileId}
{remarksbox type="note" title="{tr}Information{/tr}"} {tr}Maximum file size is around:{/tr} {if $tiki_p_admin eq 'y'}{/if} {$max_upload_size|kbsize:true:0} {if $tiki_p_admin eq 'y'} {if $is_iis}
{tr}Note: You are running IIS{/tr}. {tr}maxAllowedContentLength also limits upload size{/tr}. {tr}Please check web.config in the Tiki root folder{/tr}{/if} {/if} {/remarksbox}
{/if}
{if not empty($metarray) and $metarray|count gt 0} {include file='metadata/meta_view_tabs.tpl'} {/if} {if ! $editFileId and $prefs.file_galleries_use_jquery_upload neq 'y'} {if $prefs.feature_jquery_ui eq 'y'} {jq}$('.datePicker').datepicker({minDate: 0, maxDate: '+1m', dateFormat: 'dd/mm/yy'});{/jq} {/if} {jq notonready=true} $('#file_0').ajaxForm({target: '#progress_0', forceSync: true}); var nb_upload = 1; function add_upload_file() { var clone = $('#form form').eq(0).clone().resetForm().attr('id', 'file_' + nb_upload).ajaxForm({target: '#progress_' + nb_upload, forceSync: true}); $(clone[0].submission).val(parseInt($(clone[0].submission).val(), 10) + parseInt(nb_upload, 10)); clone.insertAfter($('#form form').eq(-1)); document.getElementById('progress').innerHTML += "
"; nb_upload += 1; } function upload_files(){ var totalSubmissions = $("#form form").length; $("#form form").append($('', {type: 'hidden', name: 'totalSubmissions', value: totalSubmissions})); $("#form form").each(function(n) { if ($(this).find('input[name="userfile\\[\\]"]').val() != '') { var $progress = $('#progress_'+n).html("{tr}Uploading file...{/tr}"); $( document ).ajaxError(function(event, jqxhr, ajaxSettings, thrownError ) { $progress.hide(); show('form'); $("#form").showError(tr("File upload error:") + " " + thrownError) }); $(this).submit(); this.reset(); } else { $('#progress_'+n).html("{tr}No File to Upload...{/tr} {tr}Retry{/tr}"); } }); hide('form'); } {/jq} {/if} {if not $editFileId and $prefs.fgal_upload_from_source eq 'y' and $tiki_p_upload_files eq 'y'}

{tr}Upload from URL{/tr}

{if $prefs.vimeo_upload eq 'y'} {/if}
{jq} $('.remote-upload').submit(function () { var form = this; // use the current value of the galleryId selector $('input[name=galleryId]', form).val($('#galleryId').val()); $.ajax({ method: 'POST', url: $(form).attr('action'), data: $(form).serialize(), dataType: 'html', success: function (data) { $('.result', form).html(data); $(form.url).val(''); }, complete: function () { $('input', form).prop('disabled', false); }, error: function (e) { alert(tr("A remote file upload error occurred:") + "\n\"" + e.statusText + "\" (" + e.status + ")"); } }); $('input', this).prop('disabled', true); return false; }); {/jq} {if $prefs.vimeo_upload eq 'y'}

{tr}Upload Video{/tr}

{wikiplugin _name='vimeo'}{/wikiplugin}
{jq} var handleVimeoFile = function (link, data) { if (data != undefined) { $("#form").hide(); $("#progress").append( $("

{tr}Video file uploaded:{/tr} " + data.file + "

") .prepend($("")) ); } } {/jq} {/if} {/if} {jq} var defaultx= $("#image_max_size_x").attr('value'); var defaulty= $("#image_max_size_y").attr('value'); $("#imagesize").click(function () { if ($(this).prop("checked")) { $("#customsize").css("display", "none"); //resetting size to default $("#image_max_size_x").attr('value',defaultx); $("#image_max_size_y").attr('value',defaulty); } else { $("#customsize").css("display", ""); } }); $("#galleryId").change(function(){ $("#image_max_size_x").attr('value',''); $("#image_max_size_y").attr('value',""); $("#imageResizeInfo").html(''); defaultx=''; defaulty=''; }); {/jq}