forked from Doogiemuc/Dokuwiki-Plugin-Doodle2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
doodle_template.php
executable file
·83 lines (69 loc) · 2.27 KB
/
doodle_template.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
<?php
/**
* This is the HTML template for the doodle table.
*
* I am utilizing the PHP parser as a templating engine:
* doodle_tempalte.php is simply included and evaled from syntax.php
* The variable $template will be inherited from syntax.php and can be used here.
*/
global $ID;
$template = $this->template;
$c = count($template['choices']);
?>
<!-- Doodle Plugin -->
<form action="<?php echo wl() ?>" method="post" name="doodle__form" id="<?php echo $template['formId'] ?>" accept-charset="utf-8" >
<input type="hidden" name="sectok" value="<?php echo getSecurityToken() ?>" />
<input type="hidden" name="do" value="show" >
<input type="hidden" name="id" value="<?php echo $ID ?>" >
<input type="hidden" name="formId" value="<?php echo $template['formId'] ?>" >
<table class="inline">
<tbody>
<tr class="row0">
<th class="centeralign" colspan="<?php echo ($c+1) ?>">
<?php echo $template['title'] ?>
</th>
</tr>
<tr class="row1">
<th class="col0"><?php echo $lang['fullname'] ?></th>
<?php foreach ($template['choices'] as $choice) { ?>
<td class="centeralign"><?php echo $choice ?></td>
<?php } ?>
</tr>
<?php foreach ($template['doodleData'] as $fullname => $userData) { ?>
<tr>
<td class="rightalign">
<?php echo $userData['editLinks'].$fullname.$userData['username'] ?>
</td>
<?php for ($col = 0; $col < $c; $col++) {
echo $userData['choice'][$col];
} ?>
</tr>
<?php } ?>
<!-- Results / sum per column -->
<tr>
<th class="rightalign"><b><?php echo $template['result'] ?></b></th>
<?php for ($col = 0; $col < $c; $col++) { ?>
<th class="centeralign"><b><?php echo $template['count'][$col] ?></b></th>
<?php } ?>
</tr>
<?php
/* Input fields, if allowed. */
echo $template['inputTR']
?>
<?php if (!empty($template['msg'])) { ?>
<tr>
<td colspan="<?php echo $c+1 ?>">
<?php echo $template['msg'] ?>
</td>
</tr>
<?php } ?>
<?php if(!empty($template['closeform'])) { ?>
<tr>
<td colspan="<?php echo $c+1 ?>">
<input type="submit" name="close__vote" value="<?php echo $template['closeform'] ?>" class="button">
</td>
</tr>
<?php } ?>
</tbody>
</table>
</form>