-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathattachments.tpl
101 lines (95 loc) · 4.81 KB
/
attachments.tpl
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
{* $Id: attachments.tpl 45011 2013-03-01 06:20:00Z chibaguy $ *}
<a name="attachments"></a>
{if $tiki_p_wiki_view_attachments == 'y' || $tiki_p_wiki_admin_attachments == 'y' || $tiki_p_wiki_attach_files == 'y'}
<div
{if isset($pagemd5) && $pagemd5}
{assign var=cookie_key value="show_attzone$pagemd5"}
id="attzone{$pagemd5}"
{else}
{assign var=cookie_key value="show_attzone"}
id="attzone"
{/if}
{if (isset($smarty.session.tiki_cookie_jar.$cookie_key) and $smarty.session.tiki_cookie_jar.$cookie_key eq 'y')
or (!isset($smarty.session.tiki_cookie_jar.$cookie_key) and $prefs.w_displayed_default eq 'y')}
style="display:block;"
{else}
style="display:none;"
{/if}
>
{* Generate table if view permissions granted and if count of attached files > 0 *}
{if ($tiki_p_wiki_view_attachments == 'y' || $tiki_p_wiki_admin_attachments == 'y') && count($atts) > 0}
{if isset($offset)}
{$offsetparam = "offset={$offset}&"}
{else}
{$offsetparam = ''}
{/if}
<table class="normal">
<caption> {tr}List of attached files{/tr} </caption>
<tr>
<th>
<a href="tiki-index.php?page={$page|escape:"url"}&{$offsetparam}sort_mode={if $sort_mode eq 'attId_desc'}attId_asc{else}attId_desc{/if}&atts_show=y#attachments">{tr}ID{/tr}</a>
</th>
<th>
<a href="tiki-index.php?page={$page|escape:"url"}&{$offsetparam}sort_mode={if $sort_mode eq 'filename_desc'}filename_asc{else}filename_desc{/if}&atts_show=y#attachments">{tr}Name{/tr}</a>
</th>
<th>
<a href="tiki-index.php?page={$page|escape:"url"}&{$offsetparam}sort_mode={if $sort_mode eq 'comment_desc'}comment_asc{else}comment_desc{/if}&atts_show=y#attachments">{tr}desc{/tr}</a>
</th>
<th>
<a href="tiki-index.php?page={$page|escape:"url"}&{$offsetparam}sort_mode={if $sort_mode eq 'created_desc'}created_asc{else}created_desc{/if}&atts_show=y#attachments">{tr}uploaded{/tr}</a>
</th>
<th>
<a href="tiki-index.php?page={$page|escape:"url"}&{$offsetparam}sort_mode={if $sort_mode eq 'size_desc'}size_asc{else}size_desc{/if}&atts_show=y#attachments">{tr}Size{/tr}</a>
</th>
<th>
<a href="tiki-index.php?page={$page|escape:"url"}&{$offsetparam}sort_mode={if $sort_mode eq 'hits_desc'}hits_asc{else}hits_desc{/if}&atts_show=y#attachments">{tr}Downloads{/tr}</a>
</th>
<th>{tr}Actions{/tr}</th>
</tr>
{cycle values="odd,even" print=false advance=false}
{section name=ix loop=$atts}
<tr class="{cycle}">
<td class="id">{$atts[ix].attId}</td>
<td class="text">
{$atts[ix].filename|iconify}
<a class="tablename" href="tiki-download_wiki_attachment.php?attId={$atts[ix].attId}&page={$page|escape:"url"}&download=y">{$atts[ix].filename}</a>
</td>
<td class="text"><small>{$atts[ix].comment|escape}</small></td>
<td class="date">
<small>{$atts[ix].created|tiki_short_datetime}{if $atts[ix].user} {tr}by{/tr} {$atts[ix].user|userlink}{/if}</small>
</td>
<td class="integer">{$atts[ix].filesize|kbsize}</td>
<td class="integer">{$atts[ix].hits}</td>
<td class="action">
<a title="{tr}View{/tr}" href="tiki-download_wiki_attachment.php?attId={$atts[ix].attId}" target="_blank">{icon _id='monitor' alt="{tr}View{/tr}"}</a>
<a title="{tr}Download{/tr}" href="tiki-download_wiki_attachment.php?attId={$atts[ix].attId}&download=y">{icon _id='disk' alt="{tr}Download{/tr}"}</a>
{if ($tiki_p_wiki_admin_attachments eq 'y' or ($user and ($atts[ix].user eq $user))) and $editable}
<a title="{tr}Delete{/tr}" class="link" href="tiki-index.php?page={$page|escape:"url"}&removeattach={$atts[ix].attId}&{$offsetparam}{if !empty($sort_mode)}sort_mode={$sort_mode}{/if}"{if !empty($target)} target="{$target}"{/if}>{icon _id='cross' alt="{tr}Remove{/tr}"}</a>
{/if}
</td>
</tr>
{/section}
</table>
{/if}{* Generate table if view ... attached files > 0 *}
{* It is allow to attach files or current user have admin rights *}
{if ($tiki_p_wiki_attach_files eq 'y' or $tiki_p_wiki_admin_attachments eq 'y')
and (!isset($attach_box) or $attach_box ne 'n') and $editable}
<form enctype="multipart/form-data" action="tiki-index.php?page={$page|escape:"url"}" method="post">
{if $page_ref_id}
<input type="hidden" name="page_ref_id" value="{$page_ref_id}">
{/if}
<table class="formcolor">
<tr>
<td>
<label for="attach-upload">{tr}Upload file:{/tr}</label><input type="hidden" name="MAX_FILE_SIZE" value="1000000000">
<input size="16" name="userfile1" type="file" id="attach-upload">
<label for="attach-comment">{tr}Comment:{/tr}</label><input type="text" name="attach_comment" maxlength="250" id="attach-comment">
<input type="submit" name="attach" value="{tr}Attach{/tr}">
</td>
</tr>
</table>
</form>
{/if}
</div>
{/if}