blob: f8cb488748d46bd2b387c40053c1c9cfb530e962 (
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
{strip}
{* don't replicate the surrounding div when inserting ajax content *}
{if !$gBitThemes->isAjaxRequest()}
<div id="edit_storage_list{if !$uploadTab}_tab{/if}{if $form_id}_{$form_id}{/if}">
{/if}
{if $gContent->mStorage}
<div class="form-group">
<table class="table data" summary="List of attached files">
<tr>
<th scope="col" class="width29p" title="{tr}Thumbnail{/tr}">{tr}Thumbnail{/tr}</th>
<th scope="col" class="width40p" title="{tr}Inclusion Code{/tr}">{tr}Inclusion Code{/tr}</th>
<th scope="col" class="width30p" title="{tr}Actions{/tr}">{tr}Actions{/tr}</th>
</tr>
{foreach from=$gContent->mStorage item=storage key=attachmentId name=atts}
<tr class="{cycle values="odd,even"}">
<td class="aligncenter">
{if $storage.is_mime}
{include file=$gLibertySystem->getMimeTemplate('storage',$storage.attachment_plugin_guid) thumbsize=small preferences=$gContent->mStoragePrefs.$attachmentId attachment=$storage}
{else}
{jspopup href=$storage.source_url title=$storage.title|default:$storage.filename notra=1 img=$storage.thumbnail_url.avatar}
<br />{$storage.filename} <span class="date">{$storage.file_size|display_bytes}</span>
{if $smarty.foreach.atts.first}
{formhelp note="click to see large preview"}
{/if}
{/if}
</td>
<td>
<div>{tr}Attachment ID{/tr}: <strong>{$storage.attachment_id}</strong></div>
{if $gBitThemes->isJavascriptEnabled()}
<div><a href="javascript:void(0);" onclick="BitBase.toggleElementDisplay('wiki_attachment_code_{$storage.attachment_id}','table-row');">Wiki Code</a></div>
<div><a href="javascript:void(0);" onclick="BitBase.toggleElementDisplay('html_attachment_code_{$storage.attachment_id}','table-row');">HTML Code</a></div>
{else}
{$storage.wiki_plugin_link}
{if $smarty.foreach.atts.first}
{formhelp note="copy this code into your edit window to embed the file into your text"}
{/if}
{/if}
</td>
<td class="actionicon">
{if $uploadTab}
{* these radio buttons can not be displayed twice in the same form due to interference in $_REQUEST *}
<label>{tr}{$primary_label|default:"Primary"}{/tr}: <input type="radio" name="liberty_attachments[primary]" value="{$attachmentId}"{if $storage.is_primary eq 'y'} checked="checked"{/if} /></label>
<br />
{/if}
{if $gBitUser->isAdmin() || ($storage.user_id == $gBitUser->mUserId) }
{capture name=urlArgs}{$attachmentBaseArgs}content_id={$gContent->mContentId}{if empty($gContent->mContentId)}{foreach from=$gContent->mStorage key=key item=val}&STORAGE[existing][{$val.attachment_id}]={$val.attachment_id}{/foreach}{/if}{/capture}
{if $libertyUploader || $gBitSystem->getConfig('liberty_attachment_style') == 'ajax'}
<a href="javascript:void(0);" onclick="
BitAjax.updater('edit_storage_list_tab_{$form_id}', '{$smarty.const.LIBERTY_PKG_URL}ajax_edit_storage.php', '{$smarty.capture.urlArgs}&deleteAttachment={$attachmentId}&form_id={$form_id}');
BitAjax.updater('edit_storage_list_{$form_id}', '{$smarty.const.LIBERTY_PKG_URL}ajax_edit_storage.php', '{$smarty.capture.urlArgs}&form_id={$form_id}');">
{booticon iname="icon-trash" ipackage="icons" iexplain="delete"}
</a>
{else}
{if $storage.is_mime}
<a href="{$storage.display_url}">{booticon iname="icon-folder-open" ipackage="icons" iexplain="View"}</a>
{/if}
<a href="{$smarty.server.SCRIPT_NAME}?{$smarty.capture.urlArgs}&deleteAttachment={$attachmentId}">{booticon iname="icon-trash" ipackage="icons" iexplain="Delete"}</a>
{/if}
{/if}
</td>
</tr>
{if $gBitThemes->isJavascriptEnabled()}
{capture name=inputhelp}
<tr>
<td colspan="2">
{formhelp note="copy this code into your edit window to embed the file into your text"}
</td>
</tr>
{/capture}
<tr id="wiki_attachment_code_{$storage.attachment_id}" style="display:none;">
<td colspan=4>
<table>
{$smarty.capture.inputhelp}
<tr>
<td class="width15p">{tr}Wiki code{/tr}</td>
<td class="width85p"><input name="attachment_source_wiki_{$storage.attachment_id}" value="{$storage.wiki_plugin_link}" readonly="readonly" class="width100p"/></td>
</tr>
</table>
</td>
</tr>
<tr id="html_attachment_code_{$storage.attachment_id}" style="display:none;">
<td colspan=4>
<table>
{$smarty.capture.inputhelp}
<tr>
<th class="width15p">{tr}Size{/tr}</th>
<th class="width85p">{tr}Code{/tr}</th>
</tr>
{if $storage.attachment_plugin_guid eq 'mimeimage'}
{foreach name=size key=size from=$storage.thumbnail_url item=url}
<tr>
<td>{$size}</td>
<td><input name="attachment_source_{$size}_{$storage.attachment_id}" value='<img src="{$url|escape}" />' readonly="readonly" class="width100p"/></td>
</tr>
{/foreach}
{if ( $storage.source_url ) }
<tr>
<td>original</td>
<td><input name="attachment_source_original_{$storage.attachment_id}" value='<img src="{$storage.source_url|escape}" />' readonly="readonly" class="width100p"/></td>
</tr>
{/if}
{else}
<tr>
<td class="width15p">icon</td>
<td class="width85p"><input name="attachment_source_icon_{$storage.attachment_id}" value='<a href="{$storage.download_url}" ><img src="{$storage.thumbnail_url.icon}" /></a><br />{$storage.filename}' readonly="readonly" class="width100p"/></td>
</tr>
{/if}
</table>
</td>
</tr>
{/if}
{/foreach}
{if $uploadTab}
<tr>
<td colspan="2"> </td>
<td class="actionicon">
<label>
{tr}No {$primary_label|default:"Primary"}{/tr}:
<input type="radio" name="liberty_attachments[primary]" value="none" {if !$gContent->getField('primary_attachment_id')}checked="checked"{/if} />
</label>
</td>
</tr>
{/if}
</table>
</div>
{/if}
{if !$gBitThemes->isAjaxRequest()}
</div>
{/if}
{/strip}
|