-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrate-widget.tpl.php
50 lines (47 loc) · 1.76 KB
/
rate-widget.tpl.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
<?php
/**
* @file
* Rate widget theme
*
* This is the default template for rate widgets. See section 3 of the README
* file for information on theming widgets.
*
* Available variables:
* - $links: Array with vote links
* array(
* array(
* 'text' => 'Button label',
* 'href' => 'Link href',
* 'value' => 20,
* 'votes' => 6,
* ),
* )
* - $results: Array with voting results
* array(
* 'rating' => 12, // Average rating
* 'options' => array( // Votes per option. Only available when value_type == 'options'
* 1 => 234,
* 2 => 34,
* ),
* 'count' => 23, // Number of votes
* 'up' => 2, // Number of up votes. Only available for thumbs up / down.
* 'down' => 3, // Number of down votes. Only available for thumbs up / down.
* 'up_percent' => 40, // Percentage of up votes. Only available for thumbs up / down.
* 'down_percent' => 60, // Percentage of down votes. Only available for thumbs up / down.
* 'user_vote' => 80, // Value for user vote. Only available when user has voted.
* )
* - $mode: Display mode.
* - $just_voted: Indicator whether the user has just voted (boolean).
* - $content_type: "node" or "comment".
* - $content_id: Node or comment id.
* - $buttons: Array with themed buttons (built in preprocess function).
* - $info: String with user readable information (built in preprocess function).
*/
?>
<?php print theme('item_list', array('items' => $buttons)); ?>
<?php if ($info): ?>
<?php print '<div class="rate-info">' . $info . '</div>'; ?>
<?php endif; ?>
<?php if ($display_options['description']): ?>
<?php print '<div class="rate-description">' . $display_options['description'] . '</div>'; ?>
<?php endif; ?>