summaryrefslogtreecommitdiff
path: root/templates/attachment_browser.tpl
blob: 26340fab1de7232b9f7f81d6affed318d14e627c (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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{strip}
<div class="row">
	{formlabel label="Attach Existing File(s)" for="existing_attachment_id_input"}
	{forminput}
		<input type="text" name="existing_attachment_id[]" id="existing_attachment_id_input" size="20"/>
		{formhelp note="Attaching an item to your page will insert a small icon representing the file. Please use the attachment IDs listed below.<br />You can attach multiple items at once by seperating them with a ',' (comma)."}
	{/forminput}
</div>

<div class="row">
	{formlabel label="Insert Attachment"}
	{forminput}
		<input type="text" name="dummy" id="copy" size="30" class="success" />
		<input type="button" value="{tr}Clear{/tr}" onclick="document.getElementById( 'copy' ).value = '';" />
		{formhelp note="Clicking on any of the attachments below, will display the correct attachment syntax in the textbox above. Insert this text into the textarea where needed."}
	{/forminput}
</div>

<table class="data">
	<caption>{tr}Available Attachements{/tr} <span class="total">[ {$userAttachments.cant} ]</span></caption>
	{counter start=-1 name="cells" print=false}
	{foreach from=$userAttachments.data item=attachment key=foo}
		{counter name="cells" assign="cells" print=false}
		{if $cells % 2 eq 0}
			<tr class="{cycle values="odd,even"}">
		{/if}

		<td>
			<a title="{tr}Attachment id: {$attachment.attachment_id}{/tr}" href="javascript:insertAt( 'copy', '{ldelim}attachment id={$attachment.attachment_id}{rdelim}' );">
				<img src="{$attachment.thumbnail_url.small}" alt="{$attachment.filename}" /><br />
				{$attachment.filename}<br />
				Attachment ID: {$attachment.attachment_id}
			</a>
		</td>

		{if $cells % 2 ne 0}
			</tr>
		{/if}
	{foreachelse}
		<tr class="norecords"><td>{tr}No Records Found{/tr}</td></tr>
	{/foreach}

	{if $cells % 2 eq 0}
		<td>&nbsp;</td></tr>
	{/if}
</table>

{libertypagination pgnName="pgnPage" pgnPage=$curPage numPages=$numPages offset=$smarty.request.offset ajaxId=attbrowser}
{/strip}