Gentics Portal.Node PHP API
 All Classes Namespaces Functions Variables Pages
voteWidget.php
1 <h3>First question</h3>
2 <?php
3 $options = array(
4  'id' => 'crf22',
5  'author_id' => 1,
6  'question' => 'Do you like potatoes, ah?',
7  'answers' => array(
8  'q1' => array('text' => 'Yes', 'order' => 1),
9  'q2' => array('text' => 'No', 'order' => 2),
10  'q3' => array('text' => 'Dont know', 'order' => 3),
11  'q4' => array('text' => 'Hmmm...', 'order' => 5),
12  ),
13  'multiply' => false,
14  'dynamic' => true,
15  'ajax' => true,
16  'allowAnonymous' => true,
17  'additionalFields' => array(
18  'pageName' => 'Page '.rand(),
19  'userStatus' => 'Status '.rand()
20  ),
21  'inPercents' => true,
22  'precision' => 2,
23  //'resultsUnvotedShow' => true,
24  'poolVotedShow' => true,
25  );
26  $this->widget('vote.widgets.VoteWidget', $options);
27 ?>
28 <br/>
29 <h3>Second question</h3>
30 <?php
31  $this->widget('vote.widgets.VoteWidget', array(
32  'id' => 'crf23',
33  'author_id' => 1,
34  'question' => 'Do you like cucumbers, ah?',
35  'answers' => array(
36  'q1' => array('text' => 'Yes', 'order' => 1),
37  'q2' => array('text' => 'No', 'order' => 2),
38  'q3' => array('text' => 'Dont know', 'order' => 3),
39  'q4' => array('text' => 'Hmmm...', 'order' => 5),
40  ),
41  'multiply' => true,
42  'dynamic' => true,
43  'ajax' => true,
44  'allowAnonymous' => true,
45  'additionalFields' => array(
46  'pageName' => 'Page '.rand(),
47  'userStatus' => 'Status '.rand()
48  ),
49  'inPercents' => false,
50  'precision' => 2,
51  //'resultsUnvotedShow' => true,
52  //'poolVotedShow' => true,
53  )
54  );
55 ?>