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 ...?',
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  'firstResult' => true,
26  );
27 
28  $this->widget('vote.widgets.VoteWidget', $options);
29 
30 ?>
31 <br/>
32 <h3>Second question</h3>
33 <?php
34  $this->widget('vote.widgets.VoteWidget', array(
35  'id' => 'crf23',
36  'author_id' => 1,
37  'question' => 'Do you like ...?',
38  'answers' => array(
39  'q1' => array('text' => 'Yes', 'order' => 1),
40  'q2' => array('text' => 'No', 'order' => 2),
41  'q3' => array('text' => 'Dont know', 'order' => 3),
42  'q4' => array('text' => 'Hmmm...', 'order' => 5),
43  ),
44  'multiply' => true,
45  'dynamic' => true,
46  'ajax' => true,
47  'allowAnonymous' => true,
48  'additionalFields' => array(
49  'pageName' => 'Page '.rand(),
50  'userStatus' => 'Status '.rand()
51  ),
52  'inPercents' => false,
53  'precision' => 2,
54  //'resultsUnvotedShow' => true,
55  //'poolVotedShow' => true,
56  'firstResult' => true,
57  )
58  );
59 ?>