summaryrefslogtreecommitdiff
path: root/templates/mime/default/upload.tpl
blob: be8eb9bd36f33a3d4eda4cabd07028cb3c2bdcfa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
{strip}
{if $gBitUser->hasPermission('p_liberty_attach_attachments') }
	<div class="row">
		{formlabel label="Upload File(s)"}
		{forminput}
			{if $gBitSystem->getConfig("liberty_attachment_style") == "multiple"}
				<div id="upload_div"></div>
				<input type="file" name="upload" size="40" id="uploads" />
				<script type="text/javascript">
					var upload_files   = document.getElementById( 'upload_div' );
					var upload_element = document.getElementById( 'uploads' );
					var multi_selector = new MultiSelector( upload_files, {$gBitSystem->getConfig('liberty_max_multiple_attachments',10)});
					multi_selector.addNamedElement( upload_element , 'uploads');
				</script>
				{formhelp note='After selecting the file you want to upload, please return to the edit area and click the save button.'}
			{elseif $gBitSystem->getConfig("liberty_attachment_style") == "ajax"}
			<input type="file" name="upload" size="40" id="upload_{$form_id}" onchange="javascript:LibertyAttachment.uploader(this, '{$smarty.const.LIBERTY_PKG_URL}attachment_uploader.php','{tr}Please wait for the current upload to finish.{/tr}', 'liberty_upload_frame_{$form_id}', '{$formid|default:editpageform}');" />
				{include file="bitpackage:liberty/attachment_uploader_inc.tpl"}
				{formhelp note='After selecting the file you want to upload, please return to the edit area and click the save button.'}
				<script type="text/javascript">
					LibertyAttachment.uploaderSetup( 'upload_{$form_id}' );
				</script>
			{else}
				<input type="file" name="upload" size="40" />
				{formhelp note='After selecting the file you want to upload, please return to the edit area and click the save button.'}
			{/if}
		{/forminput}
	</div>
{/if}
{/strip}