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