@@ -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 |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | /** |
61 | 61 | * @var array list of locale => language file pairs. |
62 | 62 | */ |
63 | - private static $_langs = array( |
|
63 | + private static $_langs=array( |
|
64 | 64 | 'ar' => 'ar', |
65 | 65 | 'bg_BG' => 'bg_BG', |
66 | 66 | 'bs' => 'bs', |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | /** |
119 | 119 | * @var array list of default plugins to load, override using getAvailablePlugins(); |
120 | 120 | */ |
121 | - private static $_plugins = array( |
|
121 | + private static $_plugins=array( |
|
122 | 122 | 'advlist', |
123 | 123 | 'anchor', |
124 | 124 | 'autolink', |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | /** |
163 | 163 | * @var array default themes to load |
164 | 164 | */ |
165 | - private static $_themes = array( |
|
165 | + private static $_themes=array( |
|
166 | 166 | 'modern', |
167 | 167 | ); |
168 | 168 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function getEnableVisualEdit() |
211 | 211 | { |
212 | - return $this->getViewState('EnableVisualEdit',true); |
|
212 | + return $this->getViewState('EnableVisualEdit', true); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | */ |
219 | 219 | public function setEnableVisualEdit($value) |
220 | 220 | { |
221 | - $this->setViewState('EnableVisualEdit',TPropertyValue::ensureBoolean($value),true); |
|
221 | + $this->setViewState('EnableVisualEdit', TPropertyValue::ensureBoolean($value), true); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | /** |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | { |
304 | 304 | if($this->getEnableVisualEdit() && $this->getEnabled(true)) |
305 | 305 | { |
306 | - $writer->addAttribute('id',$this->getClientID()); |
|
306 | + $writer->addAttribute('id', $this->getClientID()); |
|
307 | 307 | $this->registerEditorClientScript($writer); |
308 | 308 | } |
309 | 309 | |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | |
339 | 339 | protected function loadJavascriptLibrary() |
340 | 340 | { |
341 | - $scripts = $this->getPage()->getClientScript(); |
|
341 | + $scripts=$this->getPage()->getClientScript(); |
|
342 | 342 | $scripts->registerPradoScript('htmlarea4'); |
343 | 343 | $scripts->registerScriptFile('prado:THtmlArea4', $this->getScriptUrl()); |
344 | 344 | } |
@@ -349,14 +349,14 @@ discard block |
||
349 | 349 | protected function registerEditorClientScript($writer) |
350 | 350 | { |
351 | 351 | $this->loadJavascriptLibrary(); |
352 | - $scripts = $this->getPage()->getClientScript(); |
|
353 | - $options = array( |
|
352 | + $scripts=$this->getPage()->getClientScript(); |
|
353 | + $options=array( |
|
354 | 354 | 'EditorOptions' => $this->getEditorOptions() |
355 | 355 | ); |
356 | 356 | |
357 | - $options = TJavaScript::encode($options,true,true); |
|
358 | - $script = "new {$this->getClientClassName()}($options)"; |
|
359 | - $scripts->registerEndScript('prado:THtmlArea4'.$this->ClientID,$script); |
|
357 | + $options=TJavaScript::encode($options, true, true); |
|
358 | + $script="new {$this->getClientClassName()}($options)"; |
|
359 | + $scripts->registerEndScript('prado:THtmlArea4'.$this->ClientID, $script); |
|
360 | 360 | } |
361 | 361 | |
362 | 362 | /** |
@@ -373,19 +373,19 @@ discard block |
||
373 | 373 | */ |
374 | 374 | protected function getScriptDeploymentPath() |
375 | 375 | { |
376 | - $basedir = Prado::getPathOfNamespace('System.Web.Javascripts.source.tinymce-405'); |
|
377 | - $url = $this->getApplication()->getAssetManager()->publishFilePath($basedir); |
|
376 | + $basedir=Prado::getPathOfNamespace('System.Web.Javascripts.source.tinymce-405'); |
|
377 | + $url=$this->getApplication()->getAssetManager()->publishFilePath($basedir); |
|
378 | 378 | $this->copyCustomPlugins($url); |
379 | 379 | return $url; |
380 | 380 | } |
381 | 381 | |
382 | 382 | protected function copyCustomPlugins($url) |
383 | 383 | { |
384 | - if($plugins = $this->getCustomPluginPath()) |
|
384 | + if($plugins=$this->getCustomPluginPath()) |
|
385 | 385 | { |
386 | - $assets = $this->getApplication()->getAssetManager(); |
|
387 | - $path = is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins); |
|
388 | - $dest = $assets->getBasePath().'/'.basename($url).'/plugins/'; |
|
386 | + $assets=$this->getApplication()->getAssetManager(); |
|
387 | + $path=is_dir($plugins) ? $plugins : Prado::getPathOfNameSpace($plugins); |
|
388 | + $dest=$assets->getBasePath().'/'.basename($url).'/plugins/'; |
|
389 | 389 | if(!is_dir($dest) || $this->getApplication()->getMode()!==TApplicationMode::Performance) |
390 | 390 | $assets->copyDirectory($path, $dest); |
391 | 391 | } |
@@ -397,26 +397,26 @@ discard block |
||
397 | 397 | */ |
398 | 398 | protected function getEditorOptions() |
399 | 399 | { |
400 | - $options['mode'] = 'exact'; |
|
401 | - $options['elements'] = $this->getClientID(); |
|
402 | - $options['language'] = $this->getLanguageSuffix($this->getCulture()); |
|
400 | + $options['mode']='exact'; |
|
401 | + $options['elements']=$this->getClientID(); |
|
402 | + $options['language']=$this->getLanguageSuffix($this->getCulture()); |
|
403 | 403 | //$options['theme'] = 'modern'; //default |
404 | 404 | // mimic previous (tinyMCE3) sizing behaviour |
405 | - $options['width'] = $this->getWidth(); |
|
406 | - $options['height'] = $this->getHeight(); |
|
407 | - $options['resize'] = 'both'; |
|
408 | - $options['menubar'] = false; |
|
405 | + $options['width']=$this->getWidth(); |
|
406 | + $options['height']=$this->getHeight(); |
|
407 | + $options['resize']='both'; |
|
408 | + $options['menubar']=false; |
|
409 | 409 | if($this->getReadOnly()) |
410 | 410 | { |
411 | - $options['readonly'] = true; |
|
412 | - $options['toolbar'] = false; |
|
413 | - $options['menubar'] = false; |
|
414 | - $options['statusbar'] = false; |
|
411 | + $options['readonly']=true; |
|
412 | + $options['toolbar']=false; |
|
413 | + $options['menubar']=false; |
|
414 | + $options['statusbar']=false; |
|
415 | 415 | } |
416 | 416 | |
417 | - $options['extended_valid_elements'] = 'a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'; |
|
417 | + $options['extended_valid_elements']='a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]'; |
|
418 | 418 | |
419 | - $options = array_merge($options, $this->parseEditorOptions($this->getOptions())); |
|
419 | + $options=array_merge($options, $this->parseEditorOptions($this->getOptions())); |
|
420 | 420 | return $options; |
421 | 421 | } |
422 | 422 | |
@@ -426,20 +426,20 @@ discard block |
||
426 | 426 | */ |
427 | 427 | protected function parseEditorOptions($string) |
428 | 428 | { |
429 | - $options = array(); |
|
430 | - $substrings = preg_split('/,\s*\n|\n/', trim($string)); |
|
429 | + $options=array(); |
|
430 | + $substrings=preg_split('/,\s*\n|\n/', trim($string)); |
|
431 | 431 | foreach($substrings as $bits) |
432 | 432 | { |
433 | - $option = explode(":",$bits,2); |
|
433 | + $option=explode(":", $bits, 2); |
|
434 | 434 | |
435 | - if(count($option) == 2) |
|
435 | + if(count($option)==2) |
|
436 | 436 | { |
437 | - $value=trim(trim($option[1]),"'\""); |
|
438 | - if (($s=strtolower($value))==='false') |
|
437 | + $value=trim(trim($option[1]), "'\""); |
|
438 | + if(($s=strtolower($value))==='false') |
|
439 | 439 | $value=false; |
440 | - elseif ($s==='true') |
|
440 | + elseif($s==='true') |
|
441 | 441 | $value=true; |
442 | - $options[trim($option[0])] = $value; |
|
442 | + $options[trim($option[0])]=$value; |
|
443 | 443 | } |
444 | 444 | } |
445 | 445 | return $options; |
@@ -450,12 +450,12 @@ discard block |
||
450 | 450 | */ |
451 | 451 | protected function getLanguageSuffix($culture) |
452 | 452 | { |
453 | - $app = $this->getApplication()->getGlobalization(); |
|
453 | + $app=$this->getApplication()->getGlobalization(); |
|
454 | 454 | if(empty($culture) && ($app!==null)) |
455 | - $culture = $app->getCulture(); |
|
456 | - $variants = array(); |
|
455 | + $culture=$app->getCulture(); |
|
456 | + $variants=array(); |
|
457 | 457 | if($app!==null) |
458 | - $variants = $app->getCultureVariants($culture); |
|
458 | + $variants=$app->getCultureVariants($culture); |
|
459 | 459 | |
460 | 460 | foreach($variants as $variant) |
461 | 461 | { |
@@ -9,8 +9,8 @@ discard block |
||
9 | 9 | * @package System.Web.UI.WebControls |
10 | 10 | */ |
11 | 11 | |
12 | -Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter',false); |
|
13 | -Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter.Renderer.Html',false); |
|
12 | +Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter', false); |
|
13 | +Prado::using('System.3rdParty.TextHighlighter.Text.Highlighter.Renderer.Html', false); |
|
14 | 14 | Prado::using('System.Web.UI.WebControls.TTextProcessor'); |
15 | 15 | |
16 | 16 | |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function setLineNumberStyle($value) |
113 | 113 | { |
114 | - $this->setViewState('LineNumberStyle', TPropertyValue::ensureEnum($value,'TTextHighlighterLineNumberStyle')); |
|
114 | + $this->setViewState('LineNumberStyle', TPropertyValue::ensureEnum($value, 'TTextHighlighterLineNumberStyle')); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | protected function registerStyleSheet() |
148 | 148 | { |
149 | 149 | $cs=$this->getPage()->getClientScript(); |
150 | - $cssFile=Prado::getPathOfNamespace('System.3rdParty.TextHighlighter.highlight','.css'); |
|
150 | + $cssFile=Prado::getPathOfNamespace('System.3rdParty.TextHighlighter.highlight', '.css'); |
|
151 | 151 | $cssKey='prado:TTextHighlighter:'.$cssFile; |
152 | 152 | if(!$cs->isStyleSheetFileRegistered($cssKey)) |
153 | 153 | $cs->registerStyleSheetFile($cssKey, $this->publishFilePath($cssFile)); |
@@ -173,9 +173,9 @@ discard block |
||
173 | 173 | return ('<pre>'.htmlentities(trim($text)).'</pre>'); |
174 | 174 | |
175 | 175 | $options["use_language"]=true; |
176 | - $options["tabsize"] = $this->getTabSize(); |
|
177 | - if ($this->getShowLineNumbers()) |
|
178 | - $options["numbers"] = self::$_lineNumberStyle[$this->getLineNumberStyle()]; |
|
176 | + $options["tabsize"]=$this->getTabSize(); |
|
177 | + if($this->getShowLineNumbers()) |
|
178 | + $options["numbers"]=self::$_lineNumberStyle[$this->getLineNumberStyle()]; |
|
179 | 179 | $highlighter->setRenderer(new Text_Highlighter_Renderer_Html($options)); |
180 | 180 | return $highlighter->highlight(trim($text)); |
181 | 181 | } |
@@ -185,7 +185,7 @@ discard block |
||
185 | 185 | */ |
186 | 186 | protected function getHeaderTemplate() |
187 | 187 | { |
188 | - $id = $this->getClientID(); |
|
188 | + $id=$this->getClientID(); |
|
189 | 189 | return TJavaScript::renderScriptBlock("new Prado.WebUI.TTextHighlighter('{$id}');"); |
190 | 190 | } |
191 | 191 |
@@ -55,7 +55,7 @@ |
||
55 | 55 | */ |
56 | 56 | public function setItemType($value) |
57 | 57 | { |
58 | - $this->_itemType=TPropertyValue::ensureEnum($value,'TListItemType'); |
|
58 | + $this->_itemType=TPropertyValue::ensureEnum($value, 'TListItemType'); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function getImageUrl() |
94 | 94 | { |
95 | - return $this->_imageUrl===null?'':$this->_imageUrl; |
|
95 | + return $this->_imageUrl===null ? '' : $this->_imageUrl; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function getButtonText() |
110 | 110 | { |
111 | - return $this->_buttonText===null?'':$this->_buttonText; |
|
111 | + return $this->_buttonText===null ? '' : $this->_buttonText; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | */ |
125 | 125 | public function getButtonType() |
126 | 126 | { |
127 | - return $this->_buttonType===null? TWizardNavigationButtonType::Button :$this->_buttonType; |
|
127 | + return $this->_buttonType===null ? TWizardNavigationButtonType::Button : $this->_buttonType; |
|
128 | 128 | } |
129 | 129 | |
130 | 130 | /** |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | */ |
133 | 133 | public function setButtonType($value) |
134 | 134 | { |
135 | - $this->_buttonType=TPropertyValue::ensureEnum($value,'TWizardNavigationButtonType'); |
|
135 | + $this->_buttonType=TPropertyValue::ensureEnum($value, 'TWizardNavigationButtonType'); |
|
136 | 136 | } |
137 | 137 | |
138 | 138 | /** |
@@ -39,7 +39,7 @@ |
||
39 | 39 | { |
40 | 40 | if(($id=$this->getID())==='') |
41 | 41 | throw new TConfigurationException('content_id_required'); |
42 | - $this->getTemplateControl()->registerContent($id,$this); |
|
42 | + $this->getTemplateControl()->registerContent($id, $this); |
|
43 | 43 | } |
44 | 44 | } |
45 | 45 |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | protected function addAttributesToRender($writer) |
48 | 48 | { |
49 | 49 | $rows=$this->getRows(); |
50 | - $writer->addAttribute('size',"$rows"); |
|
50 | + $writer->addAttribute('size', "$rows"); |
|
51 | 51 | if($this->getSelectionMode()===TListSelectionMode::Multiple) |
52 | - $writer->addAttribute('name',$this->getUniqueID().'[]'); |
|
52 | + $writer->addAttribute('name', $this->getUniqueID().'[]'); |
|
53 | 53 | else |
54 | - $writer->addAttribute('name',$this->getUniqueID()); |
|
54 | + $writer->addAttribute('name', $this->getUniqueID()); |
|
55 | 55 | parent::addAttributesToRender($writer); |
56 | 56 | } |
57 | 57 | |
@@ -84,19 +84,19 @@ discard block |
||
84 | 84 | * @param array the input data collection |
85 | 85 | * @return boolean whether the data of the component has been changed |
86 | 86 | */ |
87 | - public function loadPostData($key,$values) |
|
87 | + public function loadPostData($key, $values) |
|
88 | 88 | { |
89 | 89 | if(!$this->getEnabled(true)) |
90 | 90 | return false; |
91 | 91 | $this->ensureDataBound(); |
92 | - $selections=isset($values[$key])?$values[$key]:null; |
|
92 | + $selections=isset($values[$key]) ? $values[$key] : null; |
|
93 | 93 | if($selections!==null) |
94 | 94 | { |
95 | 95 | $items=$this->getItems(); |
96 | 96 | if($this->getSelectionMode()===TListSelectionMode::Single) |
97 | 97 | { |
98 | - $selection=is_array($selections)?$selections[0]:$selections; |
|
99 | - $index=$items->findIndexByValue($selection,false); |
|
98 | + $selection=is_array($selections) ? $selections[0] : $selections; |
|
99 | + $index=$items->findIndexByValue($selection, false); |
|
100 | 100 | if($this->getSelectedIndex()!==$index) |
101 | 101 | { |
102 | 102 | $this->setSelectedIndex($index); |
@@ -109,14 +109,14 @@ discard block |
||
109 | 109 | $selections=array($selections); |
110 | 110 | $list=array(); |
111 | 111 | foreach($selections as $selection) |
112 | - $list[]=$items->findIndexByValue($selection,false); |
|
112 | + $list[]=$items->findIndexByValue($selection, false); |
|
113 | 113 | $list2=$this->getSelectedIndices(); |
114 | 114 | $n=count($list); |
115 | 115 | $flag=false; |
116 | 116 | if($n===count($list2)) |
117 | 117 | { |
118 | - sort($list,SORT_NUMERIC); |
|
119 | - for($i=0;$i<$n;++$i) |
|
118 | + sort($list, SORT_NUMERIC); |
|
119 | + for($i=0; $i < $n; ++$i) |
|
120 | 120 | { |
121 | 121 | if($list[$i]!==$list2[$i]) |
122 | 122 | { |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | public function setRows($value) |
190 | 190 | { |
191 | 191 | $value=TPropertyValue::ensureInteger($value); |
192 | - if($value<=0) |
|
192 | + if($value <= 0) |
|
193 | 193 | $value=4; |
194 | 194 | $this->setViewState('Rows', $value, 4); |
195 | 195 | } |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | */ |
208 | 208 | public function setSelectionMode($value) |
209 | 209 | { |
210 | - $this->setViewState('SelectionMode',TPropertyValue::ensureEnum($value,'TListSelectionMode'),TListSelectionMode::Single); |
|
210 | + $this->setViewState('SelectionMode', TPropertyValue::ensureEnum($value, 'TListSelectionMode'), TListSelectionMode::Single); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -57,9 +57,9 @@ |
||
57 | 57 | * @param array the input data collection |
58 | 58 | * @return boolean whether the data of the control has been changed |
59 | 59 | */ |
60 | - public function loadPostData($key,$values) |
|
60 | + public function loadPostData($key, $values) |
|
61 | 61 | { |
62 | - $value=isset($values[$key])?$values[$key]:''; |
|
62 | + $value=isset($values[$key]) ? $values[$key] : ''; |
|
63 | 63 | $oldSelection=$this->getSelectedIndex(); |
64 | 64 | $this->ensureDataBound(); |
65 | 65 | foreach($this->getItems() as $index=>$item) |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | public function __construct() |
79 | 79 | { |
80 | 80 | parent::__construct(); |
81 | - $this->_globalID = self::$_buttonCount++; |
|
81 | + $this->_globalID=self::$_buttonCount++; |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -110,10 +110,10 @@ discard block |
||
110 | 110 | * @param array the input data collection |
111 | 111 | * @return boolean whether the data of the control has been changed |
112 | 112 | */ |
113 | - public function loadPostData($key,$values) |
|
113 | + public function loadPostData($key, $values) |
|
114 | 114 | { |
115 | 115 | $uniqueGroupName=$this->getUniqueGroupName(); |
116 | - $value=isset($values[$uniqueGroupName])?$values[$uniqueGroupName]:null; |
|
116 | + $value=isset($values[$uniqueGroupName]) ? $values[$uniqueGroupName] : null; |
|
117 | 117 | if($value!==null && $value===$this->getValueAttribute()) |
118 | 118 | { |
119 | 119 | if(!$this->getChecked()) |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function getGroupName() |
136 | 136 | { |
137 | - return $this->getViewState('GroupName',''); |
|
137 | + return $this->getViewState('GroupName', ''); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function setGroupName($value) |
147 | 147 | { |
148 | - $this->setViewState('GroupName',$value,''); |
|
148 | + $this->setViewState('GroupName', $value, ''); |
|
149 | 149 | $this->_uniqueGroupName=null; |
150 | 150 | } |
151 | 151 | |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function getUniqueGroupName() |
156 | 156 | { |
157 | - if(($groupName=$this->getViewState('UniqueGroupName',''))!=='') |
|
157 | + if(($groupName=$this->getViewState('UniqueGroupName', ''))!=='') |
|
158 | 158 | return $groupName; |
159 | 159 | else if(($uniqueID=$this->getUniqueID())!==$this->_previousUniqueID || $this->_uniqueGroupName===null) |
160 | 160 | { |
@@ -162,12 +162,12 @@ discard block |
||
162 | 162 | $this->_previousUniqueID=$uniqueID; |
163 | 163 | if($uniqueID!=='') |
164 | 164 | { |
165 | - if(($pos=strrpos($uniqueID,TControl::ID_SEPARATOR))!==false) |
|
165 | + if(($pos=strrpos($uniqueID, TControl::ID_SEPARATOR))!==false) |
|
166 | 166 | { |
167 | 167 | if($groupName!=='') |
168 | - $groupName=substr($uniqueID,0,$pos+1).$groupName; |
|
168 | + $groupName=substr($uniqueID, 0, $pos + 1).$groupName; |
|
169 | 169 | else if(is_a($this->getNamingContainer(), 'TRadioButtonList')) |
170 | - $groupName=substr($uniqueID,0,$pos); |
|
170 | + $groupName=substr($uniqueID, 0, $pos); |
|
171 | 171 | } |
172 | 172 | if($groupName==='') |
173 | 173 | $groupName=$uniqueID; |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | */ |
196 | 196 | public function setUniqueGroupName($value) |
197 | 197 | { |
198 | - $this->setViewState('UniqueGroupName',$value,''); |
|
198 | + $this->setViewState('UniqueGroupName', $value, ''); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | /** |
@@ -206,12 +206,12 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function getRadioButtonsInGroup() |
208 | 208 | { |
209 | - $group = $this->getUniqueGroupName(); |
|
210 | - $buttons = array(); |
|
209 | + $group=$this->getUniqueGroupName(); |
|
210 | + $buttons=array(); |
|
211 | 211 | foreach(self::$_activeButtons as $control) |
212 | 212 | { |
213 | - if($control->getUniqueGroupName() === $group) |
|
214 | - $buttons[] = $control; |
|
213 | + if($control->getUniqueGroupName()===$group) |
|
214 | + $buttons[]=$control; |
|
215 | 215 | } |
216 | 216 | return $buttons; |
217 | 217 | } |
@@ -232,7 +232,7 @@ discard block |
||
232 | 232 | */ |
233 | 233 | public function getEnableClientScript() |
234 | 234 | { |
235 | - return $this->getViewState('EnableClientScript',true); |
|
235 | + return $this->getViewState('EnableClientScript', true); |
|
236 | 236 | } |
237 | 237 | |
238 | 238 | /** |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | */ |
241 | 241 | public function setEnableClientScript($value) |
242 | 242 | { |
243 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
243 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
@@ -249,19 +249,19 @@ discard block |
||
249 | 249 | * @param string checkbox id |
250 | 250 | * @param string onclick js |
251 | 251 | */ |
252 | - protected function renderInputTag($writer,$clientID,$onclick) |
|
252 | + protected function renderInputTag($writer, $clientID, $onclick) |
|
253 | 253 | { |
254 | 254 | if($clientID!=='') |
255 | - $writer->addAttribute('id',$clientID); |
|
256 | - $writer->addAttribute('type','radio'); |
|
257 | - $writer->addAttribute('name',$this->getUniqueGroupName()); |
|
258 | - $writer->addAttribute('value',$this->getValueAttribute()); |
|
255 | + $writer->addAttribute('id', $clientID); |
|
256 | + $writer->addAttribute('type', 'radio'); |
|
257 | + $writer->addAttribute('name', $this->getUniqueGroupName()); |
|
258 | + $writer->addAttribute('value', $this->getValueAttribute()); |
|
259 | 259 | if(!empty($onclick)) |
260 | - $writer->addAttribute('onclick',$onclick); |
|
260 | + $writer->addAttribute('onclick', $onclick); |
|
261 | 261 | if($this->getChecked()) |
262 | - $writer->addAttribute('checked','checked'); |
|
262 | + $writer->addAttribute('checked', 'checked'); |
|
263 | 263 | if(!$this->getEnabled(true)) |
264 | - $writer->addAttribute('disabled','disabled'); |
|
264 | + $writer->addAttribute('disabled', 'disabled'); |
|
265 | 265 | |
266 | 266 | $page=$this->getPage(); |
267 | 267 | if($this->getEnabled(true) |
@@ -273,10 +273,10 @@ discard block |
||
273 | 273 | } |
274 | 274 | |
275 | 275 | if(($accesskey=$this->getAccessKey())!=='') |
276 | - $writer->addAttribute('accesskey',$accesskey); |
|
277 | - if(($tabindex=$this->getTabIndex())>0) |
|
278 | - $writer->addAttribute('tabindex',"$tabindex"); |
|
279 | - if($attributes=$this->getViewState('InputAttributes',null)) |
|
276 | + $writer->addAttribute('accesskey', $accesskey); |
|
277 | + if(($tabindex=$this->getTabIndex()) > 0) |
|
278 | + $writer->addAttribute('tabindex', "$tabindex"); |
|
279 | + if($attributes=$this->getViewState('InputAttributes', null)) |
|
280 | 280 | $writer->addAttributes($attributes); |
281 | 281 | $writer->renderBeginTag('input'); |
282 | 282 | $writer->renderEndTag(); |
@@ -287,8 +287,8 @@ discard block |
||
287 | 287 | */ |
288 | 288 | protected function renderClientControlScript($writer) |
289 | 289 | { |
290 | - $cs = $this->getPage()->getClientScript(); |
|
291 | - $cs->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions()); |
|
290 | + $cs=$this->getPage()->getClientScript(); |
|
291 | + $cs->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions()); |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | /** |