summary refs log tree commit diff stats
path: root/theme/admin/modquotes.tpl
diff options
context:
space:
mode:
Diffstat (limited to 'theme/admin/modquotes.tpl')
-rw-r--r--theme/admin/modquotes.tpl105
1 files changed, 105 insertions, 0 deletions
diff --git a/theme/admin/modquotes.tpl b/theme/admin/modquotes.tpl new file mode 100644 index 0000000..545a171 --- /dev/null +++ b/theme/admin/modquotes.tpl
@@ -0,0 +1,105 @@
1<h2>Moderate Quotes</h2>
2
3<div class="clear"></div>
4
5<script type="text/javascript">
6function denyQuote(id)
7{
8 if (confirm("Are you sure you would like to deny this quote?"))
9 {
10 postwith("/admin/modquotes.php?pageID=<!--PAGEID-->&amp;action=deny",{id:id});
11 }
12}
13
14function approveQuote(id)
15{
16 postwith("/admin/modquotes.php?pageID=<!--PAGEID-->&amp;action=approve",{id:id});
17}
18
19// following function taken from http://mentaljetsam.wordpress.com/2008/06/02/using-javascript-to-post-data-between-pages/
20function postwith (to,p) {
21 var myForm = document.createElement("form");
22 myForm.method="post" ;
23 myForm.action = to ;
24 for (var k in p) {
25 var myInput = document.createElement("input") ;
26 myInput.setAttribute("name", k) ;
27 myInput.setAttribute("value", p[k]);
28 myForm.appendChild(myInput) ;
29 }
30 document.body.appendChild(myForm) ;
31 myForm.submit() ;
32 document.body.removeChild(myForm) ;
33}
34
35function bulkAction()
36{
37 var bulk=new Array();
38 $(".the-check:checked").each(function() {
39 bulk.push($(this).val());
40 });
41 var ids = bulk.join(",")
42
43 if (ids != "")
44 {
45 if ($('#manage-bulk select').val() == "deny")
46 {
47 if (confirm("Are you sure you would like to deny the selected quotes?"))
48 {
49 postwith("/admin/modquotes.php?pageID=<!--PAGEID-->&amp;action=denys",{ids:ids});
50 }
51 } else if ($('#manage-bulk select').val() == "approve")
52 {
53 if (confirm("Are you sure you would like to approve the selected quotes?"))
54 {
55 postwith("/admin/modquotes.php?pageID=<!--PAGEID-->&amp;action=approves",{ids:ids});
56 }
57 }
58 }
59}
60
61$(document).ready(function() {
62 $("input#all-check").click(function() {
63 var what = this.checked;
64 $("input.the-check").each(function() {
65 this.checked = what;
66 });
67 });
68});
69</script>
70
71<!--BEGIN AVAIL-->
72<div id="manage-options">
73 <div id="manage-bulk">
74 <select name="bulk-type">
75 <option value="approve">Approve</option>
76 <option value="deny">Deny</option>
77 </select>
78
79 <button id="bulk" type="button" onclick="bulkAction()">Bulk</button>
80 </div>
81</div>
82
83<div class="manage-pagination"><!--PAGINATION--></div>
84
85<table>
86 <tr class="table-header">
87 <td class="table-checkbox"><input type="checkbox" id="all-check" /></td>
88 <td>Quote</td>
89 <td colspan="2">Actions</td>
90 </tr>
91 <!--BEGIN QUOTE-->
92 <tr<!--QUOTE.ODD-->>
93 <td class="table-checkbox"><input class="the-check" type="checkbox" name="bulk" value="<!--QUOTE.ID-->" /></td>
94 <td style="line-height: 1.5em;"><!--QUOTE.TEXT--></td>
95 <td class="table-img"><a href="#" onclick="approveQuote(<!--QUOTE.ID-->)"><img src="/theme/images/icons/thumb_up.png" alt="Approve" /></a></td>
96 <td class="table-img"><a href="#" onclick="denyQuote(<!--QUOTE.ID-->)"><img src="/theme/images/icons/thumb_down.png" alt="Delete" /></a></td>
97 </tr>
98 <!--END QUOTE-->
99</table>
100
101<div class="manage-pagination"><!--PAGINATION--></div>
102<!--END AVAIL-->
103<!--BEGIN NOTAVAIL-->
104<div class="manage-pagination">There are no quotes to moderate.</div>
105<!--END NOTAVAIL-->