Escape weird characters in templates
[squasher.git] / templates / index.tpl
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
5 <link rel=stylesheet href="css/squasher.css">
6 <title>Squasher</title>
7 <script type="text/javascript" language="JavaScript">{literal}
8    function toggle_id(hideshow){
9     if(document.getElementById(hideshow).style.visibility == 'visible') {
10      document.getElementById(hideshow).style.visibility = 'hidden';
11     }else{
12      document.getElementById(hideshow).style.visibility = 'visible';
13     }
14    }
15    function selectAllList() {
16     var aSelect = document.deletetool["h[]"];
17     var aSelectLen = aSelect.length;
18     for(i = 0; i < aSelectLen; i++) {
19      aSelect.options[i].selected = true;
20     }
21    }
22 {/literal}</script>
23 </head>
24 <body>
25 <div class="wrappercontainer">
26
27         <div class="banner">&nbsp;<div class="control">{if $user_level > 99}<a href="?">home</a>&nbsp;|&nbsp;<a href="?tools=access">access</a>&nbsp;|&nbsp;<a href="?tools=users">users</a>&nbsp;|&nbsp;<a href="?tools=logs">logs</a>&nbsp;|{/if}&nbsp;<a href="index.php?tools=logout">logout({$user_name|escape})</a>&nbsp;</div></div>
28
29         <div class="menucontainer">
30
31                 <div class="menu">
32         
33                         <div class="menuhead">current folder</div>
34         
35                         {foreach item=crumb key=cookie from=$base}<a href="?path={$cookie|escape:'url'}">{$crumb|escape}</a>{/foreach}
36         
37                 </div>
38         
39                 <div class="menu">
40         
41                         <div class="menuhead">subfolders</div>
42         
43                         {foreach item=folder key=folderpath from=$subfolders}<a href="?path={$folderpath|escape:'url'}">{$folder|escape}</a>{/foreach}
44         
45                 </div>
46         
47         </div>
48         
49         <div class="content">
50 {assign var=mass_delete_size value=count($squashed)}
51 {foreach item=item key=id from=$squashed}
52 {if $item.squashed}{*These items are in chunks / uploaded by the squasher tool*}
53
54 {if $item.hidden eq false OR $user_level > 99 }
55                 <div class={if $item.finished==true}"status3"{elseif $item.finished!=true && $item.embedable==true}"status2"{elseif $item.finished!=true && $item.embedable!=true}"status1"{else}"item"{/if}>
56
57                         <div class="name">{$item.name|escape} {if $user_level > 99}{if $item.hidden}<font color=red>|<a href='?tools=unhide&amp;h={$id|escape:'url'}'>publish</a>|</font>{else}<font color=green>|<a href='?tools=hide&amp;h={$id|escape:'url'}'>hide</a>|</font>{/if}{if $user_level > 100}<font color=red>|<a href='?tools=delete&amp;h={$id|escape:'url'}' onClick="javascript:return confirm('Are you sure you want to permanently delete {$item.name|escape:'quotes'}?')">delete</a>|</font>{/if}{/if}</div>
58
59                         <div class="status">status: {$item.status|escape}</div>
60
61                         <div class="clear"></div>
62
63                         <div class="added">added: {$item.date|escape}</div>
64                 
65                         <div class="size">size:&nbsp;{if $item.size>(1024*1024)}{math equation="((x / 1024) / 1024) * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.2f"}&nbsp;/&nbsp;{math equation="(x / 1024) / 1024" x=$item.size format="%.2f"}mb{elseif $item.size>(1024)}{math equation="(x / 1024) * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.2f"}&nbsp;/&nbsp;{math equation="(x / 1024)" x=$item.size format="%.2f"}kb{else}{math equation="x * (y / z)" x=$item.size y=$item.chunks_finished z=$item.chunks format="%.0f"}&nbsp;/&nbsp;{$item.size|escape}b{/if}({math equation="(y / x) * 100" x=$item.chunks y=$item.chunks_finished format="%.0f"}%)</div>
66
67                         <div class="clear"></div>
68
69                         <div class="updated">last updated: {$item.lastchange|escape}</div>
70
71
72 {if $item.finished==true}
73                         <div class="download"><a href='?f={$id|escape:'url'}'>download</a></div>
74 {/if}
75 {if $item.embedable eq true and $item.finished eq false}
76         {if $item.mime=='video/mpeg'}
77                         <div class="stream"><a href='?f={$id|escape:'url'}'>download ({math equation="(y / x) * 100" x=$item.chunks y=$item.chunks_partial format="%.0f"}%)</a></div>
78         {/if}
79 {/if}
80
81                         <div class="clear"></div>
82                 </div>
83         
84                 <div class="clear"></div>
85 {/if}
86
87 {else}{*These items are plain files / uploaded manually by the user via ftp*}
88
89 {if $item.hidden eq false OR $user_level > 99 }
90                 <div class={if $item.finished==true}"status3"{elseif $item.finished!=true && $item.embedable==true}"status2"{elseif $item.finished!=true && $item.embedable!=true}"status1"{else}"item"{/if}>
91
92                         <div class="name">{$item.name|escape} {if $user_level > 99}{if $item.hidden}<font color=red>|<a href='?tools=unhide&amp;h={$id|escape:'url'}'>publish</a>|</font>{else}<font color=green>|<a href='?tools=hide&amp;h={$id|escape:'url'}'>hide</a>|</font>{/if}{if $user_level > 199}<font color=red>|<a href='?tools=delete&amp;h={$id|escape:'url'}' onClick="javascript:return confirm('Are you sure you want to permanently delete {$item.name|escape:'quotes'}?')">delete</a>|</font>{/if}{/if}</div>
93
94                         <div class="status">status: {$item.status|escape}</div>
95
96                         <div class="clear"></div>
97
98                         <div class="added">added: {$item.date|escape}</div>
99
100                         <div class="size">size:&nbsp;{if $item.size>(1024*1024)}{math equation="(x / 1024) / 1024" x=$item.size format="%.2f"}mb{elseif $item.size>(1024)}{math equation="(x / 1024)" x=$item.size format="%.2f"}kb{else}{$item.size|escape}b{/if}</div>
101
102                         <div class="clear"></div>
103
104                         <div class="updated">last updated: {$item.lastchange|escape}</div>
105
106
107 {if $item.finished==true}
108                         <div class="download"><a href='?f={$id|escape:'url'}'>download</a></div>
109 {/if}
110 {if $item.embedable eq true and $item.finished eq false}
111         {if $item.mime=='video/mpeg'}
112                         <div class="stream"><a href='?f={$id|escape:'url'}'>download (partial)</a></div>
113         {/if}
114 {/if}
115
116                         <div class="clear"></div>
117                 </div>
118         
119                 <div class="clear"></div>
120 {/if}
121 {/if}
122 {/foreach}
123         </div>
124
125         <div class="filler">
126 {if $user_level > 100 and $mass_delete_size > 1}
127                 <div class="massdelete"><br>
128                         <div class="deletebox" id="deletebox">
129                                 <form name="deletetool" action="?tools=delete&amp;h=multiple" method="post" onSubmit='return confirm("Are you sure you want to delete the selected files? \nThis page may take a while to reload while the files are removed.");'>
130                                         <select multiple="" size="{$mass_delete_size|escape}" id="h" name="h[]" width="300px">
131                                                 {foreach item=item key=id from=$squashed}
132                                                 <option value="{$id|escape}" title="{$item.name|escape}">{$item.name|truncate:39|escape}</option>
133                                                 {/foreach}
134                                         </select>
135                                         <input type="button" value="Select All" OnClick="selectAllList();" ><input type="reset" value="Clear"><input type="submit" value="Delete Selected Items">
136                                 </form>
137                         </div>
138                 </div>
139 {/if}
140         </div>
141
142         <div class="bottomimage"></div>
143         <div class="footer">&nbsp;</div>
144 </div>
145 {if $debug}{debug}{/if}
146 </body>
147 </html>