@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | public function addParsedObject($object) |
44 | 44 | { |
45 | 45 | if(is_string($object)) |
46 | - $object=html_entity_decode($object,ENT_QUOTES,'UTF-8'); |
|
46 | + $object=html_entity_decode($object, ENT_QUOTES, 'UTF-8'); |
|
47 | 47 | parent::addParsedObject($object); |
48 | 48 | } |
49 | 49 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function getText() |
54 | 54 | { |
55 | - return $this->getViewState('Text',''); |
|
55 | + return $this->getViewState('Text', ''); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function setText($value) |
62 | 62 | { |
63 | - $this->setViewState('Text',$value); |
|
63 | + $this->setViewState('Text', $value); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | { |
74 | 74 | if(($text=$this->getText())==='' && $this->getHasControls()) |
75 | 75 | { |
76 | - $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
76 | + $htmlWriter=Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
77 | 77 | parent::renderContents($htmlWriter); |
78 | 78 | $text=$htmlWriter->flush(); |
79 | 79 | } |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | class TColorPicker extends TTextBox |
39 | 39 | { |
40 | - const SCRIPT_PATH = 'prado/colorpicker'; |
|
40 | + const SCRIPT_PATH='prado/colorpicker'; |
|
41 | 41 | |
42 | 42 | private $_clientSide; |
43 | 43 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | */ |
47 | 47 | public function getShowColorPicker() |
48 | 48 | { |
49 | - return $this->getViewState('ShowColorPicker',true); |
|
49 | + return $this->getViewState('ShowColorPicker', true); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | */ |
56 | 56 | public function setShowColorPicker($value) |
57 | 57 | { |
58 | - $this->setViewState('ShowColorPicker',TPropertyValue::ensureBoolean($value),true); |
|
58 | + $this->setViewState('ShowColorPicker', TPropertyValue::ensureBoolean($value), true); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | public function getClientSide() |
129 | 129 | { |
130 | 130 | if($this->_clientSide===null) |
131 | - $this->_clientSide = $this->createClientSide(); |
|
131 | + $this->_clientSide=$this->createClientSide(); |
|
132 | 132 | return $this->_clientSide; |
133 | 133 | } |
134 | 134 | |
@@ -146,18 +146,18 @@ discard block |
||
146 | 146 | */ |
147 | 147 | protected function getPostBackOptions() |
148 | 148 | { |
149 | - $options = parent::getPostBackOptions(); |
|
150 | - $options['ClassName'] = $this->getCssClass(); |
|
151 | - $options['ShowColorPicker'] = $this->getShowColorPicker(); |
|
149 | + $options=parent::getPostBackOptions(); |
|
150 | + $options['ClassName']=$this->getCssClass(); |
|
151 | + $options['ShowColorPicker']=$this->getShowColorPicker(); |
|
152 | 152 | if($options['ShowColorPicker']) |
153 | 153 | { |
154 | - $mode = $this->getMode(); |
|
155 | - if($mode == TColorPickerMode::Full) $options['Mode'] = $mode; |
|
156 | - else if($mode == TColorPickerMode::Simple) $options['Palette'] = 'Tiny'; |
|
157 | - $options['OKButtonText'] = $this->getOKButtonText(); |
|
158 | - $options['CancelButtonText'] = $this->getCancelButtonText(); |
|
154 | + $mode=$this->getMode(); |
|
155 | + if($mode==TColorPickerMode::Full) $options['Mode']=$mode; |
|
156 | + else if($mode==TColorPickerMode::Simple) $options['Palette']='Tiny'; |
|
157 | + $options['OKButtonText']=$this->getOKButtonText(); |
|
158 | + $options['CancelButtonText']=$this->getCancelButtonText(); |
|
159 | 159 | } |
160 | - $options = array_merge($options,$this->getClientSide()->getOptions()->toArray()); |
|
160 | + $options=array_merge($options, $this->getClientSide()->getOptions()->toArray()); |
|
161 | 161 | return $options; |
162 | 162 | } |
163 | 163 | |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | protected function getAssetUrl($file='') |
169 | 169 | { |
170 | - $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
170 | + $base=$this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
171 | 171 | return $base.'/'.self::SCRIPT_PATH.'/'.$file; |
172 | 172 | } |
173 | 173 | |
@@ -185,15 +185,15 @@ discard block |
||
185 | 185 | */ |
186 | 186 | protected function publishColorPickerAssets() |
187 | 187 | { |
188 | - $cs = $this->getPage()->getClientScript(); |
|
189 | - $key = "prado:".get_class($this); |
|
190 | - $imgs['button.gif'] = $this->getAssetUrl('button.gif'); |
|
191 | - $imgs['background.png'] = $this->getAssetUrl('background.png'); |
|
192 | - $options = TJavaScript::encode($imgs); |
|
193 | - $code = "Prado.WebUI.TColorPicker.UIImages = {$options};"; |
|
188 | + $cs=$this->getPage()->getClientScript(); |
|
189 | + $key="prado:".get_class($this); |
|
190 | + $imgs['button.gif']=$this->getAssetUrl('button.gif'); |
|
191 | + $imgs['background.png']=$this->getAssetUrl('background.png'); |
|
192 | + $options=TJavaScript::encode($imgs); |
|
193 | + $code="Prado.WebUI.TColorPicker.UIImages = {$options};"; |
|
194 | 194 | $cs->registerEndScript($key, $code); |
195 | 195 | $cs->registerPradoScript("colorpicker"); |
196 | - $url = $this->getAssetUrl($this->getColorPickerStyle().'.css'); |
|
196 | + $url=$this->getAssetUrl($this->getColorPickerStyle().'.css'); |
|
197 | 197 | if(!$cs->isStyleSheetFileRegistered($url)) |
198 | 198 | $cs->registerStyleSheetFile($url, $url); |
199 | 199 | } |
@@ -208,13 +208,13 @@ discard block |
||
208 | 208 | { |
209 | 209 | parent::renderEndTag($writer); |
210 | 210 | |
211 | - $color = $this->getText(); |
|
211 | + $color=$this->getText(); |
|
212 | 212 | $writer->addAttribute('class', 'TColorPicker_button'); |
213 | 213 | $writer->renderBeginTag('span'); |
214 | 214 | |
215 | 215 | $writer->addAttribute('id', $this->getClientID().'_button'); |
216 | 216 | $writer->addAttribute('src', $this->getAssetUrl('button.gif')); |
217 | - if($color !== '') |
|
217 | + if($color!=='') |
|
218 | 218 | $writer->addAttribute('style', "background-color:{$color};"); |
219 | 219 | $writer->addAttribute('width', '20'); |
220 | 220 | $writer->addAttribute('height', '20'); |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | { |
43 | 43 | parent::addAttributesToRender($writer); |
44 | 44 | if(($scope=$this->getScope())!==TTableHeaderScope::NotSet) |
45 | - $writer->addAttribute('scope',$scope===TTableHeaderScope::Row?'row':'col'); |
|
45 | + $writer->addAttribute('scope', $scope===TTableHeaderScope::Row ? 'row' : 'col'); |
|
46 | 46 | if(($text=$this->getAbbreviatedText())!=='') |
47 | - $writer->addAttribute('abbr',$text); |
|
47 | + $writer->addAttribute('abbr', $text); |
|
48 | 48 | if(($text=$this->getCategoryText())!=='') |
49 | - $writer->addAttribute('axis',$text); |
|
49 | + $writer->addAttribute('axis', $text); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function getScope() |
56 | 56 | { |
57 | - return $this->getViewState('Scope',TTableHeaderScope::NotSet); |
|
57 | + return $this->getViewState('Scope', TTableHeaderScope::NotSet); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function setScope($value) |
64 | 64 | { |
65 | - $this->setViewState('Scope',TPropertyValue::ensureEnum($value,'TTableHeaderScope'),TTableHeaderScope::NotSet); |
|
65 | + $this->setViewState('Scope', TPropertyValue::ensureEnum($value, 'TTableHeaderScope'), TTableHeaderScope::NotSet); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function getAbbreviatedText() |
72 | 72 | { |
73 | - return $this->getViewState('AbbreviatedText',''); |
|
73 | + return $this->getViewState('AbbreviatedText', ''); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function setAbbreviatedText($value) |
80 | 80 | { |
81 | - $this->setViewState('AbbreviatedText',$value,''); |
|
81 | + $this->setViewState('AbbreviatedText', $value, ''); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function getCategoryText() |
88 | 88 | { |
89 | - return $this->getViewState('CategoryText',''); |
|
89 | + return $this->getViewState('CategoryText', ''); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | public function setCategoryText($value) |
96 | 96 | { |
97 | - $this->setViewState('CategoryText',$value,''); |
|
97 | + $this->setViewState('CategoryText', $value, ''); |
|
98 | 98 | } |
99 | 99 | } |
100 | 100 |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @var boolean tells if the decoration uses state in its templates. If there are no templates |
66 | 66 | * in the instance of the decoration this variable is unused. |
67 | 67 | */ |
68 | - private $_usestate = false; |
|
68 | + private $_usestate=false; |
|
69 | 69 | |
70 | 70 | /** |
71 | 71 | * @var TWebControl the control to decorate |
@@ -86,19 +86,19 @@ discard block |
||
86 | 86 | /** |
87 | 87 | * @var string the text that goes before the open tag |
88 | 88 | */ |
89 | - private $_pretagtext = ''; |
|
89 | + private $_pretagtext=''; |
|
90 | 90 | /** |
91 | 91 | * @var string the text that goes after the open tag |
92 | 92 | */ |
93 | - private $_precontentstext = ''; |
|
93 | + private $_precontentstext=''; |
|
94 | 94 | /** |
95 | 95 | * @var string the text that goes before the close tag |
96 | 96 | */ |
97 | - private $_postcontentstext = ''; |
|
97 | + private $_postcontentstext=''; |
|
98 | 98 | /** |
99 | 99 | * @var string the text that goes after the close tag |
100 | 100 | */ |
101 | - private $_posttagtext = ''; |
|
101 | + private $_posttagtext=''; |
|
102 | 102 | |
103 | 103 | |
104 | 104 | |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | * @param TWebControl The control that is to be decorated. |
126 | 126 | * @param boolean whether decoration is just around the inner content |
127 | 127 | */ |
128 | - public function __construct($control, $onlyinternal = false) { |
|
129 | - $this->_control = $control; |
|
130 | - $this->_internalonly = $onlyinternal; |
|
128 | + public function __construct($control, $onlyinternal=false) { |
|
129 | + $this->_control=$control; |
|
130 | + $this->_internalonly=$onlyinternal; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | */ |
145 | 145 | public function setUseState($value) |
146 | 146 | { |
147 | - $this->_usestate = TPropertyValue::ensureBoolean($value); |
|
147 | + $this->_usestate=TPropertyValue::ensureBoolean($value); |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function setPreTagText($value) { |
161 | 161 | if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
162 | - $this->_pretagtext = TPropertyValue::ensureString($value); |
|
162 | + $this->_pretagtext=TPropertyValue::ensureString($value); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function setPreContentsText($value) { |
177 | 177 | if(!$this->_control->getIsSkinApplied()) |
178 | - $this->_precontentstext = TPropertyValue::ensureString($value); |
|
178 | + $this->_precontentstext=TPropertyValue::ensureString($value); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public function setPostContentsText($value) { |
193 | 193 | if(!$this->_control->getIsSkinApplied()) |
194 | - $this->_postcontentstext = TPropertyValue::ensureString($value); |
|
194 | + $this->_postcontentstext=TPropertyValue::ensureString($value); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | */ |
208 | 208 | public function setPostTagText($value) { |
209 | 209 | if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
210 | - $this->_posttagtext = TPropertyValue::ensureString($value); |
|
210 | + $this->_posttagtext=TPropertyValue::ensureString($value); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function setPreTagTemplate($value) { |
225 | 225 | if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
226 | - $this->_pretagtemplate = $value; |
|
226 | + $this->_pretagtemplate=$value; |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | |
@@ -239,7 +239,7 @@ discard block |
||
239 | 239 | */ |
240 | 240 | public function setPreContentsTemplate($value) { |
241 | 241 | if(!$this->_control->getIsSkinApplied()) |
242 | - $this->_precontentstemplate = $value; |
|
242 | + $this->_precontentstemplate=$value; |
|
243 | 243 | } |
244 | 244 | |
245 | 245 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | */ |
256 | 256 | public function setPostContentsTemplate($value) { |
257 | 257 | if(!$this->_control->getIsSkinApplied()) |
258 | - $this->_postcontentstemplate = $value; |
|
258 | + $this->_postcontentstemplate=$value; |
|
259 | 259 | } |
260 | 260 | |
261 | 261 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | */ |
272 | 272 | public function setPostTagTemplate($value) { |
273 | 273 | if(!$this->_internalonly && !$this->_control->getIsSkinApplied()) |
274 | - $this->_posttagtemplate = $value; |
|
274 | + $this->_posttagtemplate=$value; |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | /** |
@@ -280,15 +280,15 @@ discard block |
||
280 | 280 | * This call attaches the ensureTemplateDecoration to the TPage onSaveStateComplete so |
281 | 281 | * these controls don't have page states. This is as close to not influencing the page as possible. |
282 | 282 | */ |
283 | - public function instantiate($outercontrol = null) { |
|
283 | + public function instantiate($outercontrol=null) { |
|
284 | 284 | if($this->getPreTagTemplate() || $this->getPreContentsTemplate() || |
285 | 285 | $this->getPostContentsTemplate() || $this->getPostTagTemplate()) { |
286 | 286 | |
287 | - $this->_outercontrol = $outercontrol; |
|
287 | + $this->_outercontrol=$outercontrol; |
|
288 | 288 | if($this->getUseState()) |
289 | 289 | $this->ensureTemplateDecoration(); |
290 | 290 | else |
291 | - $this->_control->getPage()->onSaveStateComplete[] = array($this, 'ensureTemplateDecoration'); |
|
291 | + $this->_control->getPage()->onSaveStateComplete[]=array($this, 'ensureTemplateDecoration'); |
|
292 | 292 | } |
293 | 293 | } |
294 | 294 | |
@@ -303,26 +303,26 @@ discard block |
||
303 | 303 | */ |
304 | 304 | public function ensureTemplateDecoration($sender=null, $param=null) { |
305 | 305 | |
306 | - $control = $this->_control; |
|
307 | - $outercontrol = $this->_outercontrol; |
|
308 | - if($outercontrol === null) |
|
309 | - $outercontrol = $control; |
|
306 | + $control=$this->_control; |
|
307 | + $outercontrol=$this->_outercontrol; |
|
308 | + if($outercontrol===null) |
|
309 | + $outercontrol=$control; |
|
310 | 310 | |
311 | 311 | if($this->_addedTemplateDecoration) |
312 | 312 | return $this->_addedTemplateDecoration; |
313 | 313 | |
314 | - $this->_addedTemplateDecoration = true; |
|
314 | + $this->_addedTemplateDecoration=true; |
|
315 | 315 | |
316 | 316 | if($this->getPreContentsTemplate()) |
317 | 317 | { |
318 | - $precontents = Prado::createComponent('TCompositeControl'); |
|
318 | + $precontents=Prado::createComponent('TCompositeControl'); |
|
319 | 319 | $this->getPreContentsTemplate()->instantiateIn($precontents); |
320 | 320 | $control->getControls()->insertAt(0, $precontents); |
321 | 321 | } |
322 | 322 | |
323 | 323 | if($this->getPostContentsTemplate()) |
324 | 324 | { |
325 | - $postcontents = Prado::createComponent('TCompositeControl'); |
|
325 | + $postcontents=Prado::createComponent('TCompositeControl'); |
|
326 | 326 | $this->getPostContentsTemplate()->instantiateIn($postcontents); |
327 | 327 | $control->getControls()->add($postcontents); |
328 | 328 | } |
@@ -333,14 +333,14 @@ discard block |
||
333 | 333 | |
334 | 334 | if($this->getPreTagTemplate()) |
335 | 335 | { |
336 | - $pretag = Prado::createComponent('TCompositeControl'); |
|
336 | + $pretag=Prado::createComponent('TCompositeControl'); |
|
337 | 337 | $this->getPreTagTemplate()->instantiateIn($pretag); |
338 | 338 | $outercontrol->getParent()->getControls()->insertBefore($outercontrol, $pretag); |
339 | 339 | } |
340 | 340 | |
341 | 341 | if($this->getPostTagTemplate()) |
342 | 342 | { |
343 | - $posttag = Prado::createComponent('TCompositeControl'); |
|
343 | + $posttag=Prado::createComponent('TCompositeControl'); |
|
344 | 344 | $this->getPostTagTemplate()->instantiateIn($posttag); |
345 | 345 | $outercontrol->getParent()->getControls()->insertAfter($outercontrol, $posttag); |
346 | 346 | } |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function setRepackUTF7($value) |
47 | 47 | { |
48 | - $this->setViewState('RepackUTF7',TPropertyValue::ensureBoolean($value),false); |
|
48 | + $this->setViewState('RepackUTF7', TPropertyValue::ensureBoolean($value), false); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | public function getRepackUTF7() |
55 | 55 | { |
56 | - return $this->getViewState('RepackUTF7',false); |
|
56 | + return $this->getViewState('RepackUTF7', false); |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function render($writer) |
66 | 66 | { |
67 | - $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
67 | + $htmlWriter=Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
|
68 | 68 | parent::render($htmlWriter); |
69 | 69 | $writer->write($this->parseSafeHtml($htmlWriter->flush())); |
70 | 70 | } |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | protected function parseSafeHtml($text) |
78 | 78 | { |
79 | - $renderer = Prado::createComponent('System.3rdParty.SafeHtml.TSafeHtmlParser'); |
|
79 | + $renderer=Prado::createComponent('System.3rdParty.SafeHtml.TSafeHtmlParser'); |
|
80 | 80 | return $renderer->parse($text, $this->getRepackUTF7()); |
81 | 81 | } |
82 | 82 | } |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * TSafeHtml class file |
|
4 | - * |
|
5 | - * @author Wei Zhuo <weizhuo[at]gmail[dot]com> |
|
6 | - * @link https://github.com/pradosoft/prado |
|
7 | - * @copyright Copyright © 2005-2016 The PRADO Group |
|
8 | - * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
9 | - * @package System.Web.UI.WebControls |
|
10 | - */ |
|
3 | + * TSafeHtml class file |
|
4 | + * |
|
5 | + * @author Wei Zhuo <weizhuo[at]gmail[dot]com> |
|
6 | + * @link https://github.com/pradosoft/prado |
|
7 | + * @copyright Copyright © 2005-2016 The PRADO Group |
|
8 | + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
9 | + * @package System.Web.UI.WebControls |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * TSafeHtml class |
@@ -54,16 +54,16 @@ discard block |
||
54 | 54 | protected function __getZappableSleepProps(&$exprops) |
55 | 55 | { |
56 | 56 | parent::__getZappableSleepProps($exprops); |
57 | - if ($this->_backImageUrl===null) |
|
58 | - $exprops[] = "\0TPanelStyle\0_backImageUrl"; |
|
59 | - if ($this->_direction===null) |
|
60 | - $exprops[] = "\0TPanelStyle\0_direction"; |
|
61 | - if ($this->_horizontalAlign===null) |
|
62 | - $exprops[] = "\0TPanelStyle\0_horizontalAlign"; |
|
63 | - if ($this->_scrollBars===null) |
|
64 | - $exprops[] = "\0TPanelStyle\0_scrollBars"; |
|
65 | - if ($this->_wrap===null) |
|
66 | - $exprops[] = "\0TPanelStyle\0_wrap"; |
|
57 | + if($this->_backImageUrl===null) |
|
58 | + $exprops[]="\0TPanelStyle\0_backImageUrl"; |
|
59 | + if($this->_direction===null) |
|
60 | + $exprops[]="\0TPanelStyle\0_direction"; |
|
61 | + if($this->_horizontalAlign===null) |
|
62 | + $exprops[]="\0TPanelStyle\0_horizontalAlign"; |
|
63 | + if($this->_scrollBars===null) |
|
64 | + $exprops[]="\0TPanelStyle\0_scrollBars"; |
|
65 | + if($this->_wrap===null) |
|
66 | + $exprops[]="\0TPanelStyle\0_wrap"; |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -74,28 +74,28 @@ discard block |
||
74 | 74 | public function addAttributesToRender($writer) |
75 | 75 | { |
76 | 76 | if(($url=trim($this->getBackImageUrl()))!=='') |
77 | - $this->setStyleField('background-image','url('.$url.')'); |
|
77 | + $this->setStyleField('background-image', 'url('.$url.')'); |
|
78 | 78 | |
79 | 79 | switch($this->getScrollBars()) |
80 | 80 | { |
81 | - case TScrollBars::Horizontal: $this->setStyleField('overflow-x','scroll'); break; |
|
82 | - case TScrollBars::Vertical: $this->setStyleField('overflow-y','scroll'); break; |
|
83 | - case TScrollBars::Both: $this->setStyleField('overflow','scroll'); break; |
|
84 | - case TScrollBars::Auto: $this->setStyleField('overflow','auto'); break; |
|
81 | + case TScrollBars::Horizontal: $this->setStyleField('overflow-x', 'scroll'); break; |
|
82 | + case TScrollBars::Vertical: $this->setStyleField('overflow-y', 'scroll'); break; |
|
83 | + case TScrollBars::Both: $this->setStyleField('overflow', 'scroll'); break; |
|
84 | + case TScrollBars::Auto: $this->setStyleField('overflow', 'auto'); break; |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | if(($align=$this->getHorizontalAlign())!==THorizontalAlign::NotSet) |
88 | - $this->setStyleField('text-align',strtolower($align)); |
|
88 | + $this->setStyleField('text-align', strtolower($align)); |
|
89 | 89 | |
90 | 90 | if(!$this->getWrap()) |
91 | - $this->setStyleField('white-space','nowrap'); |
|
91 | + $this->setStyleField('white-space', 'nowrap'); |
|
92 | 92 | |
93 | 93 | if(($direction=$this->getDirection())!==TContentDirection::NotSet) |
94 | 94 | { |
95 | 95 | if($direction===TContentDirection::LeftToRight) |
96 | - $this->setStyleField('direction','ltr'); |
|
96 | + $this->setStyleField('direction', 'ltr'); |
|
97 | 97 | else |
98 | - $this->setStyleField('direction','rtl'); |
|
98 | + $this->setStyleField('direction', 'rtl'); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | parent::addAttributesToRender($writer); |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | */ |
107 | 107 | public function getBackImageUrl() |
108 | 108 | { |
109 | - return $this->_backImageUrl===null?'':$this->_backImageUrl; |
|
109 | + return $this->_backImageUrl===null ? '' : $this->_backImageUrl; |
|
110 | 110 | } |
111 | 111 | |
112 | 112 | /** |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function getDirection() |
125 | 125 | { |
126 | - return $this->_direction===null?TContentDirection::NotSet:$this->_direction; |
|
126 | + return $this->_direction===null ? TContentDirection::NotSet : $this->_direction; |
|
127 | 127 | } |
128 | 128 | |
129 | 129 | /** |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function setDirection($value) |
133 | 133 | { |
134 | - $this->_direction=TPropertyValue::ensureEnum($value,'TContentDirection'); |
|
134 | + $this->_direction=TPropertyValue::ensureEnum($value, 'TContentDirection'); |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | */ |
140 | 140 | public function getWrap() |
141 | 141 | { |
142 | - return $this->_wrap===null?true:$this->_wrap; |
|
142 | + return $this->_wrap===null ? true : $this->_wrap; |
|
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | */ |
157 | 157 | public function getHorizontalAlign() |
158 | 158 | { |
159 | - return $this->_horizontalAlign===null?THorizontalAlign::NotSet:$this->_horizontalAlign; |
|
159 | + return $this->_horizontalAlign===null ? THorizontalAlign::NotSet : $this->_horizontalAlign; |
|
160 | 160 | } |
161 | 161 | |
162 | 162 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public function setHorizontalAlign($value) |
167 | 167 | { |
168 | - $this->_horizontalAlign=TPropertyValue::ensureEnum($value,'THorizontalAlign'); |
|
168 | + $this->_horizontalAlign=TPropertyValue::ensureEnum($value, 'THorizontalAlign'); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -173,7 +173,7 @@ discard block |
||
173 | 173 | */ |
174 | 174 | public function getScrollBars() |
175 | 175 | { |
176 | - return $this->_scrollBars===null?TScrollBars::None:$this->_scrollBars; |
|
176 | + return $this->_scrollBars===null ? TScrollBars::None : $this->_scrollBars; |
|
177 | 177 | } |
178 | 178 | |
179 | 179 | /** |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | */ |
182 | 182 | public function setScrollBars($value) |
183 | 183 | { |
184 | - $this->_scrollBars=TPropertyValue::ensureEnum($value,'TScrollBars'); |
|
184 | + $this->_scrollBars=TPropertyValue::ensureEnum($value, 'TScrollBars'); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | /** |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | /** |
3 | - * TPanelStyle class file |
|
4 | - * |
|
5 | - * @author Qiang Xue <[email protected]> |
|
6 | - * @link https://github.com/pradosoft/prado |
|
7 | - * @copyright Copyright © 2005-2016 The PRADO Group |
|
8 | - * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
9 | - * @package System.Web.UI.WebControls |
|
10 | - */ |
|
3 | + * TPanelStyle class file |
|
4 | + * |
|
5 | + * @author Qiang Xue <[email protected]> |
|
6 | + * @link https://github.com/pradosoft/prado |
|
7 | + * @copyright Copyright © 2005-2016 The PRADO Group |
|
8 | + * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT |
|
9 | + * @package System.Web.UI.WebControls |
|
10 | + */ |
|
11 | 11 | |
12 | 12 | /** |
13 | 13 | * Includes TStyle class file |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | class TReCaptchaValidator extends TBaseValidator |
32 | 32 | { |
33 | - protected $_isvalid = null; |
|
33 | + protected $_isvalid=null; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * Gets the name of the javascript class responsible for performing validation for this control. |
@@ -49,18 +49,18 @@ discard block |
||
49 | 49 | |
50 | 50 | protected function getCaptchaControl() |
51 | 51 | { |
52 | - $control = $this->getValidationTarget(); |
|
53 | - if (!$control) |
|
52 | + $control=$this->getValidationTarget(); |
|
53 | + if(!$control) |
|
54 | 54 | throw new Exception('No target control specified for TReCaptchaValidator'); |
55 | - if (!($control instanceof TReCaptcha)) |
|
55 | + if(!($control instanceof TReCaptcha)) |
|
56 | 56 | throw new Exception('TReCaptchaValidator only works with TReCaptcha controls'); |
57 | 57 | return $control; |
58 | 58 | } |
59 | 59 | |
60 | 60 | public function getClientScriptOptions() |
61 | 61 | { |
62 | - $options = parent::getClientScriptOptions(); |
|
63 | - $options['ResponseFieldName'] = $this->getCaptchaControl()->getResponseFieldName(); |
|
62 | + $options=parent::getClientScriptOptions(); |
|
63 | + $options['ResponseFieldName']=$this->getCaptchaControl()->getResponseFieldName(); |
|
64 | 64 | return $options; |
65 | 65 | } |
66 | 66 | |
@@ -74,10 +74,10 @@ discard block |
||
74 | 74 | protected function evaluateIsValid() |
75 | 75 | { |
76 | 76 | // check validity only once (if trying to evaulate multiple times, all redundant checks would fail) |
77 | - if (is_null($this->_isvalid)) |
|
77 | + if(is_null($this->_isvalid)) |
|
78 | 78 | { |
79 | - $control = $this->getCaptchaControl(); |
|
80 | - $this->_isvalid = $control->validate(); |
|
79 | + $control=$this->getCaptchaControl(); |
|
80 | + $this->_isvalid=$control->validate(); |
|
81 | 81 | } |
82 | 82 | return ($this->_isvalid==true); |
83 | 83 | } |
@@ -86,23 +86,23 @@ discard block |
||
86 | 86 | { |
87 | 87 | parent::onPreRender($param); |
88 | 88 | |
89 | - $cs = $this->Page->getClientScript(); |
|
89 | + $cs=$this->Page->getClientScript(); |
|
90 | 90 | $cs->registerPradoScript('validator'); |
91 | 91 | |
92 | 92 | // communicate validation status to the client side |
93 | - $value = $this->_isvalid===false ? '0' : '1'; |
|
94 | - $cs->registerHiddenField($this->getClientID().'_1',$value); |
|
93 | + $value=$this->_isvalid===false ? '0' : '1'; |
|
94 | + $cs->registerHiddenField($this->getClientID().'_1', $value); |
|
95 | 95 | |
96 | 96 | // update validator display |
97 | - if ($control = $this->getValidationTarget()) |
|
97 | + if($control=$this->getValidationTarget()) |
|
98 | 98 | { |
99 | - $fn = 'captchaUpdateValidatorStatus_'.$this->getClientID(); |
|
99 | + $fn='captchaUpdateValidatorStatus_'.$this->getClientID(); |
|
100 | 100 | |
101 | 101 | // check if we need to request a new captcha too |
102 | - if ($this->Page->IsCallback) |
|
102 | + if($this->Page->IsCallback) |
|
103 | 103 | { |
104 | - if ($control->getVisible(true)) |
|
105 | - if (!is_null($this->_isvalid)) |
|
104 | + if($control->getVisible(true)) |
|
105 | + if(!is_null($this->_isvalid)) |
|
106 | 106 | { |
107 | 107 | // if the response has been tested and we reach the pre-render phase |
108 | 108 | // then we need to regenerate the token, because it won't test positive |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | } |
113 | 113 | } |
114 | 114 | |
115 | - $cs->registerEndScript($this->getClientID().'::validate', implode(' ',array( |
|
115 | + $cs->registerEndScript($this->getClientID().'::validate', implode(' ', array( |
|
116 | 116 | // this function will be used to update the validator |
117 | 117 | 'function '.$fn.'(valid)', |
118 | 118 | '{', |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | */ |
31 | 31 | class TJavascriptLogger extends TWebControl |
32 | 32 | { |
33 | - private static $_keyCodes = array( |
|
33 | + private static $_keyCodes=array( |
|
34 | 34 | '0'=>48, '1'=>49, '2'=>50, '3'=>51, '4'=>52, '5'=>53, '6'=>54, '7'=>55, '8'=>56, '9'=>57, |
35 | 35 | 'a'=>65, 'b'=>66, 'c'=>67, 'd'=>68, 'e'=>69, 'f'=>70, 'g'=>71, 'h'=>72, |
36 | 36 | 'i'=>73, 'j'=>74, 'k'=>75, 'l'=>76, 'm'=>77, 'n'=>78, 'o'=>79, 'p'=>80, |
@@ -66,11 +66,11 @@ discard block |
||
66 | 66 | */ |
67 | 67 | public function onPreRender($param) |
68 | 68 | { |
69 | - $key = strtolower($this->getToggleKey()); |
|
70 | - $code = isset(self::$_keyCodes[$key]) ? self::$_keyCodes[$key] : 74; |
|
71 | - $js = "var logConsole; jQuery(function() { logConsole = new LogConsole($code)}); "; |
|
72 | - $cs = $this->getPage()->getClientScript(); |
|
73 | - $cs->registerBeginScript($this->getClientID(),$js); |
|
69 | + $key=strtolower($this->getToggleKey()); |
|
70 | + $code=isset(self::$_keyCodes[$key]) ? self::$_keyCodes[$key] : 74; |
|
71 | + $js="var logConsole; jQuery(function() { logConsole = new LogConsole($code)}); "; |
|
72 | + $cs=$this->getPage()->getClientScript(); |
|
73 | + $cs->registerBeginScript($this->getClientID(), $js); |
|
74 | 74 | $cs->registerPradoScript('logger'); |
75 | 75 | } |
76 | 76 | |
@@ -81,10 +81,10 @@ discard block |
||
81 | 81 | */ |
82 | 82 | public function renderContents($writer) |
83 | 83 | { |
84 | - $code = strtoupper($this->getToggleKey()); |
|
85 | - $info = '(<a href="http://web.archive.org/web/20060512041505/gleepglop.com/javascripts/logger/" target="_blank">more info</a>).'; |
|
86 | - $link = '<a href="javascript:if(logConsole)logConsole.toggle()">toggle the javascript log console.</a>'; |
|
87 | - $usage = 'Press ALT-'.$code.' (Or CTRL-'.$code.' on OS X) to'; |
|
84 | + $code=strtoupper($this->getToggleKey()); |
|
85 | + $info='(<a href="http://web.archive.org/web/20060512041505/gleepglop.com/javascripts/logger/" target="_blank">more info</a>).'; |
|
86 | + $link='<a href="javascript:if(logConsole)logConsole.toggle()">toggle the javascript log console.</a>'; |
|
87 | + $usage='Press ALT-'.$code.' (Or CTRL-'.$code.' on OS X) to'; |
|
88 | 88 | $writer->write("{$usage} {$link} {$info}"); |
89 | 89 | } |
90 | 90 | } |
@@ -39,12 +39,12 @@ discard block |
||
39 | 39 | */ |
40 | 40 | protected function addAttributesToRender($writer) |
41 | 41 | { |
42 | - $writer->addAttribute('src',$this->getImageUrl()); |
|
43 | - $writer->addAttribute('alt',$this->getAlternateText()); |
|
42 | + $writer->addAttribute('src', $this->getImageUrl()); |
|
43 | + $writer->addAttribute('alt', $this->getAlternateText()); |
|
44 | 44 | if(($desc=$this->getDescriptionUrl())!=='') |
45 | - $writer->addAttribute('longdesc',$desc); |
|
45 | + $writer->addAttribute('longdesc', $desc); |
|
46 | 46 | if(($align=$this->getImageAlign())!=='') |
47 | - $writer->addAttribute('align',$align); |
|
47 | + $writer->addAttribute('align', $align); |
|
48 | 48 | parent::addAttributesToRender($writer); |
49 | 49 | } |
50 | 50 | |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function getAlternateText() |
64 | 64 | { |
65 | - return $this->getViewState('AlternateText',''); |
|
65 | + return $this->getViewState('AlternateText', ''); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function setAlternateText($value) |
73 | 73 | { |
74 | - $this->setViewState('AlternateText',$value,''); |
|
74 | + $this->setViewState('AlternateText', $value, ''); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function getImageAlign() |
81 | 81 | { |
82 | - return $this->getViewState('ImageAlign',''); |
|
82 | + return $this->getViewState('ImageAlign', ''); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | */ |
92 | 92 | public function setImageAlign($value) |
93 | 93 | { |
94 | - $this->setViewState('ImageAlign',$value,''); |
|
94 | + $this->setViewState('ImageAlign', $value, ''); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | */ |
100 | 100 | public function getImageUrl() |
101 | 101 | { |
102 | - return $this->getViewState('ImageUrl',''); |
|
102 | + return $this->getViewState('ImageUrl', ''); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function setImageUrl($value) |
109 | 109 | { |
110 | - $this->setViewState('ImageUrl',$value,''); |
|
110 | + $this->setViewState('ImageUrl', $value, ''); |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function getDescriptionUrl() |
143 | 143 | { |
144 | - return $this->getViewState('DescriptionUrl',''); |
|
144 | + return $this->getViewState('DescriptionUrl', ''); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function setDescriptionUrl($value) |
151 | 151 | { |
152 | - $this->setViewState('DescriptionUrl',$value,''); |
|
152 | + $this->setViewState('DescriptionUrl', $value, ''); |
|
153 | 153 | } |
154 | 154 | } |
155 | 155 |