@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | */ |
51 | 51 | public function setText($value) |
52 | 52 | { |
53 | - if(parent::getText() === $value) |
|
53 | + if(parent::getText()===$value) |
|
54 | 54 | return; |
55 | 55 | |
56 | 56 | parent::setText($value); |
@@ -64,14 +64,14 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function setImageUrl($value) |
66 | 66 | { |
67 | - if(parent::getImageUrl() === $value) |
|
67 | + if(parent::getImageUrl()===$value) |
|
68 | 68 | return; |
69 | 69 | |
70 | 70 | parent::setImageUrl($value); |
71 | - if($this->getActiveControl()->canUpdateClientSide() && $value !== '') |
|
71 | + if($this->getActiveControl()->canUpdateClientSide() && $value!=='') |
|
72 | 72 | { |
73 | - $textWriter = new TTextWriter; |
|
74 | - $renderer = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $textWriter); |
|
73 | + $textWriter=new TTextWriter; |
|
74 | + $renderer=Prado::createComponent($this->GetResponse()->getHtmlWriterType(), $textWriter); |
|
75 | 75 | $this->createImage($value)->renderControl($renderer); |
76 | 76 | $this->getPage()->getCallbackClient()->update($this, $textWriter->flush()); |
77 | 77 | } |
@@ -83,14 +83,14 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function setNavigateUrl($value) |
85 | 85 | { |
86 | - if(parent::getNavigateUrl() === $value) |
|
86 | + if(parent::getNavigateUrl()===$value) |
|
87 | 87 | return; |
88 | 88 | |
89 | 89 | parent::setNavigateUrl($value); |
90 | 90 | if($this->getActiveControl()->canUpdateClientSide()) |
91 | 91 | { |
92 | 92 | //replace & with & and urldecode the url (setting the href using javascript is literal) |
93 | - $url = urldecode(str_replace('&', '&', $value)); |
|
93 | + $url=urldecode(str_replace('&', '&', $value)); |
|
94 | 94 | $this->getPage()->getCallbackClient()->setAttribute($this, 'href', $url); |
95 | 95 | } |
96 | 96 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function setTarget($value) |
103 | 103 | { |
104 | - if(parent::getTarget() === $value) |
|
104 | + if(parent::getTarget()===$value) |
|
105 | 105 | return; |
106 | 106 | |
107 | 107 | parent::setTarget($value); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function setText($value) |
57 | 57 | { |
58 | - if(parent::getText() === $value) |
|
58 | + if(parent::getText()===$value) |
|
59 | 59 | return; |
60 | 60 | |
61 | 61 | parent::setText($value); |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function setForControl($value) |
73 | 73 | { |
74 | - if(parent::getForControl() === $value) |
|
74 | + if(parent::getForControl()===$value) |
|
75 | 75 | return; |
76 | 76 | |
77 | 77 | parent::setForControl($value); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | * @param THtmlWriter the writer used for the rendering purpose |
88 | 88 | */ |
89 | 89 | protected function addAttributesToRender($writer) { |
90 | - $writer->addAttribute('id',$this->getClientID()); |
|
90 | + $writer->addAttribute('id', $this->getClientID()); |
|
91 | 91 | parent::addAttributesToRender($writer); |
92 | 92 | } |
93 | 93 | } |
@@ -91,8 +91,8 @@ |
||
91 | 91 | * @param THtmlWriter the writer used for the rendering purpose |
92 | 92 | */ |
93 | 93 | protected function addAttributesToRender($writer) { |
94 | - $writer->addAttribute('id',$this->getClientID()); |
|
95 | - parent::addAttributesToRender($writer); |
|
94 | + $writer->addAttribute('id',$this->getClientID()); |
|
95 | + parent::addAttributesToRender($writer); |
|
96 | 96 | } |
97 | 97 | } |
98 | 98 |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | */ |
44 | 44 | public function setInterval($value) |
45 | 45 | { |
46 | - $interval = TPropertyValue::ensureFloat($value); |
|
46 | + $interval=TPropertyValue::ensureFloat($value); |
|
47 | 47 | if($interval <= 0) |
48 | 48 | throw new TConfigurationException('callback_interval_be_positive', $this->getID()); |
49 | 49 | |
50 | - if($this->getInterval() === $value) |
|
50 | + if($this->getInterval()===$value) |
|
51 | 51 | return; |
52 | 52 | |
53 | 53 | $this->setViewState('Interval', $interval, 1); |
54 | - if ($this->getActiveControl()->canUpdateClientSide()){ |
|
55 | - $client = $this->getPage()->getCallbackClient(); |
|
54 | + if($this->getActiveControl()->canUpdateClientSide()) { |
|
55 | + $client=$this->getPage()->getCallbackClient(); |
|
56 | 56 | $client->callClientFunction('Prado.WebUI.TTimeTriggeredCallback.setTimerInterval', array($this, $interval)); |
57 | 57 | } |
58 | 58 | } |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function startTimer() |
64 | 64 | { |
65 | - $client = $this->getPage()->getCallbackClient(); |
|
65 | + $client=$this->getPage()->getCallbackClient(); |
|
66 | 66 | $client->callClientFunction('Prado.WebUI.TTimeTriggeredCallback.start', array($this)); |
67 | 67 | } |
68 | 68 | |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function stopTimer() |
73 | 73 | { |
74 | - $client = $this->getPage()->getCallbackClient(); |
|
74 | + $client=$this->getPage()->getCallbackClient(); |
|
75 | 75 | $client->callClientFunction('Prado.WebUI.TTimeTriggeredCallback.stop', array($this)); |
76 | 76 | } |
77 | 77 | |
@@ -97,9 +97,9 @@ discard block |
||
97 | 97 | */ |
98 | 98 | protected function getTriggerOptions() |
99 | 99 | { |
100 | - $options['ID'] = $this->getClientID(); |
|
101 | - $options['EventTarget']= $this->getUniqueID(); |
|
102 | - $options['Interval'] = $this->getInterval(); |
|
100 | + $options['ID']=$this->getClientID(); |
|
101 | + $options['EventTarget']=$this->getUniqueID(); |
|
102 | + $options['Interval']=$this->getInterval(); |
|
103 | 103 | return $options; |
104 | 104 | } |
105 | 105 | |
@@ -112,10 +112,10 @@ discard block |
||
112 | 112 | parent::render($writer); |
113 | 113 | $this->getActiveControl()->registerCallbackClientScript( |
114 | 114 | $this->getClientClassName(), $this->getTriggerOptions()); |
115 | - if($this->getStartTimerOnLoad()){ |
|
116 | - $id = $this->getClientID(); |
|
117 | - $code = "Prado.WebUI.TTimeTriggeredCallback.start('{$id}');"; |
|
118 | - $cs = $this->getPage()->getClientScript(); |
|
115 | + if($this->getStartTimerOnLoad()) { |
|
116 | + $id=$this->getClientID(); |
|
117 | + $code="Prado.WebUI.TTimeTriggeredCallback.start('{$id}');"; |
|
118 | + $cs=$this->getPage()->getClientScript(); |
|
119 | 119 | $cs->registerEndScript("{$id}:start", $code); |
120 | 120 | } |
121 | 121 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function setAlternateText($value) |
50 | 50 | { |
51 | - if(parent::getAlternateText() === $value) |
|
51 | + if(parent::getAlternateText()===$value) |
|
52 | 52 | return; |
53 | 53 | |
54 | 54 | parent::setAlternateText($value); |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | */ |
66 | 66 | public function setImageAlign($value) |
67 | 67 | { |
68 | - if(parent::getImageAlign() === $value) |
|
68 | + if(parent::getImageAlign()===$value) |
|
69 | 69 | return; |
70 | 70 | |
71 | 71 | parent::setImageAlign($value); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function setImageUrl($value) |
80 | 80 | { |
81 | - if(parent::getImageUrl() === $value) |
|
81 | + if(parent::getImageUrl()===$value) |
|
82 | 82 | return; |
83 | 83 | |
84 | 84 | parent::setImageUrl($value); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function setDescriptionUrl($value) |
93 | 93 | { |
94 | - if(parent::getDescriptionUrl() === $value) |
|
94 | + if(parent::getDescriptionUrl()===$value) |
|
95 | 95 | return; |
96 | 96 | |
97 | 97 | parent::setDescriptionUrl($value); |
@@ -48,6 +48,7 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * Sets the alternative text to be displayed in the TImage when the image is unavailable. |
50 | 50 | * @param string the alternative text |
51 | + * @param string $value |
|
51 | 52 | */ |
52 | 53 | public function setAlternateText($value) |
53 | 54 | { |
@@ -78,6 +79,7 @@ discard block |
||
78 | 79 | |
79 | 80 | /** |
80 | 81 | * @param string the URL of the image file |
82 | + * @param string $value |
|
81 | 83 | */ |
82 | 84 | public function setImageUrl($value) |
83 | 85 | { |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function setText($value) |
97 | 97 | { |
98 | - if(parent::getText() === $value) |
|
98 | + if(parent::getText()===$value) |
|
99 | 99 | return; |
100 | 100 | |
101 | 101 | parent::setText($value); |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | protected function addAttributesToRender($writer) |
119 | 119 | { |
120 | 120 | parent::addAttributesToRender($writer); |
121 | - $writer->addAttribute('id',$this->getClientID()); |
|
121 | + $writer->addAttribute('id', $this->getClientID()); |
|
122 | 122 | |
123 | 123 | if($this->getEnabled(true)) |
124 | 124 | { |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function setEnabled($value) |
136 | 136 | { |
137 | - if(parent::getEnabled() === $value) |
|
137 | + if(parent::getEnabled()===$value) |
|
138 | 138 | return; |
139 | 139 | |
140 | 140 | parent::setEnabled($value); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | { |
143 | 143 | if($this->getEnabled(true)) |
144 | 144 | { |
145 | - $nop = "javascript:;//".$this->getClientID(); |
|
145 | + $nop="javascript:;//".$this->getClientID(); |
|
146 | 146 | $this->getPage()->getCallbackClient()->setAttribute($this, 'href', $nop); |
147 | 147 | |
148 | 148 | $this->getActiveControl()->registerCallbackClientScript( |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function setText($value) |
90 | 90 | { |
91 | - if(parent::getText() === $value) |
|
91 | + if(parent::getText()===$value) |
|
92 | 92 | return; |
93 | 93 | |
94 | 94 | parent::setText($value); |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | */ |
106 | 106 | public function setChecked($value) |
107 | 107 | { |
108 | - $value = TPropertyValue::ensureBoolean($value); |
|
109 | - if(parent::getChecked() === $value) |
|
108 | + $value=TPropertyValue::ensureBoolean($value); |
|
109 | + if(parent::getChecked()===$value) |
|
110 | 110 | return; |
111 | 111 | |
112 | 112 | parent::setChecked($value); |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | * @param string checkbox id |
133 | 133 | * @param string onclick js |
134 | 134 | */ |
135 | - protected function renderInputTag($writer,$clientID,$onclick) |
|
135 | + protected function renderInputTag($writer, $clientID, $onclick) |
|
136 | 136 | { |
137 | - parent::renderInputTag($writer,$clientID,$onclick); |
|
138 | - if ($this->getAutoPostBack()) |
|
137 | + parent::renderInputTag($writer, $clientID, $onclick); |
|
138 | + if($this->getAutoPostBack()) |
|
139 | 139 | $this->getActiveControl()->registerCallbackClientScript( |
140 | 140 | $this->getClientClassName(), $this->getPostBackOptions()); |
141 | 141 | } |
@@ -154,8 +154,8 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function getLabelAttributes() |
156 | 156 | { |
157 | - $attributes = parent::getLabelAttributes(); |
|
158 | - $attributes['id'] = $this->getDefaultLabelID(); |
|
157 | + $attributes=parent::getLabelAttributes(); |
|
158 | + $attributes['id']=$this->getDefaultLabelID(); |
|
159 | 159 | return $attributes; |
160 | 160 | } |
161 | 161 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | * @param string checkbox id |
166 | 166 | * @param string label text |
167 | 167 | */ |
168 | - protected function renderLabel($writer,$clientID,$text) |
|
168 | + protected function renderLabel($writer, $clientID, $text) |
|
169 | 169 | { |
170 | 170 | $writer->addAttribute('id', $this->getDefaultLabelID()); |
171 | 171 | parent::renderLabel($writer, $clientID, $text); |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | protected function getDefaultLabelID() |
178 | 178 | { |
179 | - if($attributes=$this->getViewState('LabelAttributes',null)) |
|
179 | + if($attributes=$this->getViewState('LabelAttributes', null)) |
|
180 | 180 | return TCheckBox::getLabelAttributes()->itemAt('id'); |
181 | 181 | else |
182 | 182 | return $this->getClientID().'_label'; |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | */ |
59 | 59 | public function setAlternateText($value) |
60 | 60 | { |
61 | - if(parent::getAlternateText() === $value) |
|
61 | + if(parent::getAlternateText()===$value) |
|
62 | 62 | return; |
63 | 63 | |
64 | 64 | parent::setAlternateText($value); |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function setImageAlign($value) |
77 | 77 | { |
78 | - if(parent::getImageAlign() === $value) |
|
78 | + if(parent::getImageAlign()===$value) |
|
79 | 79 | return; |
80 | 80 | |
81 | 81 | parent::setImageAlign($value); |
@@ -88,7 +88,7 @@ discard block |
||
88 | 88 | */ |
89 | 89 | public function setImageUrl($value) |
90 | 90 | { |
91 | - if(parent::getImageUrl() === $value) |
|
91 | + if(parent::getImageUrl()===$value) |
|
92 | 92 | return; |
93 | 93 | |
94 | 94 | parent::setImageUrl($value); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function setDescriptionUrl($value) |
103 | 103 | { |
104 | - if(parent::getDescriptionUrl() === $value) |
|
104 | + if(parent::getDescriptionUrl()===$value) |
|
105 | 105 | return; |
106 | 106 | |
107 | 107 | parent::setDescriptionUrl($value); |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | protected function addAttributesToRender($writer) |
152 | 152 | { |
153 | 153 | parent::addAttributesToRender($writer); |
154 | - $writer->addAttribute('id',$this->getClientID()); |
|
154 | + $writer->addAttribute('id', $this->getClientID()); |
|
155 | 155 | $this->getActiveControl()->registerCallbackClientScript( |
156 | 156 | $this->getClientClassName(), $this->getPostBackOptions()); |
157 | 157 | } |
@@ -48,6 +48,7 @@ discard block |
||
48 | 48 | /** |
49 | 49 | * Sets the alternative text to be displayed in the TImage when the image is unavailable. |
50 | 50 | * @param string the alternative text |
51 | + * @param string $value |
|
51 | 52 | */ |
52 | 53 | public function setAlternateText($value) |
53 | 54 | { |
@@ -78,6 +79,7 @@ discard block |
||
78 | 79 | |
79 | 80 | /** |
80 | 81 | * @param string the URL of the image file |
82 | + * @param string $value |
|
81 | 83 | */ |
82 | 84 | public function setImageUrl($value) |
83 | 85 | { |
@@ -404,8 +404,8 @@ discard block |
||
404 | 404 | { |
405 | 405 | if ($needSpan=$this->getSpanNeeded()) |
406 | 406 | { |
407 | - $writer->addAttribute('id', $this->getClientId()); |
|
408 | - $writer->renderBeginTag('span'); |
|
407 | + $writer->addAttribute('id', $this->getClientId()); |
|
408 | + $writer->renderBeginTag('span'); |
|
409 | 409 | } |
410 | 410 | if($this->getItemCount()>0) |
411 | 411 | { |
@@ -463,14 +463,14 @@ discard block |
||
463 | 463 | */ |
464 | 464 | public function getIsValid() |
465 | 465 | { |
466 | - return $this->_isValid; |
|
466 | + return $this->_isValid; |
|
467 | 467 | } |
468 | 468 | /** |
469 | 469 | * @param bool wether this control is valid. |
470 | 470 | */ |
471 | 471 | public function setIsValid($value) |
472 | 472 | { |
473 | - $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
473 | + $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
474 | 474 | } |
475 | 475 | |
476 | 476 | /** |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | |
60 | 60 | /** |
61 | 61 | * Creates a control used for repetition (used as a template). |
62 | - * @return TControl the control to be repeated |
|
62 | + * @return TCheckBoxItem the control to be repeated |
|
63 | 63 | */ |
64 | 64 | protected function createRepeatedControl() |
65 | 65 | { |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | * This method overrides the parent implementation so that it always returns |
72 | 72 | * the checkbox list itself (because the checkbox list does not have child controls.) |
73 | 73 | * @param string control ID |
74 | - * @return TControl control being found |
|
74 | + * @return \Prado\Web\UI\TControl|null control being found |
|
75 | 75 | */ |
76 | 76 | public function findControl($id, $real=false) |
77 | 77 | { |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
148 | - * @return string the direction of traversing the list, defaults to 'Vertical' |
|
148 | + * @return TRepeatDirection the direction of traversing the list, defaults to 'Vertical' |
|
149 | 149 | */ |
150 | 150 | public function getRepeatDirection() |
151 | 151 | { |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
164 | - * @return string how the list should be displayed, using table or using line breaks. Defaults to 'Table'. |
|
164 | + * @return TRepeatLayout how the list should be displayed, using table or using line breaks. Defaults to 'Table'. |
|
165 | 165 | */ |
166 | 166 | public function getRepeatLayout() |
167 | 167 | { |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | /** |
441 | 441 | * Returns the value to be validated. |
442 | 442 | * This methid is required by \Prado\Web\UI\IValidatable interface. |
443 | - * @return mixed the value of the property to be validated. |
|
443 | + * @return string the value of the property to be validated. |
|
444 | 444 | */ |
445 | 445 | public function getValidationPropertyValue() |
446 | 446 | { |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | */ |
76 | 76 | public function findControl($id, $real=false) |
77 | 77 | { |
78 | - if ($real===true) |
|
78 | + if($real===true) |
|
79 | 79 | return parent::findControl($id); |
80 | 80 | return $this; |
81 | 81 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function getTextAlign() |
105 | 105 | { |
106 | - return $this->getViewState('TextAlign',TTextAlign::Right); |
|
106 | + return $this->getViewState('TextAlign', TTextAlign::Right); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function setTextAlign($value) |
113 | 113 | { |
114 | - $this->setViewState('TextAlign',TPropertyValue::ensureEnum($value,'Prado\\Web\\UI\\WebControls\\TTextAlign'),TTextAlign::Right); |
|
114 | + $this->setViewState('TextAlign', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TTextAlign'), TTextAlign::Right); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
@@ -120,10 +120,10 @@ discard block |
||
120 | 120 | */ |
121 | 121 | protected function getRepeatInfo() |
122 | 122 | { |
123 | - if(($repeatInfo=$this->getViewState('RepeatInfo',null))===null) |
|
123 | + if(($repeatInfo=$this->getViewState('RepeatInfo', null))===null) |
|
124 | 124 | { |
125 | 125 | $repeatInfo=new TRepeatInfo; |
126 | - $this->setViewState('RepeatInfo',$repeatInfo,null); |
|
126 | + $this->setViewState('RepeatInfo', $repeatInfo, null); |
|
127 | 127 | } |
128 | 128 | return $repeatInfo; |
129 | 129 | } |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | public function setEnabled($value) |
253 | 253 | { |
254 | 254 | parent::setEnabled($value); |
255 | - $value = !TPropertyValue::ensureBoolean($value); |
|
255 | + $value=!TPropertyValue::ensureBoolean($value); |
|
256 | 256 | // if this is an active control, |
257 | 257 | // and it's a callback, |
258 | 258 | // and we can update clientside, |
@@ -261,9 +261,9 @@ discard block |
||
261 | 261 | $this->getPage()->getIsCallBack() && |
262 | 262 | $this->getActiveControl()->canUpdateClientSide()) |
263 | 263 | { |
264 | - $items = $this->getItems(); |
|
265 | - $cs = $this->getPage()->getCallbackClient(); |
|
266 | - $baseClientID = $this->getClientID().'_c'; |
|
264 | + $items=$this->getItems(); |
|
265 | + $cs=$this->getPage()->getCallbackClient(); |
|
266 | + $baseClientID=$this->getClientID().'_c'; |
|
267 | 267 | foreach($items as $index=>$item) |
268 | 268 | { |
269 | 269 | $cs->setAttribute($baseClientID.$index, 'disabled', $value); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | * @param integer index of the item being rendered |
279 | 279 | * @return null |
280 | 280 | */ |
281 | - public function generateItemStyle($itemType,$index) |
|
281 | + public function generateItemStyle($itemType, $index) |
|
282 | 282 | { |
283 | 283 | return null; |
284 | 284 | } |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | * @param string item type (Header,Footer,Item,AlternatingItem,SelectedItem,EditItem,Separator,Pager) |
292 | 292 | * @param integer zero-based index of the item in the item list |
293 | 293 | */ |
294 | - public function renderItem($writer,$repeatInfo,$itemType,$index) |
|
294 | + public function renderItem($writer, $repeatInfo, $itemType, $index) |
|
295 | 295 | { |
296 | 296 | $repeatedControl=$this->_repeatedControl; |
297 | 297 | $item=$this->getItems()->itemAt($index); |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | $repeatedControl->setID("c$index"); |
303 | 303 | $repeatedControl->setText($item->getText()); |
304 | 304 | $repeatedControl->setChecked($item->getSelected()); |
305 | - $repeatedControl->setAttribute('value',$item->getValue()); |
|
305 | + $repeatedControl->setAttribute('value', $item->getValue()); |
|
306 | 306 | $repeatedControl->setEnabled($this->_isEnabled && $item->getEnabled()); |
307 | 307 | $repeatedControl->setEnableClientScript(false); |
308 | 308 | $repeatedControl->renderControl($writer); |
@@ -315,13 +315,13 @@ discard block |
||
315 | 315 | * @param array the input data collection |
316 | 316 | * @return boolean whether the data of the control has been changed |
317 | 317 | */ |
318 | - public function loadPostData($key,$values) |
|
318 | + public function loadPostData($key, $values) |
|
319 | 319 | { |
320 | 320 | if($this->getEnabled(true)) |
321 | 321 | { |
322 | - $index=(int)substr($key,strlen($this->getUniqueID())+2); |
|
322 | + $index=(int) substr($key, strlen($this->getUniqueID()) + 2); |
|
323 | 323 | $this->ensureDataBound(); |
324 | - if($index>=0 && $index<$this->getItemCount()) |
|
324 | + if($index >= 0 && $index < $this->getItemCount()) |
|
325 | 325 | { |
326 | 326 | $item=$this->getItems()->itemAt($index); |
327 | 327 | if($item->getEnabled()) |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | $this->_repeatedControl->setValidationGroup($this->getValidationGroup()); |
370 | 370 | $page=$this->getPage(); |
371 | 371 | $n=$this->getItemCount(); |
372 | - for($i=0;$i<$n;++$i) |
|
372 | + for($i=0; $i < $n; ++$i) |
|
373 | 373 | { |
374 | 374 | $this->_repeatedControl->setID("c$i"); |
375 | 375 | $page->registerRequiresPostData($this->_repeatedControl); |
@@ -381,7 +381,7 @@ discard block |
||
381 | 381 | * |
382 | 382 | *@return boolean true if we need a span |
383 | 383 | */ |
384 | - protected function getSpanNeeded () |
|
384 | + protected function getSpanNeeded() |
|
385 | 385 | { |
386 | 386 | return $this->getRepeatLayout()===TRepeatLayout::Raw; |
387 | 387 | } |
@@ -393,12 +393,12 @@ discard block |
||
393 | 393 | */ |
394 | 394 | public function render($writer) |
395 | 395 | { |
396 | - if ($needSpan=$this->getSpanNeeded()) |
|
396 | + if($needSpan=$this->getSpanNeeded()) |
|
397 | 397 | { |
398 | 398 | $writer->addAttribute('id', $this->getClientId()); |
399 | 399 | $writer->renderBeginTag('span'); |
400 | 400 | } |
401 | - if($this->getItemCount()>0) |
|
401 | + if($this->getItemCount() > 0) |
|
402 | 402 | { |
403 | 403 | $this->_isEnabled=$this->getEnabled(true); |
404 | 404 | $repeatInfo=$this->getRepeatInfo(); |
@@ -410,11 +410,11 @@ discard block |
||
410 | 410 | $this->setAccessKey(''); |
411 | 411 | $this->setTabIndex(0); |
412 | 412 | $this->addAttributesToRender($writer); |
413 | - $repeatInfo->renderRepeater($writer,$this); |
|
413 | + $repeatInfo->renderRepeater($writer, $this); |
|
414 | 414 | $this->setAccessKey($accessKey); |
415 | 415 | $this->setTabIndex($tabIndex); |
416 | 416 | } |
417 | - if ($needSpan) |
|
417 | + if($needSpan) |
|
418 | 418 | $writer->renderEndTag(); |
419 | 419 | |
420 | 420 | //checkbox skipped the client control script in addAttributesToRender |
@@ -480,11 +480,11 @@ discard block |
||
480 | 480 | */ |
481 | 481 | protected function getPostBackOptions() |
482 | 482 | { |
483 | - $options['ID'] = $this->getClientID(); |
|
484 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
485 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
486 | - $options['ListName'] = $this->getUniqueID(); |
|
487 | - $options['ItemCount'] = $this->getItemCount(); |
|
483 | + $options['ID']=$this->getClientID(); |
|
484 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
485 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
486 | + $options['ListName']=$this->getUniqueID(); |
|
487 | + $options['ItemCount']=$this->getItemCount(); |
|
488 | 488 | return $options; |
489 | 489 | } |
490 | 490 |
@@ -29,82 +29,82 @@ |
||
29 | 29 | |
30 | 30 | class TReCaptcha2Validator extends TBaseValidator |
31 | 31 | { |
32 | - protected $_isvalid = null; |
|
32 | + protected $_isvalid = null; |
|
33 | 33 | |
34 | - protected function getClientClassName() |
|
35 | - { |
|
36 | - return 'Prado.WebUI.TReCaptcha2Validator'; |
|
37 | - } |
|
38 | - public function getEnableClientScript() |
|
39 | - { |
|
40 | - return true; |
|
41 | - } |
|
42 | - protected function getCaptchaControl() |
|
43 | - { |
|
44 | - $control = $this->getValidationTarget(); |
|
45 | - if (!$control) |
|
46 | - throw new Exception('No target control specified for TReCaptcha2Validator'); |
|
47 | - if (!($control instanceof TReCaptcha2)) |
|
48 | - throw new Exception('TReCaptcha2Validator only works with TReCaptcha2 controls'); |
|
49 | - return $control; |
|
50 | - } |
|
51 | - public function getClientScriptOptions() |
|
52 | - { |
|
53 | - $options = parent::getClientScriptOptions(); |
|
54 | - $options['ResponseFieldName'] = $this->getCaptchaControl()->getResponseFieldName(); |
|
55 | - return $options; |
|
56 | - } |
|
57 | - /** |
|
58 | - * This method overrides the parent's implementation. |
|
59 | - * The validation succeeds if the input control has the same value |
|
60 | - * as the one displayed in the corresponding RECAPTCHA control. |
|
61 | - * |
|
62 | - * @return boolean whether the validation succeeds |
|
63 | - */ |
|
64 | - protected function evaluateIsValid() |
|
65 | - { |
|
66 | - // check validity only once (if trying to evaulate multiple times, all redundant checks would fail) |
|
67 | - if (is_null($this->_isvalid)) |
|
68 | - { |
|
69 | - $control = $this->getCaptchaControl(); |
|
70 | - $this->_isvalid = $control->validate(); |
|
71 | - } |
|
72 | - return ($this->_isvalid==true); |
|
73 | - } |
|
74 | - public function onPreRender($param) |
|
75 | - { |
|
76 | - parent::onPreRender($param); |
|
34 | + protected function getClientClassName() |
|
35 | + { |
|
36 | + return 'Prado.WebUI.TReCaptcha2Validator'; |
|
37 | + } |
|
38 | + public function getEnableClientScript() |
|
39 | + { |
|
40 | + return true; |
|
41 | + } |
|
42 | + protected function getCaptchaControl() |
|
43 | + { |
|
44 | + $control = $this->getValidationTarget(); |
|
45 | + if (!$control) |
|
46 | + throw new Exception('No target control specified for TReCaptcha2Validator'); |
|
47 | + if (!($control instanceof TReCaptcha2)) |
|
48 | + throw new Exception('TReCaptcha2Validator only works with TReCaptcha2 controls'); |
|
49 | + return $control; |
|
50 | + } |
|
51 | + public function getClientScriptOptions() |
|
52 | + { |
|
53 | + $options = parent::getClientScriptOptions(); |
|
54 | + $options['ResponseFieldName'] = $this->getCaptchaControl()->getResponseFieldName(); |
|
55 | + return $options; |
|
56 | + } |
|
57 | + /** |
|
58 | + * This method overrides the parent's implementation. |
|
59 | + * The validation succeeds if the input control has the same value |
|
60 | + * as the one displayed in the corresponding RECAPTCHA control. |
|
61 | + * |
|
62 | + * @return boolean whether the validation succeeds |
|
63 | + */ |
|
64 | + protected function evaluateIsValid() |
|
65 | + { |
|
66 | + // check validity only once (if trying to evaulate multiple times, all redundant checks would fail) |
|
67 | + if (is_null($this->_isvalid)) |
|
68 | + { |
|
69 | + $control = $this->getCaptchaControl(); |
|
70 | + $this->_isvalid = $control->validate(); |
|
71 | + } |
|
72 | + return ($this->_isvalid==true); |
|
73 | + } |
|
74 | + public function onPreRender($param) |
|
75 | + { |
|
76 | + parent::onPreRender($param); |
|
77 | 77 | |
78 | - $cs = $this->Page->getClientScript(); |
|
79 | - $cs->registerPradoScript('validator'); |
|
78 | + $cs = $this->Page->getClientScript(); |
|
79 | + $cs->registerPradoScript('validator'); |
|
80 | 80 | |
81 | - // communicate validation status to the client side |
|
82 | - $value = $this->_isvalid===false ? '0' : '1'; |
|
83 | - $cs->registerHiddenField($this->getClientID().'_1',$value); |
|
81 | + // communicate validation status to the client side |
|
82 | + $value = $this->_isvalid===false ? '0' : '1'; |
|
83 | + $cs->registerHiddenField($this->getClientID().'_1',$value); |
|
84 | 84 | |
85 | - // update validator display |
|
86 | - if ($control = $this->getValidationTarget()) |
|
87 | - { |
|
88 | - $fn = 'captchaUpdateValidatorStatus_'.$this->getClientID(); |
|
85 | + // update validator display |
|
86 | + if ($control = $this->getValidationTarget()) |
|
87 | + { |
|
88 | + $fn = 'captchaUpdateValidatorStatus_'.$this->getClientID(); |
|
89 | 89 | |
90 | - $cs->registerEndScript($this->getClientID().'::validate', implode(' ',array( |
|
91 | - // this function will be used to update the validator |
|
92 | - 'function '.$fn.'(valid)', |
|
93 | - '{', |
|
94 | - ' jQuery('.TJavaScript::quoteString('#'.$this->getClientID().'_1').').val(valid);', |
|
95 | - ' Prado.Validation.validateControl('.TJavaScript::quoteString($control->ClientID).'); ', |
|
96 | - '}', |
|
97 | - '', |
|
98 | - // update the validator to the result if we're in a callback |
|
99 | - // (if we're in initial rendering or a postback then the result will be rendered directly to the page html anyway) |
|
100 | - $this->Page->IsCallback ? $fn.'('.$value.');' : '', |
|
101 | - '', |
|
102 | - // install event handler that clears the validation error when user changes the captcha response field |
|
103 | - 'jQuery("#'.$control->getClientID().'").on("change", '.TJavaScript::quoteString('#'.$control->getResponseFieldName()).', function() { ', |
|
104 | - $fn.'("1");', |
|
105 | - '});', |
|
106 | - ))); |
|
107 | - } |
|
108 | - } |
|
90 | + $cs->registerEndScript($this->getClientID().'::validate', implode(' ',array( |
|
91 | + // this function will be used to update the validator |
|
92 | + 'function '.$fn.'(valid)', |
|
93 | + '{', |
|
94 | + ' jQuery('.TJavaScript::quoteString('#'.$this->getClientID().'_1').').val(valid);', |
|
95 | + ' Prado.Validation.validateControl('.TJavaScript::quoteString($control->ClientID).'); ', |
|
96 | + '}', |
|
97 | + '', |
|
98 | + // update the validator to the result if we're in a callback |
|
99 | + // (if we're in initial rendering or a postback then the result will be rendered directly to the page html anyway) |
|
100 | + $this->Page->IsCallback ? $fn.'('.$value.');' : '', |
|
101 | + '', |
|
102 | + // install event handler that clears the validation error when user changes the captcha response field |
|
103 | + 'jQuery("#'.$control->getClientID().'").on("change", '.TJavaScript::quoteString('#'.$control->getResponseFieldName()).', function() { ', |
|
104 | + $fn.'("1");', |
|
105 | + '});', |
|
106 | + ))); |
|
107 | + } |
|
108 | + } |
|
109 | 109 | } |
110 | 110 |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | |
30 | 30 | class TReCaptcha2Validator extends TBaseValidator |
31 | 31 | { |
32 | - protected $_isvalid = null; |
|
32 | + protected $_isvalid=null; |
|
33 | 33 | |
34 | 34 | protected function getClientClassName() |
35 | 35 | { |
@@ -41,17 +41,17 @@ discard block |
||
41 | 41 | } |
42 | 42 | protected function getCaptchaControl() |
43 | 43 | { |
44 | - $control = $this->getValidationTarget(); |
|
45 | - if (!$control) |
|
44 | + $control=$this->getValidationTarget(); |
|
45 | + if(!$control) |
|
46 | 46 | throw new Exception('No target control specified for TReCaptcha2Validator'); |
47 | - if (!($control instanceof TReCaptcha2)) |
|
47 | + if(!($control instanceof TReCaptcha2)) |
|
48 | 48 | throw new Exception('TReCaptcha2Validator only works with TReCaptcha2 controls'); |
49 | 49 | return $control; |
50 | 50 | } |
51 | 51 | public function getClientScriptOptions() |
52 | 52 | { |
53 | - $options = parent::getClientScriptOptions(); |
|
54 | - $options['ResponseFieldName'] = $this->getCaptchaControl()->getResponseFieldName(); |
|
53 | + $options=parent::getClientScriptOptions(); |
|
54 | + $options['ResponseFieldName']=$this->getCaptchaControl()->getResponseFieldName(); |
|
55 | 55 | return $options; |
56 | 56 | } |
57 | 57 | /** |
@@ -64,10 +64,10 @@ discard block |
||
64 | 64 | protected function evaluateIsValid() |
65 | 65 | { |
66 | 66 | // check validity only once (if trying to evaulate multiple times, all redundant checks would fail) |
67 | - if (is_null($this->_isvalid)) |
|
67 | + if(is_null($this->_isvalid)) |
|
68 | 68 | { |
69 | - $control = $this->getCaptchaControl(); |
|
70 | - $this->_isvalid = $control->validate(); |
|
69 | + $control=$this->getCaptchaControl(); |
|
70 | + $this->_isvalid=$control->validate(); |
|
71 | 71 | } |
72 | 72 | return ($this->_isvalid==true); |
73 | 73 | } |
@@ -75,19 +75,19 @@ discard block |
||
75 | 75 | { |
76 | 76 | parent::onPreRender($param); |
77 | 77 | |
78 | - $cs = $this->Page->getClientScript(); |
|
78 | + $cs=$this->Page->getClientScript(); |
|
79 | 79 | $cs->registerPradoScript('validator'); |
80 | 80 | |
81 | 81 | // communicate validation status to the client side |
82 | - $value = $this->_isvalid===false ? '0' : '1'; |
|
83 | - $cs->registerHiddenField($this->getClientID().'_1',$value); |
|
82 | + $value=$this->_isvalid===false ? '0' : '1'; |
|
83 | + $cs->registerHiddenField($this->getClientID().'_1', $value); |
|
84 | 84 | |
85 | 85 | // update validator display |
86 | - if ($control = $this->getValidationTarget()) |
|
86 | + if($control=$this->getValidationTarget()) |
|
87 | 87 | { |
88 | - $fn = 'captchaUpdateValidatorStatus_'.$this->getClientID(); |
|
88 | + $fn='captchaUpdateValidatorStatus_'.$this->getClientID(); |
|
89 | 89 | |
90 | - $cs->registerEndScript($this->getClientID().'::validate', implode(' ',array( |
|
90 | + $cs->registerEndScript($this->getClientID().'::validate', implode(' ', array( |
|
91 | 91 | // this function will be used to update the validator |
92 | 92 | 'function '.$fn.'(valid)', |
93 | 93 | '{', |