summaryrefslogtreecommitdiff
path: root/tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php
diff options
context:
space:
mode:
Diffstat (limited to 'tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php')
-rw-r--r--tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php206
1 files changed, 103 insertions, 103 deletions
diff --git a/tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php b/tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php
index da6ad153..4405ca44 100644
--- a/tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php
+++ b/tests/FunctionalTests/tickets/protected/pages/Ticket284Component.php
@@ -1,103 +1,103 @@
-<?php
-
-class Ticket284Component extends TTemplateControl implements IValidatable
-{
- private $_isValid;
- public function onPreRender($param)
- {
- if (!$this->ShowHours && $this->ShowMinutes)
- {
- throw new TConfigurationException(
- 'Invalid OPSDatePicker Config: You cannot specify ShowMinutes="true" while ShowHours="false"'
- );
- }
- }
-
- public function getDatePicker()
- {
- $this->ensureChildControls();
- return $this->getRegisteredObject('datePicker');
- }
-
- public function getHourPicker()
- {
- $this->ensureChildControls();
- return $this->getRegisteredObject('hourPicker');
- }
-
- public function getMinutePicker()
- {
- $this->ensureChildControls();
- return $this->getRegisteredObject('minutePicker');
- }
-
- public function getShowHours()
- {
- return $this->HourPicker->Visible;
- }
-
- public function setShowHours($value)
- {
- $this->HourPicker->Visible = TPropertyValue::ensureBoolean($value);
- }
-
- public function getShowMinutes()
- {
- return $this->MinutePicker->Visible;
- }
-
- public function setShowMinutes($value)
- {
- $this->MinutePicker->Visible = TPropertyValue::ensureBoolean($value);
- }
-
- public function getTimeStamp()
- {
- return strtotime($this->Date);
- }
-
- public function setTimeStamp($value)
- {
- $ts = TPropertyValue::ensureInteger($value);
- $this->DatePicker->TimeStamp = $ts;
- $this->HourPicker->SelectedValue = date('H', $ts);
- $this->MinutePicker->SelectedValue = date('i', $ts);
- }
-
- public function getDate()
- {
- $dateStr = $this->DatePicker->Date;
- if ($this->ShowHours){
- $dateStr .= ' '.$this->HourPicker->SelectedValue;
- }
- if ($this->ShowMinutes){
- $dateStr .= ':'.$this->MinutePicker->SelectedValue;
- }
- return $dateStr;
- }
-
- public function setDate($value)
- {
- $dateStr = TPropertyValue::ensureString($value);
- $this->TimeStamp = strtotime($dateStr);
- }
-
- public function getValidationPropertyValue()
- {
- if ($this->DatePicker->Date === ''){
- return '';
- }
- else{
- return $this->TimeStamp;
- }
- }
- public function getIsValid()
- {
- return $this->_isValid;
- }
- public function setIsValid($value)
- {
- $this->_isValid=TPropertyValue::ensureBoolean($value);
- }
-}
-?>
+<?php
+
+class Ticket284Component extends TTemplateControl implements IValidatable
+{
+ private $_isValid;
+ public function onPreRender($param)
+ {
+ if (!$this->ShowHours && $this->ShowMinutes)
+ {
+ throw new TConfigurationException(
+ 'Invalid OPSDatePicker Config: You cannot specify ShowMinutes="true" while ShowHours="false"'
+ );
+ }
+ }
+
+ public function getDatePicker()
+ {
+ $this->ensureChildControls();
+ return $this->getRegisteredObject('datePicker');
+ }
+
+ public function getHourPicker()
+ {
+ $this->ensureChildControls();
+ return $this->getRegisteredObject('hourPicker');
+ }
+
+ public function getMinutePicker()
+ {
+ $this->ensureChildControls();
+ return $this->getRegisteredObject('minutePicker');
+ }
+
+ public function getShowHours()
+ {
+ return $this->HourPicker->Visible;
+ }
+
+ public function setShowHours($value)
+ {
+ $this->HourPicker->Visible = TPropertyValue::ensureBoolean($value);
+ }
+
+ public function getShowMinutes()
+ {
+ return $this->MinutePicker->Visible;
+ }
+
+ public function setShowMinutes($value)
+ {
+ $this->MinutePicker->Visible = TPropertyValue::ensureBoolean($value);
+ }
+
+ public function getTimeStamp()
+ {
+ return strtotime($this->Date);
+ }
+
+ public function setTimeStamp($value)
+ {
+ $ts = TPropertyValue::ensureInteger($value);
+ $this->DatePicker->TimeStamp = $ts;
+ $this->HourPicker->SelectedValue = date('H', $ts);
+ $this->MinutePicker->SelectedValue = date('i', $ts);
+ }
+
+ public function getDate()
+ {
+ $dateStr = $this->DatePicker->Date;
+ if ($this->ShowHours){
+ $dateStr .= ' '.$this->HourPicker->SelectedValue;
+ }
+ if ($this->ShowMinutes){
+ $dateStr .= ':'.$this->MinutePicker->SelectedValue;
+ }
+ return $dateStr;
+ }
+
+ public function setDate($value)
+ {
+ $dateStr = TPropertyValue::ensureString($value);
+ $this->TimeStamp = strtotime($dateStr);
+ }
+
+ public function getValidationPropertyValue()
+ {
+ if ($this->DatePicker->Date === ''){
+ return '';
+ }
+ else{
+ return $this->TimeStamp;
+ }
+ }
+ public function getIsValid()
+ {
+ return $this->_isValid;
+ }
+ public function setIsValid($value)
+ {
+ $this->_isValid=TPropertyValue::ensureBoolean($value);
+ }
+}
+?>