@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function getPattern() |
79 | 79 | { |
80 | - return $this->getViewState('Pattern',''); |
|
80 | + return $this->getViewState('Pattern', ''); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function setPattern($pattern) |
88 | 88 | { |
89 | - $this->setViewState('Pattern',$pattern,''); |
|
89 | + $this->setViewState('Pattern', $pattern, ''); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function getValue() |
97 | 97 | { |
98 | - return $this->getViewState('Value',''); |
|
98 | + return $this->getViewState('Value', ''); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function setValue($value) |
106 | 106 | { |
107 | - $this->setViewState('Value',$value,''); |
|
107 | + $this->setViewState('Value', $value, ''); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | */ |
114 | 114 | public function getDefaultText() |
115 | 115 | { |
116 | - return $this->getViewState('DefaultText',''); |
|
116 | + return $this->getViewState('DefaultText', ''); |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | /** |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | */ |
123 | 123 | public function setDefaultText($value) |
124 | 124 | { |
125 | - $this->setViewState('DefaultText',$value,''); |
|
125 | + $this->setViewState('DefaultText', $value, ''); |
|
126 | 126 | } |
127 | 127 | |
128 | 128 | /** |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function getType() |
159 | 159 | { |
160 | - return $this->getViewState('Type','d'); |
|
160 | + return $this->getViewState('Type', 'd'); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -168,20 +168,20 @@ discard block |
||
168 | 168 | */ |
169 | 169 | public function setType($type) |
170 | 170 | { |
171 | - $type = strtolower($type); |
|
171 | + $type=strtolower($type); |
|
172 | 172 | |
173 | 173 | switch($type) |
174 | 174 | { |
175 | 175 | case 'decimal': |
176 | - $this->setViewState('Type','d',''); break; |
|
176 | + $this->setViewState('Type', 'd', ''); break; |
|
177 | 177 | case 'currency': |
178 | - $this->setViewState('Type','c',''); break; |
|
178 | + $this->setViewState('Type', 'c', ''); break; |
|
179 | 179 | case 'percentage': |
180 | - $this->setViewState('Type','p',''); break; |
|
180 | + $this->setViewState('Type', 'p', ''); break; |
|
181 | 181 | case 'scientific': |
182 | - $this->setViewState('Type','e',''); break; |
|
182 | + $this->setViewState('Type', 'e', ''); break; |
|
183 | 183 | default: |
184 | - throw new TInvalidDataValueException('numberformat_type_invalid',$type); |
|
184 | + throw new TInvalidDataValueException('numberformat_type_invalid', $type); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function getCurrency() |
193 | 193 | { |
194 | - return $this->getViewState('Currency','USD'); |
|
194 | + return $this->getViewState('Currency', 'USD'); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | /** |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function setCurrency($currency) |
203 | 203 | { |
204 | - $this->setViewState('Currency', $currency,''); |
|
204 | + $this->setViewState('Currency', $currency, ''); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -212,31 +212,31 @@ discard block |
||
212 | 212 | */ |
213 | 213 | protected function getFormattedValue() |
214 | 214 | { |
215 | - $value = $this->getValue(); |
|
216 | - $defaultText = $this->getDefaultText(); |
|
215 | + $value=$this->getValue(); |
|
216 | + $defaultText=$this->getDefaultText(); |
|
217 | 217 | if(empty($value) && !empty($defaultText)) |
218 | 218 | return $this->getDefaultText(); |
219 | 219 | |
220 | - $app = $this->getApplication()->getGlobalization(); |
|
220 | + $app=$this->getApplication()->getGlobalization(); |
|
221 | 221 | //initialized the default class wide formatter |
222 | 222 | if(self::$formatter===null) |
223 | - self::$formatter = new NumberFormat($app->getCulture()); |
|
223 | + self::$formatter=new NumberFormat($app->getCulture()); |
|
224 | 224 | |
225 | - $pattern = strlen($this->getPattern()) > 0 |
|
225 | + $pattern=strlen($this->getPattern()) > 0 |
|
226 | 226 | ? $this->getPattern() : $this->getType(); |
227 | 227 | |
228 | - $culture = $this->getCulture(); |
|
228 | + $culture=$this->getCulture(); |
|
229 | 229 | //return the specific cultural formatted number |
230 | - if(!empty($culture) && $app->getCulture() != $culture) |
|
230 | + if(!empty($culture) && $app->getCulture()!=$culture) |
|
231 | 231 | { |
232 | - $formatter = new NumberFormat($culture); |
|
233 | - return $formatter->format($this->getValue(),$pattern, |
|
232 | + $formatter=new NumberFormat($culture); |
|
233 | + return $formatter->format($this->getValue(), $pattern, |
|
234 | 234 | $this->getCurrency(), |
235 | 235 | $this->getCharset()); |
236 | 236 | } |
237 | 237 | |
238 | 238 | //return the application wide culture formatted number. |
239 | - return self::$formatter->format($this->getValue(),$pattern, |
|
239 | + return self::$formatter->format($this->getValue(), $pattern, |
|
240 | 240 | $this->getCurrency(), |
241 | 241 | $this->getCharset()); |
242 | 242 | } |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function setText($value) |
89 | 89 | { |
90 | - if(parent::getText() === $value) |
|
90 | + if(parent::getText()===$value) |
|
91 | 91 | return; |
92 | 92 | |
93 | 93 | parent::setText($value); |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | */ |
105 | 105 | public function setChecked($value) |
106 | 106 | { |
107 | - $value = TPropertyValue::ensureBoolean($value); |
|
108 | - if(parent::getChecked() === $value) |
|
107 | + $value=TPropertyValue::ensureBoolean($value); |
|
108 | + if(parent::getChecked()===$value) |
|
109 | 109 | return; |
110 | 110 | |
111 | 111 | parent::setChecked($value); |
@@ -127,10 +127,10 @@ discard block |
||
127 | 127 | * Since 3.1.4, the javascript code is not rendered if {@link setAutoPostBack AutoPostBack} is false |
128 | 128 | * |
129 | 129 | */ |
130 | - protected function renderInputTag($writer,$clientID,$onclick) |
|
130 | + protected function renderInputTag($writer, $clientID, $onclick) |
|
131 | 131 | { |
132 | - parent::renderInputTag($writer,$clientID,$onclick); |
|
133 | - if ($this->getAutoPostBack()) |
|
132 | + parent::renderInputTag($writer, $clientID, $onclick); |
|
133 | + if($this->getAutoPostBack()) |
|
134 | 134 | $this->getActiveControl()->registerCallbackClientScript( |
135 | 135 | $this->getClientClassName(), $this->getPostBackOptions()); |
136 | 136 | } |
@@ -149,8 +149,8 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function getLabelAttributes() |
151 | 151 | { |
152 | - $attributes = parent::getLabelAttributes(); |
|
153 | - $attributes['id'] = $this->getDefaultLabelID(); |
|
152 | + $attributes=parent::getLabelAttributes(); |
|
153 | + $attributes['id']=$this->getDefaultLabelID(); |
|
154 | 154 | return $attributes; |
155 | 155 | } |
156 | 156 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @param string radio button id |
161 | 161 | * @param string label text |
162 | 162 | */ |
163 | - protected function renderLabel($writer,$clientID,$text) |
|
163 | + protected function renderLabel($writer, $clientID, $text) |
|
164 | 164 | { |
165 | 165 | $writer->addAttribute('id', $this->getDefaultLabelID()); |
166 | 166 | parent::renderLabel($writer, $clientID, $text); |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | */ |
172 | 172 | protected function getDefaultLabelID() |
173 | 173 | { |
174 | - if($attributes=$this->getViewState('LabelAttributes',null)) |
|
174 | + if($attributes=$this->getViewState('LabelAttributes', null)) |
|
175 | 175 | return $this->getLabelAttributes()->itemAt('id'); |
176 | 176 | else |
177 | 177 | return $this->getClientID().'_label'; |
@@ -80,12 +80,12 @@ discard block |
||
80 | 80 | */ |
81 | 81 | public function setReadOnly($value) |
82 | 82 | { |
83 | - if(parent::getReadOnly() === $value) |
|
83 | + if(parent::getReadOnly()===$value) |
|
84 | 84 | return; |
85 | 85 | |
86 | 86 | parent::setReadOnly($value); |
87 | - $value = $this->getReadOnly(); |
|
88 | - $this->callClientFunction('setReadOnly',$value); |
|
87 | + $value=$this->getReadOnly(); |
|
88 | + $this->callClientFunction('setReadOnly', $value); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -93,12 +93,12 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function setRating($value) |
95 | 95 | { |
96 | - if(parent::getRating() === $value) |
|
96 | + if(parent::getRating()===$value) |
|
97 | 97 | return; |
98 | 98 | |
99 | 99 | parent::setRating($value); |
100 | - $value = $this->getRating(); |
|
101 | - $this->callClientFunction('setRating',$value); |
|
100 | + $value=$this->getRating(); |
|
101 | + $this->callClientFunction('setRating', $value); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -106,13 +106,13 @@ discard block |
||
106 | 106 | * @param string static method name |
107 | 107 | * @param mixed method parmaeter |
108 | 108 | */ |
109 | - protected function callClientFunction($func,$value) |
|
109 | + protected function callClientFunction($func, $value) |
|
110 | 110 | { |
111 | 111 | if($this->getActiveControl()->canUpdateClientSide()) |
112 | 112 | { |
113 | - $client = $this->getPage()->getCallbackClient(); |
|
114 | - $code = 'Prado.Registry[\''.$this->ClientID.'\'].'.$func.'('.$value.')'; |
|
115 | - $client->evaluateScript($code,array($value)); |
|
113 | + $client=$this->getPage()->getCallbackClient(); |
|
114 | + $code='Prado.Registry[\''.$this->ClientID.'\'].'.$func.'('.$value.')'; |
|
115 | + $client->evaluateScript($code, array($value)); |
|
116 | 116 | } |
117 | 117 | } |
118 | 118 | |
@@ -121,12 +121,12 @@ discard block |
||
121 | 121 | */ |
122 | 122 | public function setCaption($value) |
123 | 123 | { |
124 | - if(parent::getCaption() === $value) |
|
124 | + if(parent::getCaption()===$value) |
|
125 | 125 | return; |
126 | 126 | |
127 | 127 | parent::setCaption($value); |
128 | 128 | // if it's an active control, this should not be needed. |
129 | - $this->callClientFunction('setCaption',$value); |
|
129 | + $this->callClientFunction('setCaption', $value); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function setText($value) |
64 | 64 | { |
65 | - if(parent::getText() === $value) |
|
65 | + if(parent::getText()===$value) |
|
66 | 66 | return; |
67 | 67 | |
68 | 68 | 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 | $this->getActiveControl()->registerCallbackClientScript( |
123 | 123 | $this->getClientClassName(), $this->getPostBackOptions()); |
124 | 124 | } |
@@ -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 | } |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function setValue($value) |
57 | 57 | { |
58 | - if(parent::getValue() === $value) |
|
58 | + if(parent::getValue()===$value) |
|
59 | 59 | return; |
60 | 60 | |
61 | 61 | parent::setValue($value); |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | protected function addAttributesToRender($writer) |
112 | 112 | { |
113 | 113 | parent::addAttributesToRender($writer); |
114 | - $writer->addAttribute('id',$this->getClientID()); |
|
114 | + $writer->addAttribute('id', $this->getClientID()); |
|
115 | 115 | $this->getActiveControl()->registerCallbackClientScript( |
116 | 116 | $this->getClientClassName(), $this->getPostBackOptions()); |
117 | 117 | } |
@@ -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); |