-
Notifications
You must be signed in to change notification settings - Fork 988
/
answer.php
102 lines (90 loc) · 3.24 KB
/
answer.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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
/**
* Date Html, selector style :
* @var $name
* @var $qid
* @var $iLength
* @var $dateoutput
* @var $mindate
* @var $maxdate
* @var $dateformatdetails
* @var $dateformatdetailsjs
* @var $goodchars
* @var $checkconditionFunction
* @var $language
* @var $hidetip
*/
?>
<!-- Date, selector layout -->
<!-- answer -->
<div class='question answer-item text-item date-item form-group'>
<label for='answer<?php echo $name;?>' class='hide label'>
<?php echo sprintf(gT('Date in the format: %s'), $dateformatdetails); ?>
</label>
<span class='col-xs-12 col-sm-4'>
<i class='fa fa-calendar form-control-feedback' aria-hidden='true'></i>
<?php /* Old input, not used since switching to Bootstrap DateTimePicker
<input
class='form-control'
type="text"
size="<?php echo $iLength;?>"
name="<?php echo $name;?>"
id="answer<?php echo $name;?>"
value="<?php echo $dateoutput;?>"
maxlength="<?php echo $iLength;?>"
onkeypress="<?php echo $goodchars;?>"
onchange="<?php echo $checkconditionFunction;?>"
/>
*/
?>
<?php $this->widget('yiiwheels.widgets.datetimepicker.WhDateTimePicker', array(
'name' => $name,
'id' => "answer" . $name,
'value' => $dateoutput,
'pluginOptions' => array(
'class' => 'test',
'format' => $dateformatReversed,
'singleDatePicker' => true,
'startDate' => date("Y-m-d H:i", time()),
'drops' => 'up', // TODO: Does not work. Why?
// Show hour and minute picker if we have HH or MM in date format
'pickTime' => (strpos($dateformatdetails, "HH") !== false || strpos($dateformatdetails, "MM") !== false),
'pickDate' => !$hideCalendar,
'timePicker12Hour' => false,
'timePicker24Hour' => true,
'timePickerIncrement' => 1,
),
'htmlOptions' => array(
'onkeypress' => $goodchars,
'onchange' => "$checkconditionFunction"
)
));
?>
</span>
<input
type='hidden'
name="dateformat<?php echo $name;?>"
id="dateformat<?php echo $name;?>"
value="<?php echo $dateformatdetailsjs;?>"
/>
<input
type='hidden'
name="datelanguage<?php echo $name;?>"
id="datelanguage<?php echo $name;?>"
value="<?php echo $language;?>"
/>
<?php if($hidetip):?>
<div class='col-xs-12'>
<p class="tip help-block">
<?php echo sprintf(gT('Format: %s'),$dateformatdetails); ?>
</p>
</div>
<?php endif;?>
</div>
<div class='hidden nodisplay' style='display:none'>
<!-- Obs: No spaces in the div - it will mess up Javascript string parsing -->
<div id='datemin<?php echo $name;?>'><?php echo $mindate; ?></div>
<div id='datemax<?php echo $name;?>'><?php echo $maxdate; ?></div>
</div>
<input type='hidden' class="namecontainer" data-name="<?php echo $qid; ?>" />
<!-- end of answer -->