1 | <div id="content"> |
---|
2 | <div class="titrePage"> |
---|
3 | <h2>Evil Blog</h2> |
---|
4 | </div> |
---|
5 | <form name="post_form" action="#" method="POST"> |
---|
6 | <table style="width:95%;"> |
---|
7 | <tr><td> |
---|
8 | <b>{'post_header'|@translate}</b><br> |
---|
9 | <input type="text" name="post_header" style="width:100%;"> |
---|
10 | </td></tr> |
---|
11 | <tr><td colspan="2"><br> |
---|
12 | <b>{'post_text'|@translate}</b><br> |
---|
13 | <textarea name="post_textarea" rows="15" style="width:100%;"> |
---|
14 | {if isset($CONTENT)}{$CONTENT}{/if} |
---|
15 | </textarea> |
---|
16 | </td></tr> |
---|
17 | <tr><td> |
---|
18 | <input type="submit" name="submit_post" value="{'Submit'|@translate}"> |
---|
19 | </td></tr> |
---|
20 | </table> |
---|
21 | </form> |
---|
22 | |
---|
23 | <form name="delete_form" action="#" method="POST"> |
---|
24 | <input type='text' name='del' style='visibility: hidden; position: absolute;'> |
---|
25 | <script type="text/javascript">{literal} |
---|
26 | function subdel (val) { |
---|
27 | if (confirm('Are you sure?')) { |
---|
28 | document.delete_form.del.value=val; |
---|
29 | document.delete_form.submit(); |
---|
30 | } |
---|
31 | } |
---|
32 | {/literal} |
---|
33 | </script> |
---|
34 | </form> |
---|
35 | |
---|
36 | <script type="text/javascript">{literal} |
---|
37 | window['opened_edit_form'] = false; |
---|
38 | function close_edit_form (val) { |
---|
39 | $('input[name="edit_post_id"]').remove(); |
---|
40 | //$('#post_id_'+val).text(window.p_id); |
---|
41 | |
---|
42 | $('input[name="edit_post_header"]').remove(); |
---|
43 | $('#post_header_'+val).text(window.p_header); |
---|
44 | |
---|
45 | $('textarea[name]"edit_post_text"').remove(); |
---|
46 | $('#post_text_'+val).html(window.p_text); |
---|
47 | |
---|
48 | $('input[name="edit_submit_post"]').remove(); |
---|
49 | $('input[name="cansel_post_form"]').remove(); |
---|
50 | $('#post_'+val+' .categoryActions').show(); |
---|
51 | window.opened_edit_form = false; |
---|
52 | } |
---|
53 | |
---|
54 | function open_edit_form (val) { |
---|
55 | if (!window.opened_edit_form) { |
---|
56 | $('#post_'+val+' .categoryActions').hide(); |
---|
57 | |
---|
58 | $('#post_header_'+val).html('<input type="text" name="edit_post_header" value="'+$('#post_header_'+val).text()+'">'); |
---|
59 | window['p_header'] = document.edit_form.edit_post_header.value; |
---|
60 | |
---|
61 | $('#post_text_'+val).html('<textarea name="edit_post_text" rows="15" style="width:100%;">'+$('#post_text_'+val).html()+'</textarea>'); |
---|
62 | window['p_text'] = $('textarea[name]"edit_post_text"').text(); |
---|
63 | |
---|
64 | $('<input type="text" name="edit_post_id" value="'+$('#post_id_'+val).text()+'">').insertAfter('#post_text_'+val); |
---|
65 | $('<input type="button" name="cansel_post_form" value="Cansel" onClick="return close_edit_form('+val+')">').insertAfter('#post_text_'+val); |
---|
66 | $('<input type="submit" name="edit_submit_post" value="Submit">').insertAfter('#post_text_'+val); |
---|
67 | window.opened_edit_form = true; |
---|
68 | } else { |
---|
69 | alert('Close other form of editing!'); |
---|
70 | } |
---|
71 | } |
---|
72 | {/literal} |
---|
73 | </script> |
---|
74 | |
---|
75 | <form name="edit_form" action="#" method="POST"> |
---|
76 | <fieldset> |
---|
77 | <legend>{$blog_name}</legend> |
---|
78 | <ul class="evil_blog_posts"> |
---|
79 | {foreach from=$row item=value} |
---|
80 | <li> |
---|
81 | <div id="post_{$value.id}"> |
---|
82 | <span id="post_id_{$value.id}">{$value.id}</span> |
---|
83 | * |
---|
84 | <span id="post_date_{$value.id}">{$value.date}</span> |
---|
85 | - |
---|
86 | <span id="post_header_{$value.id}">{$value.header}</span> |
---|
87 | <ul class="categoryActions"> |
---|
88 | <li> |
---|
89 | <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/category_edit.png" alt="{'edit'|@translate}" |
---|
90 | title="{'edit'|@translate}" onClick="return open_edit_form({$value.id})"> |
---|
91 | <img src="{$ROOT_URL}{$themeconf.admin_icon_dir}/category_delete.png" alt="{'delete'|@translate}" |
---|
92 | title="{'Delete'|@translate}" onClick="return subdel({$value.id})"> |
---|
93 | </li> |
---|
94 | </ul> |
---|
95 | <div id="post_text_{$value.id}" class="description"> |
---|
96 | {$value.text} |
---|
97 | </div> |
---|
98 | </div> |
---|
99 | </li> |
---|
100 | {/foreach} |
---|
101 | </ul> |
---|
102 | </fieldset> |
---|
103 | </form> |
---|
104 | <script type="text/javascript">{literal} |
---|
105 | function subnum (num) { |
---|
106 | document.blog_pagination.npage.value=num; |
---|
107 | document.blog_pagination.submit(); |
---|
108 | } |
---|
109 | {/literal} |
---|
110 | </script> |
---|
111 | <form name='blog_pagination' action='' method='POST'> |
---|
112 | <div class="navigationBar"> |
---|
113 | <a href="index.php" rel="first">{'First'|@translate}</a> | |
---|
114 | <a href="#" onclick='subnum({$npage-1})' rel="prev">{'Previous'|@translate}</a> | |
---|
115 | <input type='text' name='npage' style='visibility: hidden; position: absolute;'> |
---|
116 | {foreach from=$pagi item=v} |
---|
117 | {if $v!=$npage} |
---|
118 | <a class='blog_pagination' href='#' onclick='subnum({$v})'>{$v}</a> | |
---|
119 | {else} |
---|
120 | <span class='pageNumberSelected'>{$v}</span> | |
---|
121 | {/if} |
---|
122 | {/foreach} |
---|
123 | <a href="#" onclick='subnum({$npage+1})' rel="next">{'Next'|@translate}</a> | |
---|
124 | <a href="#" onclick='subnum({$pages})'" rel="last">{'Last'|@translate}</a> |
---|
125 | </div> |
---|
126 | </form> |
---|
127 | |
---|
128 | </div> |
---|