summary refs log tree commit diff stats
path: root/theme/admin/polls.tpl
diff options
context:
space:
mode:
Diffstat (limited to 'theme/admin/polls.tpl')
-rwxr-xr-xtheme/admin/polls.tpl94
1 files changed, 0 insertions, 94 deletions
diff --git a/theme/admin/polls.tpl b/theme/admin/polls.tpl deleted file mode 100755 index 81613a9..0000000 --- a/theme/admin/polls.tpl +++ /dev/null
@@ -1,94 +0,0 @@
1<h2>Manage Polls</h2>
2
3<div class="clear"></div>
4
5<script type="text/javascript">
6function deletePoll(id)
7{
8 if (confirm("Are you sure you would like to delete this poll?"))
9 {
10 postwith("/admin/polls.php?pageID=<!--PAGEID-->&action=delete",{id:id});
11 }
12}
13
14// following function taken from http://mentaljetsam.wordpress.com/2008/06/02/using-javascript-to-post-data-between-pages/
15function postwith (to,p) {
16 var myForm = document.createElement("form");
17 myForm.method="post" ;
18 myForm.action = to ;
19 for (var k in p) {
20 var myInput = document.createElement("input") ;
21 myInput.setAttribute("name", k) ;
22 myInput.setAttribute("value", p[k]);
23 myForm.appendChild(myInput) ;
24 }
25 document.body.appendChild(myForm) ;
26 myForm.submit() ;
27 document.body.removeChild(myForm) ;
28}
29
30function bulkAction()
31{
32 var bulk=new Array();
33 $(".the-check:checked").each(function() {
34 bulk.push($(this).val());
35 });
36 var ids = bulk.join(",")
37
38 if (ids != "")
39 {
40 if ($('#manage-bulk select').val() == "delete")
41 {
42 if (confirm("Are you sure you would like to delete the selected polls?"))
43 {
44 postwith("/admin/polls.php?pageID=<!--PAGEID-->&action=deletes",{ids:ids});
45 }
46 }
47 }
48}
49
50$(document).ready(function() {
51 $("input#all-check").click(function() {
52 var what = this.checked;
53 $("input.the-check").each(function() {
54 this.checked = what;
55 });
56 });
57});
58</script>
59
60<!--BEGIN AVAIL-->
61<div id="manage-options">
62 <div id="manage-bulk">
63 <select name="bulk-type">
64 <option value="delete">Delete</option>
65 </select>
66
67 <button id="bulk" type="button" onclick="bulkAction()">Bulk</button>
68 </div>
69</div>
70
71<div class="manage-pagination"><!--PAGINATION--></div>
72
73<table>
74 <tr class="table-header">
75 <td class="table-checkbox"><input type="checkbox" id="all-check" /></td>
76 <td>Question</td>
77 <td colspan="3">Actions</td>
78 </tr>
79 <!--BEGIN POST-->
80 <tr<!--POST.ODD-->>
81 <td class="table-checkbox"><input class="the-check" type="checkbox" name="bulk" value="<!--POST.ID-->" /></td>
82 <td><!--POST.TITLE--></td>
83 <td class="table-img"><a href="/admin/editPoll.php?id=<!--POST.ID-->"><img src="/theme/images/icons/page_edit.png" alt="Edit" /></a></td>
84 <td class="table-img"><a href="#" onclick="deletePoll(<!--POST.ID-->)"><img src="/theme/images/icons/page_delete.png" alt="Delete" /></a></td>
85 <td class="table-img"><a href="/poll/<!--POST.ID-->.php"><img src="/theme/images/icons/page_go.png" alt="View" /></a></td>
86 </tr>
87 <!--END POST-->
88</table>
89
90<div class="manage-pagination"><!--PAGINATION--></div>
91<!--END AVAIL-->
92<!--BEGIN NOTAVAIL-->
93<div class="manage-pagination">There are no polls.</div>
94<!--END NOTAVAIL-->