@@ -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 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function getText() |
153 | 153 | { |
154 | - return $this->getViewState('Text',''); |
|
154 | + return $this->getViewState('Text', ''); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | */ |
162 | 162 | public function setText($value) |
163 | 163 | { |
164 | - $this->setViewState('Text',$value,''); |
|
164 | + $this->setViewState('Text', $value, ''); |
|
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
@@ -197,10 +197,10 @@ discard block |
||
197 | 197 | protected function addAttributesToRender($writer) |
198 | 198 | { |
199 | 199 | parent::addAttributesToRender($writer); |
200 | - if(($colspan=$this->getColumnSpan())>0) |
|
201 | - $writer->addAttribute('colspan',"$colspan"); |
|
202 | - if(($rowspan=$this->getRowSpan())>0) |
|
203 | - $writer->addAttribute('rowspan',"$rowspan"); |
|
200 | + if(($colspan=$this->getColumnSpan()) > 0) |
|
201 | + $writer->addAttribute('colspan', "$colspan"); |
|
202 | + if(($rowspan=$this->getRowSpan()) > 0) |
|
203 | + $writer->addAttribute('rowspan', "$rowspan"); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function getDisplay() |
56 | 56 | { |
57 | - return $this->getViewState('Display',TValidationSummaryDisplayStyle::Fixed); |
|
57 | + return $this->getViewState('Display', TValidationSummaryDisplayStyle::Fixed); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | */ |
63 | 63 | public function setDisplay($value) |
64 | 64 | { |
65 | - $this->setViewState('Display',TPropertyValue::ensureEnum($value,'TValidationSummaryDisplayStyle'),TValidationSummaryDisplayStyle::Fixed); |
|
65 | + $this->setViewState('Display', TPropertyValue::ensureEnum($value, 'TValidationSummaryDisplayStyle'), TValidationSummaryDisplayStyle::Fixed); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | /** |
@@ -70,7 +70,7 @@ discard block |
||
70 | 70 | */ |
71 | 71 | public function getHeaderText() |
72 | 72 | { |
73 | - return $this->getViewState('HeaderText',''); |
|
73 | + return $this->getViewState('HeaderText', ''); |
|
74 | 74 | } |
75 | 75 | |
76 | 76 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function setHeaderText($value) |
81 | 81 | { |
82 | - $this->setViewState('HeaderText',$value,''); |
|
82 | + $this->setViewState('HeaderText', $value, ''); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function getDisplayMode() |
89 | 89 | { |
90 | - return $this->getViewState('DisplayMode',TValidationSummaryDisplayMode::BulletList); |
|
90 | + return $this->getViewState('DisplayMode', TValidationSummaryDisplayMode::BulletList); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function setDisplayMode($value) |
97 | 97 | { |
98 | - $this->setViewState('DisplayMode',TPropertyValue::ensureEnum($value,'TValidationSummaryDisplayMode'),TValidationSummaryDisplayMode::BulletList); |
|
98 | + $this->setViewState('DisplayMode', TPropertyValue::ensureEnum($value, 'TValidationSummaryDisplayMode'), TValidationSummaryDisplayMode::BulletList); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function getEnableClientScript() |
105 | 105 | { |
106 | - return $this->getViewState('EnableClientScript',true); |
|
106 | + return $this->getViewState('EnableClientScript', true); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function setEnableClientScript($value) |
113 | 113 | { |
114 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
114 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function getShowMessageBox() |
121 | 121 | { |
122 | - return $this->getViewState('ShowMessageBox',false); |
|
122 | + return $this->getViewState('ShowMessageBox', false); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function setShowMessageBox($value) |
129 | 129 | { |
130 | - $this->setViewState('ShowMessageBox',TPropertyValue::ensureBoolean($value),false); |
|
130 | + $this->setViewState('ShowMessageBox', TPropertyValue::ensureBoolean($value), false); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function getShowSummary() |
137 | 137 | { |
138 | - return $this->getViewState('ShowSummary',true); |
|
138 | + return $this->getViewState('ShowSummary', true); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function setShowSummary($value) |
145 | 145 | { |
146 | - $this->setViewState('ShowSummary',TPropertyValue::ensureBoolean($value),true); |
|
146 | + $this->setViewState('ShowSummary', TPropertyValue::ensureBoolean($value), true); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function getScrollToSummary() |
153 | 153 | { |
154 | - return $this->getViewState('ScrollToSummary',true); |
|
154 | + return $this->getViewState('ScrollToSummary', true); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | */ |
160 | 160 | public function setScrollToSummary($value) |
161 | 161 | { |
162 | - $this->setViewState('ScrollToSummary',TPropertyValue::ensureBoolean($value),true); |
|
162 | + $this->setViewState('ScrollToSummary', TPropertyValue::ensureBoolean($value), true); |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -167,7 +167,7 @@ discard block |
||
167 | 167 | */ |
168 | 168 | public function getShowAnchor() |
169 | 169 | { |
170 | - return $this->getViewState('ShowAnchor',false); |
|
170 | + return $this->getViewState('ShowAnchor', false); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | /** |
@@ -175,7 +175,7 @@ discard block |
||
175 | 175 | */ |
176 | 176 | public function setShowAnchor($value) |
177 | 177 | { |
178 | - $this->setViewState('ShowAnchor',TPropertyValue::ensureBoolean($value),false); |
|
178 | + $this->setViewState('ShowAnchor', TPropertyValue::ensureBoolean($value), false); |
|
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | */ |
202 | 202 | public function getValidationGroup() |
203 | 203 | { |
204 | - return $this->getViewState('ValidationGroup',''); |
|
204 | + return $this->getViewState('ValidationGroup', ''); |
|
205 | 205 | } |
206 | 206 | |
207 | 207 | /** |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function setValidationGroup($value) |
211 | 211 | { |
212 | - $this->setViewState('ValidationGroup',$value,''); |
|
212 | + $this->setViewState('ValidationGroup', $value, ''); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | protected function addAttributesToRender($writer) |
@@ -219,11 +219,11 @@ discard block |
||
219 | 219 | if(!$visible) |
220 | 220 | { |
221 | 221 | if($display===TValidationSummaryDisplayStyle::None || $display===TValidationSummaryDisplayStyle::Dynamic) |
222 | - $writer->addStyleAttribute('display','none'); |
|
222 | + $writer->addStyleAttribute('display', 'none'); |
|
223 | 223 | else |
224 | - $writer->addStyleAttribute('visibility','hidden'); |
|
224 | + $writer->addStyleAttribute('visibility', 'hidden'); |
|
225 | 225 | } |
226 | - $writer->addAttribute('id',$this->getClientID()); |
|
226 | + $writer->addAttribute('id', $this->getClientID()); |
|
227 | 227 | parent::addAttributesToRender($writer); |
228 | 228 | } |
229 | 229 | |
@@ -235,23 +235,23 @@ discard block |
||
235 | 235 | { |
236 | 236 | if(!$this->getEnabled(true) || !$this->getEnableClientScript()) |
237 | 237 | return; |
238 | - $cs = $this->getPage()->getClientScript(); |
|
238 | + $cs=$this->getPage()->getClientScript(); |
|
239 | 239 | $cs->registerPradoScript('validator'); |
240 | 240 | |
241 | 241 | //need to register the validation manager is validation summary is alone. |
242 | 242 | $formID=$this->getPage()->getForm()->getClientID(); |
243 | - $scriptKey = "TBaseValidator:$formID"; |
|
243 | + $scriptKey="TBaseValidator:$formID"; |
|
244 | 244 | if($this->getEnableClientScript() && !$cs->isEndScriptRegistered($scriptKey)) |
245 | 245 | { |
246 | - $manager['FormID'] = $formID; |
|
247 | - $options = TJavaScript::encode($manager); |
|
246 | + $manager['FormID']=$formID; |
|
247 | + $options=TJavaScript::encode($manager); |
|
248 | 248 | $cs->registerPradoScript('validator'); |
249 | 249 | $cs->registerEndScript($scriptKey, "new Prado.ValidationManager({$options});"); |
250 | 250 | } |
251 | 251 | |
252 | 252 | |
253 | 253 | $options=TJavaScript::encode($this->getClientScriptOptions()); |
254 | - $script = "new Prado.WebUI.TValidationSummary({$options});"; |
|
254 | + $script="new Prado.WebUI.TValidationSummary({$options});"; |
|
255 | 255 | $cs->registerEndScript($this->getClientID(), $script); |
256 | 256 | } |
257 | 257 | |
@@ -261,8 +261,8 @@ discard block |
||
261 | 261 | */ |
262 | 262 | protected function getClientScriptOptions() |
263 | 263 | { |
264 | - $options['ID'] = $this->getClientID(); |
|
265 | - $options['FormID'] = $this->getPage()->getForm()->getClientID(); |
|
264 | + $options['ID']=$this->getClientID(); |
|
265 | + $options['FormID']=$this->getPage()->getForm()->getClientID(); |
|
266 | 266 | if($this->getShowMessageBox()) |
267 | 267 | $options['ShowMessageBox']=true; |
268 | 268 | if(!$this->getShowSummary()) |
@@ -272,12 +272,12 @@ discard block |
||
272 | 272 | $options['HeaderText']=$this->getHeaderText(); |
273 | 273 | $options['DisplayMode']=$this->getDisplayMode(); |
274 | 274 | |
275 | - $options['Refresh'] = $this->getAutoUpdate(); |
|
276 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
277 | - $options['Display'] = $this->getDisplay(); |
|
275 | + $options['Refresh']=$this->getAutoUpdate(); |
|
276 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
277 | + $options['Display']=$this->getDisplay(); |
|
278 | 278 | |
279 | 279 | if($this->_clientSide!==null) |
280 | - $options = array_merge($options,$this->_clientSide->getOptions()->toArray()); |
|
280 | + $options=array_merge($options, $this->_clientSide->getOptions()->toArray()); |
|
281 | 281 | |
282 | 282 | return $options; |
283 | 283 | } |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | public function getClientSide() |
290 | 290 | { |
291 | 291 | if($this->_clientSide===null) |
292 | - $this->_clientSide = $this->createClientScript(); |
|
292 | + $this->_clientSide=$this->createClientScript(); |
|
293 | 293 | return $this->_clientSide; |
294 | 294 | } |
295 | 295 | |
@@ -308,12 +308,12 @@ discard block |
||
308 | 308 | protected function getErrorMessages() |
309 | 309 | { |
310 | 310 | $validators=$this->getPage()->getValidators($this->getValidationGroup()); |
311 | - $messages = array(); |
|
311 | + $messages=array(); |
|
312 | 312 | foreach($validators as $validator) |
313 | 313 | { |
314 | 314 | if(!$validator->getIsValid() && ($msg=$validator->getErrorMessage())!=='') |
315 | 315 | //$messages[] = $validator->getAnchoredMessage($msg); |
316 | - $messages[] = $msg; |
|
316 | + $messages[]=$msg; |
|
317 | 317 | } |
318 | 318 | return $messages; |
319 | 319 | } |
@@ -356,9 +356,9 @@ discard block |
||
356 | 356 | { |
357 | 357 | $header=$this->getHeaderText(); |
358 | 358 | $messages=$this->getErrorMessages(); |
359 | - $content = ''; |
|
359 | + $content=''; |
|
360 | 360 | if(strlen($header)) |
361 | - $content.= $header."<br/>\n"; |
|
361 | + $content.=$header."<br/>\n"; |
|
362 | 362 | foreach($messages as $message) |
363 | 363 | $content.="$message<br/>\n"; |
364 | 364 | $writer->write($content); |
@@ -374,9 +374,9 @@ discard block |
||
374 | 374 | { |
375 | 375 | $header=$this->getHeaderText(); |
376 | 376 | $messages=$this->getErrorMessages(); |
377 | - $content = $header; |
|
377 | + $content=$header; |
|
378 | 378 | foreach($messages as $message) |
379 | - $content.= ' '.$message; |
|
379 | + $content.=' '.$message; |
|
380 | 380 | $writer->write($content); |
381 | 381 | } |
382 | 382 | |
@@ -390,13 +390,13 @@ discard block |
||
390 | 390 | { |
391 | 391 | $header=$this->getHeaderText(); |
392 | 392 | $messages=$this->getErrorMessages(); |
393 | - $content = $header; |
|
394 | - if(count($messages)>0) |
|
393 | + $content=$header; |
|
394 | + if(count($messages) > 0) |
|
395 | 395 | { |
396 | - $content .= "<ul>\n"; |
|
396 | + $content.="<ul>\n"; |
|
397 | 397 | foreach($messages as $message) |
398 | - $content.= '<li>'.$message."</li>\n"; |
|
399 | - $content .= "</ul>\n"; |
|
398 | + $content.='<li>'.$message."</li>\n"; |
|
399 | + $content.="</ul>\n"; |
|
400 | 400 | } |
401 | 401 | $writer->write($content); |
402 | 402 | } |