@@ -58,8 +58,7 @@ |
||
58 | 58 | if ($this->sourcepath === NULL) |
59 | 59 | { |
60 | 60 | $this->sourcepath = $sourcepath; |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->sourcepath->append($sourcepath); |
65 | 64 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | public function getText() |
56 | 56 | { |
57 | - return $this->getViewState('Text',''); |
|
57 | + return $this->getViewState('Text', ''); |
|
58 | 58 | } |
59 | 59 | |
60 | 60 | /** |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function setText($value) |
65 | 65 | { |
66 | - $this->setViewState('Text',$value,''); |
|
66 | + $this->setViewState('Text', $value, ''); |
|
67 | 67 | } |
68 | 68 | |
69 | 69 | /** |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | */ |
72 | 72 | public function getDataTextField() |
73 | 73 | { |
74 | - return $this->getViewState('DataTextField',''); |
|
74 | + return $this->getViewState('DataTextField', ''); |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function setDataTextField($value) |
81 | 81 | { |
82 | - $this->setViewState('DataTextField',$value,''); |
|
82 | + $this->setViewState('DataTextField', $value, ''); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function getDataTextFormatString() |
89 | 89 | { |
90 | - return $this->getViewState('DataTextFormatString',''); |
|
90 | + return $this->getViewState('DataTextFormatString', ''); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | */ |
96 | 96 | public function setDataTextFormatString($value) |
97 | 97 | { |
98 | - $this->setViewState('DataTextFormatString',$value,''); |
|
98 | + $this->setViewState('DataTextFormatString', $value, ''); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | /** |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function getImageHeight() |
105 | 105 | { |
106 | - return $this->getViewState('ImageHeight',''); |
|
106 | + return $this->getViewState('ImageHeight', ''); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
@@ -111,7 +111,7 @@ discard block |
||
111 | 111 | */ |
112 | 112 | public function setImageHeight($value) |
113 | 113 | { |
114 | - $this->setViewState('ImageHeight',$value,''); |
|
114 | + $this->setViewState('ImageHeight', $value, ''); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function getImageUrl() |
121 | 121 | { |
122 | - return $this->getViewState('ImageUrl',''); |
|
122 | + return $this->getViewState('ImageUrl', ''); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function setImageUrl($value) |
129 | 129 | { |
130 | - $this->setViewState('ImageUrl',$value,''); |
|
130 | + $this->setViewState('ImageUrl', $value, ''); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function getImageWidth() |
137 | 137 | { |
138 | - return $this->getViewState('ImageWidth',''); |
|
138 | + return $this->getViewState('ImageWidth', ''); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function setImageWidth($value) |
145 | 145 | { |
146 | - $this->setViewState('ImageWidth',$value,''); |
|
146 | + $this->setViewState('ImageWidth', $value, ''); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function getNavigateUrl() |
153 | 153 | { |
154 | - return $this->getViewState('NavigateUrl',''); |
|
154 | + return $this->getViewState('NavigateUrl', ''); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function setNavigateUrl($value) |
162 | 162 | { |
163 | - $this->setViewState('NavigateUrl',$value,''); |
|
163 | + $this->setViewState('NavigateUrl', $value, ''); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | public function getDataNavigateUrlField() |
170 | 170 | { |
171 | - return $this->getViewState('DataNavigateUrlField',''); |
|
171 | + return $this->getViewState('DataNavigateUrlField', ''); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -176,7 +176,7 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function setDataNavigateUrlField($value) |
178 | 178 | { |
179 | - $this->setViewState('DataNavigateUrlField',$value,''); |
|
179 | + $this->setViewState('DataNavigateUrlField', $value, ''); |
|
180 | 180 | } |
181 | 181 | |
182 | 182 | /** |
@@ -184,7 +184,7 @@ discard block |
||
184 | 184 | */ |
185 | 185 | public function getDataNavigateUrlFormatString() |
186 | 186 | { |
187 | - return $this->getViewState('DataNavigateUrlFormatString',''); |
|
187 | + return $this->getViewState('DataNavigateUrlFormatString', ''); |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | */ |
193 | 193 | public function setDataNavigateUrlFormatString($value) |
194 | 194 | { |
195 | - $this->setViewState('DataNavigateUrlFormatString',$value,''); |
|
195 | + $this->setViewState('DataNavigateUrlFormatString', $value, ''); |
|
196 | 196 | } |
197 | 197 | |
198 | 198 | /** |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function getTarget() |
202 | 202 | { |
203 | - return $this->getViewState('Target',''); |
|
203 | + return $this->getViewState('Target', ''); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | */ |
210 | 210 | public function setTarget($value) |
211 | 211 | { |
212 | - $this->setViewState('Target',$value,''); |
|
212 | + $this->setViewState('Target', $value, ''); |
|
213 | 213 | } |
214 | 214 | |
215 | 215 | /** |
@@ -220,12 +220,12 @@ discard block |
||
220 | 220 | * @param integer the index to the Columns property that the cell resides in. |
221 | 221 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
222 | 222 | */ |
223 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
223 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
224 | 224 | { |
225 | 225 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem) |
226 | 226 | { |
227 | 227 | $link=new THyperLink; |
228 | - if(($url = $this->getImageUrl())!=='') |
|
228 | + if(($url=$this->getImageUrl())!=='') |
|
229 | 229 | { |
230 | 230 | $link->setImageUrl($url); |
231 | 231 | if(($width=$this->getImageWidth())!=='') |
@@ -237,12 +237,12 @@ discard block |
||
237 | 237 | $link->setNavigateUrl($this->getNavigateUrl()); |
238 | 238 | $link->setTarget($this->getTarget()); |
239 | 239 | if($this->getDataTextField()!=='' || $this->getDataNavigateUrlField()!=='') |
240 | - $link->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
240 | + $link->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
241 | 241 | $cell->getControls()->add($link); |
242 | - $cell->registerObject('HyperLink',$link); |
|
242 | + $cell->registerObject('HyperLink', $link); |
|
243 | 243 | } |
244 | 244 | else |
245 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
245 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | /** |
@@ -250,20 +250,20 @@ discard block |
||
250 | 250 | * This method is invoked when datagrid performs databinding. |
251 | 251 | * It populates the content of the cell with the relevant data from data source. |
252 | 252 | */ |
253 | - public function dataBindColumn($sender,$param) |
|
253 | + public function dataBindColumn($sender, $param) |
|
254 | 254 | { |
255 | 255 | $item=$sender->getNamingContainer(); |
256 | 256 | $data=$item->getData(); |
257 | 257 | if(($field=$this->getDataTextField())!=='') |
258 | 258 | { |
259 | - $value=$this->getDataFieldValue($data,$field); |
|
260 | - $text=$this->formatDataValue($this->getDataTextFormatString(),$value); |
|
259 | + $value=$this->getDataFieldValue($data, $field); |
|
260 | + $text=$this->formatDataValue($this->getDataTextFormatString(), $value); |
|
261 | 261 | $sender->setText($text); |
262 | 262 | } |
263 | 263 | if(($field=$this->getDataNavigateUrlField())!=='') |
264 | 264 | { |
265 | - $value=$this->getDataFieldValue($data,$field); |
|
266 | - $url=$this->formatDataValue($this->getDataNavigateUrlFormatString(),$value); |
|
265 | + $value=$this->getDataFieldValue($data, $field); |
|
266 | + $url=$this->formatDataValue($this->getDataNavigateUrlFormatString(), $value); |
|
267 | 267 | $sender->setNavigateUrl($url); |
268 | 268 | } |
269 | 269 | } |
@@ -58,8 +58,7 @@ |
||
58 | 58 | if ($this->sourcepath === NULL) |
59 | 59 | { |
60 | 60 | $this->sourcepath = $sourcepath; |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->sourcepath->append($sourcepath); |
65 | 64 | } |
@@ -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 | /** |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | */ |
62 | 62 | public function setText($value) |
63 | 63 | { |
64 | - $this->setViewState('Text',$value,''); |
|
64 | + $this->setViewState('Text', $value, ''); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | /** |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | */ |
70 | 70 | public function getDataTextField() |
71 | 71 | { |
72 | - return $this->getViewState('DataTextField',''); |
|
72 | + return $this->getViewState('DataTextField', ''); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | /** |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | */ |
78 | 78 | public function setDataTextField($value) |
79 | 79 | { |
80 | - $this->setViewState('DataTextField',$value,''); |
|
80 | + $this->setViewState('DataTextField', $value, ''); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | /** |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function getDataTextFormatString() |
87 | 87 | { |
88 | - return $this->getViewState('DataTextFormatString',''); |
|
88 | + return $this->getViewState('DataTextFormatString', ''); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | /** |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | */ |
94 | 94 | public function setDataTextFormatString($value) |
95 | 95 | { |
96 | - $this->setViewState('DataTextFormatString',$value,''); |
|
96 | + $this->setViewState('DataTextFormatString', $value, ''); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | /** |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | */ |
102 | 102 | public function getImageUrl() |
103 | 103 | { |
104 | - return $this->getViewState('ImageUrl',''); |
|
104 | + return $this->getViewState('ImageUrl', ''); |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | /** |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | */ |
110 | 110 | public function setImageUrl($value) |
111 | 111 | { |
112 | - $this->setViewState('ImageUrl',$value,''); |
|
112 | + $this->setViewState('ImageUrl', $value, ''); |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | /** |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function getDataImageUrlField() |
119 | 119 | { |
120 | - return $this->getViewState('DataImageUrlField',''); |
|
120 | + return $this->getViewState('DataImageUrlField', ''); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | */ |
126 | 126 | public function setDataImageUrlField($value) |
127 | 127 | { |
128 | - $this->setViewState('DataImageUrlField',$value,''); |
|
128 | + $this->setViewState('DataImageUrlField', $value, ''); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | /** |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | */ |
134 | 134 | public function getDataImageUrlFormatString() |
135 | 135 | { |
136 | - return $this->getViewState('DataImageUrlFormatString',''); |
|
136 | + return $this->getViewState('DataImageUrlFormatString', ''); |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | /** |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public function setDataImageUrlFormatString($value) |
143 | 143 | { |
144 | - $this->setViewState('DataImageUrlFormatString',$value,''); |
|
144 | + $this->setViewState('DataImageUrlFormatString', $value, ''); |
|
145 | 145 | } |
146 | 146 | |
147 | 147 | /** |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | */ |
150 | 150 | public function getButtonType() |
151 | 151 | { |
152 | - return $this->getViewState('ButtonType',TButtonColumnType::LinkButton); |
|
152 | + return $this->getViewState('ButtonType', TButtonColumnType::LinkButton); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | /** |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | */ |
158 | 158 | public function setButtonType($value) |
159 | 159 | { |
160 | - $this->setViewState('ButtonType',TPropertyValue::ensureEnum($value,'Prado\\Web\\UI\\WebControls\\TButtonColumnType'),TButtonColumnType::LinkButton); |
|
160 | + $this->setViewState('ButtonType', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TButtonColumnType'), TButtonColumnType::LinkButton); |
|
161 | 161 | } |
162 | 162 | |
163 | 163 | /** |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | */ |
166 | 166 | public function getCommandName() |
167 | 167 | { |
168 | - return $this->getViewState('CommandName',''); |
|
168 | + return $this->getViewState('CommandName', ''); |
|
169 | 169 | } |
170 | 170 | |
171 | 171 | /** |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | */ |
175 | 175 | public function setCommandName($value) |
176 | 176 | { |
177 | - $this->setViewState('CommandName',$value,''); |
|
177 | + $this->setViewState('CommandName', $value, ''); |
|
178 | 178 | } |
179 | 179 | |
180 | 180 | /** |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public function getCausesValidation() |
184 | 184 | { |
185 | - return $this->getViewState('CausesValidation',true); |
|
185 | + return $this->getViewState('CausesValidation', true); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | /** |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | */ |
191 | 191 | public function setCausesValidation($value) |
192 | 192 | { |
193 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
193 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
194 | 194 | } |
195 | 195 | |
196 | 196 | /** |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | */ |
199 | 199 | public function getValidationGroup() |
200 | 200 | { |
201 | - return $this->getViewState('ValidationGroup',''); |
|
201 | + return $this->getViewState('ValidationGroup', ''); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | */ |
207 | 207 | public function setValidationGroup($value) |
208 | 208 | { |
209 | - $this->setViewState('ValidationGroup',$value,''); |
|
209 | + $this->setViewState('ValidationGroup', $value, ''); |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | /** |
@@ -217,7 +217,7 @@ discard block |
||
217 | 217 | * @param integer the index to the Columns property that the cell resides in. |
218 | 218 | * @param string the type of cell (Header,Footer,Item,AlternatingItem,EditItem,SelectedItem) |
219 | 219 | */ |
220 | - public function initializeCell($cell,$columnIndex,$itemType) |
|
220 | + public function initializeCell($cell, $columnIndex, $itemType) |
|
221 | 221 | { |
222 | 222 | if($itemType===TListItemType::Item || $itemType===TListItemType::AlternatingItem || $itemType===TListItemType::SelectedItem || $itemType===TListItemType::EditItem) |
223 | 223 | { |
@@ -237,12 +237,12 @@ discard block |
||
237 | 237 | $button->setCausesValidation($this->getCausesValidation()); |
238 | 238 | $button->setValidationGroup($this->getValidationGroup()); |
239 | 239 | if($this->getDataTextField()!=='' || ($buttonType===TButtonColumnType::ImageButton && $this->getDataImageUrlField()!=='')) |
240 | - $button->attachEventHandler('OnDataBinding',array($this,'dataBindColumn')); |
|
240 | + $button->attachEventHandler('OnDataBinding', array($this, 'dataBindColumn')); |
|
241 | 241 | $cell->getControls()->add($button); |
242 | - $cell->registerObject('Button',$button); |
|
242 | + $cell->registerObject('Button', $button); |
|
243 | 243 | } |
244 | 244 | else |
245 | - parent::initializeCell($cell,$columnIndex,$itemType); |
|
245 | + parent::initializeCell($cell, $columnIndex, $itemType); |
|
246 | 246 | } |
247 | 247 | |
248 | 248 | /** |
@@ -250,20 +250,20 @@ discard block |
||
250 | 250 | * This method is invoked when datagrid performs databinding. |
251 | 251 | * It populates the content of the cell with the relevant data from data source. |
252 | 252 | */ |
253 | - public function dataBindColumn($sender,$param) |
|
253 | + public function dataBindColumn($sender, $param) |
|
254 | 254 | { |
255 | 255 | if($sender instanceof \Prado\Web\UI\IButtonControl) |
256 | 256 | { |
257 | 257 | if(($field=$this->getDataTextField())!=='') |
258 | 258 | { |
259 | - $value=$this->getDataFieldValue($sender->getNamingContainer()->getData(),$field); |
|
260 | - $text=$this->formatDataValue($this->getDataTextFormatString(),$value); |
|
259 | + $value=$this->getDataFieldValue($sender->getNamingContainer()->getData(), $field); |
|
260 | + $text=$this->formatDataValue($this->getDataTextFormatString(), $value); |
|
261 | 261 | $sender->setText($text); |
262 | 262 | } |
263 | 263 | if(($sender instanceof TImageButton) && ($field=$this->getDataImageUrlField())!=='') |
264 | 264 | { |
265 | - $value=$this->getDataFieldValue($sender->getNamingContainer()->getData(),$field); |
|
266 | - $url=$this->formatDataValue($this->getDataImageUrlFormatString(),$value); |
|
265 | + $value=$this->getDataFieldValue($sender->getNamingContainer()->getData(), $field); |
|
266 | + $url=$this->formatDataValue($this->getDataImageUrlFormatString(), $value); |
|
267 | 267 | $sender->setImageUrl($url); |
268 | 268 | } |
269 | 269 | } |
@@ -106,8 +106,7 @@ discard block |
||
106 | 106 | { |
107 | 107 | if($this->getEnableClientScript() && $this->needPostBackScript()) |
108 | 108 | $this->renderClientControlScript($writer); |
109 | - } |
|
110 | - else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
109 | + } else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
|
111 | 110 | $writer->addAttribute('disabled','disabled'); |
112 | 111 | parent::addAttributesToRender($writer); |
113 | 112 | } |
@@ -141,8 +140,7 @@ discard block |
||
141 | 140 | { |
142 | 141 | $group=$this->getValidationGroup(); |
143 | 142 | return $this->getPage()->getValidators($group)->getCount()>0; |
144 | - } |
|
145 | - else |
|
143 | + } else |
|
146 | 144 | return false; |
147 | 145 | } |
148 | 146 |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function getEnableClientScript() |
80 | 80 | { |
81 | - return $this->getViewState('EnableClientScript',true); |
|
81 | + return $this->getViewState('EnableClientScript', true); |
|
82 | 82 | } |
83 | 83 | |
84 | 84 | /** |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | */ |
87 | 87 | public function setEnableClientScript($value) |
88 | 88 | { |
89 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
89 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
90 | 90 | } |
91 | 91 | |
92 | 92 | /** |
@@ -98,16 +98,16 @@ discard block |
||
98 | 98 | { |
99 | 99 | $page=$this->getPage(); |
100 | 100 | $page->ensureRenderInForm($this); |
101 | - $writer->addAttribute('type','image'); |
|
101 | + $writer->addAttribute('type', 'image'); |
|
102 | 102 | if(($uniqueID=$this->getUniqueID())!=='') |
103 | - $writer->addAttribute('name',$uniqueID); |
|
103 | + $writer->addAttribute('name', $uniqueID); |
|
104 | 104 | if($this->getEnabled(true)) |
105 | 105 | { |
106 | 106 | if($this->getEnableClientScript() && $this->needPostBackScript()) |
107 | 107 | $this->renderClientControlScript($writer); |
108 | 108 | } |
109 | 109 | else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
110 | - $writer->addAttribute('disabled','disabled'); |
|
110 | + $writer->addAttribute('disabled', 'disabled'); |
|
111 | 111 | parent::addAttributesToRender($writer); |
112 | 112 | } |
113 | 113 | |
@@ -116,9 +116,9 @@ discard block |
||
116 | 116 | */ |
117 | 117 | protected function renderClientControlScript($writer) |
118 | 118 | { |
119 | - $writer->addAttribute('id',$this->getClientID()); |
|
120 | - $cs = $this->getPage()->getClientScript(); |
|
121 | - $cs->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions()); |
|
119 | + $writer->addAttribute('id', $this->getClientID()); |
|
120 | + $cs=$this->getPage()->getClientScript(); |
|
121 | + $cs->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions()); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | if($this->getCausesValidation()) |
140 | 140 | { |
141 | 141 | $group=$this->getValidationGroup(); |
142 | - return $this->getPage()->getValidators($group)->getCount()>0; |
|
142 | + return $this->getPage()->getValidators($group)->getCount() > 0; |
|
143 | 143 | } |
144 | 144 | else |
145 | 145 | return false; |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function setIsDefaultButton($value) |
152 | 152 | { |
153 | - $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value),false); |
|
153 | + $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value), false); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
@@ -176,10 +176,10 @@ discard block |
||
176 | 176 | */ |
177 | 177 | protected function getPostBackOptions() |
178 | 178 | { |
179 | - $options['ID'] = $this->getClientID(); |
|
180 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
181 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
182 | - $options['EventTarget'] = $this->getUniqueID(); |
|
179 | + $options['ID']=$this->getClientID(); |
|
180 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
181 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
182 | + $options['EventTarget']=$this->getUniqueID(); |
|
183 | 183 | |
184 | 184 | return $options; |
185 | 185 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | * @param array the input data collection |
192 | 192 | * @return boolean whether the data of the component has been changed |
193 | 193 | */ |
194 | - public function loadPostData($key,$values) |
|
194 | + public function loadPostData($key, $values) |
|
195 | 195 | { |
196 | 196 | $uid=$this->getUniqueID(); |
197 | 197 | if(isset($values["{$uid}_x"]) && isset($values["{$uid}_y"])) |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | */ |
223 | 223 | public function onClick($param) |
224 | 224 | { |
225 | - $this->raiseEvent('OnClick',$this,$param); |
|
225 | + $this->raiseEvent('OnClick', $this, $param); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | /** |
@@ -234,8 +234,8 @@ discard block |
||
234 | 234 | */ |
235 | 235 | public function onCommand($param) |
236 | 236 | { |
237 | - $this->raiseEvent('OnCommand',$this,$param); |
|
238 | - $this->raiseBubbleEvent($this,$param); |
|
237 | + $this->raiseEvent('OnCommand', $this, $param); |
|
238 | + $this->raiseBubbleEvent($this, $param); |
|
239 | 239 | } |
240 | 240 | |
241 | 241 | /** |
@@ -251,8 +251,8 @@ discard block |
||
251 | 251 | { |
252 | 252 | if($this->getCausesValidation()) |
253 | 253 | $this->getPage()->validate($this->getValidationGroup()); |
254 | - $this->onClick(new TImageClickEventParameter($this->_x,$this->_y)); |
|
255 | - $this->onCommand(new \Prado\Web\UI\TCommandEventParameter($this->getCommandName(),$this->getCommandParameter())); |
|
254 | + $this->onClick(new TImageClickEventParameter($this->_x, $this->_y)); |
|
255 | + $this->onCommand(new \Prado\Web\UI\TCommandEventParameter($this->getCommandName(), $this->getCommandParameter())); |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | /** |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | */ |
271 | 271 | public function getCausesValidation() |
272 | 272 | { |
273 | - return $this->getViewState('CausesValidation',true); |
|
273 | + return $this->getViewState('CausesValidation', true); |
|
274 | 274 | } |
275 | 275 | |
276 | 276 | /** |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | */ |
279 | 279 | public function setCausesValidation($value) |
280 | 280 | { |
281 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
281 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
282 | 282 | } |
283 | 283 | |
284 | 284 | /** |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | */ |
287 | 287 | public function getCommandName() |
288 | 288 | { |
289 | - return $this->getViewState('CommandName',''); |
|
289 | + return $this->getViewState('CommandName', ''); |
|
290 | 290 | } |
291 | 291 | |
292 | 292 | /** |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | */ |
295 | 295 | public function setCommandName($value) |
296 | 296 | { |
297 | - $this->setViewState('CommandName',$value,''); |
|
297 | + $this->setViewState('CommandName', $value, ''); |
|
298 | 298 | } |
299 | 299 | |
300 | 300 | /** |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | */ |
303 | 303 | public function getCommandParameter() |
304 | 304 | { |
305 | - return $this->getViewState('CommandParameter',''); |
|
305 | + return $this->getViewState('CommandParameter', ''); |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | /** |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | */ |
311 | 311 | public function setCommandParameter($value) |
312 | 312 | { |
313 | - $this->setViewState('CommandParameter',$value,''); |
|
313 | + $this->setViewState('CommandParameter', $value, ''); |
|
314 | 314 | } |
315 | 315 | |
316 | 316 | /** |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | */ |
319 | 319 | public function getValidationGroup() |
320 | 320 | { |
321 | - return $this->getViewState('ValidationGroup',''); |
|
321 | + return $this->getViewState('ValidationGroup', ''); |
|
322 | 322 | } |
323 | 323 | |
324 | 324 | /** |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | */ |
327 | 327 | public function setValidationGroup($value) |
328 | 328 | { |
329 | - $this->setViewState('ValidationGroup',$value,''); |
|
329 | + $this->setViewState('ValidationGroup', $value, ''); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | /** |
@@ -219,6 +219,7 @@ discard block |
||
219 | 219 | * If you override this method, be sure to call the parent implementation |
220 | 220 | * so that the event handler can be invoked. |
221 | 221 | * @param TImageClickEventParameter event parameter to be passed to the event handlers |
222 | + * @param TImageClickEventParameter $param |
|
222 | 223 | */ |
223 | 224 | public function onClick($param) |
224 | 225 | { |
@@ -231,6 +232,7 @@ discard block |
||
231 | 232 | * If you override this method, be sure to call the parent implementation |
232 | 233 | * so that the event handlers can be invoked. |
233 | 234 | * @param \Prado\Web\UI\TCommandEventParameter event parameter to be passed to the event handlers |
235 | + * @param \Prado\Web\UI\TCommandEventParameter $param |
|
234 | 236 | */ |
235 | 237 | public function onCommand($param) |
236 | 238 | { |
@@ -58,8 +58,7 @@ |
||
58 | 58 | if ($this->sourcepath === NULL) |
59 | 59 | { |
60 | 60 | $this->sourcepath = $sourcepath; |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->sourcepath->append($sourcepath); |
65 | 64 | } |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function getText() |
38 | 38 | { |
39 | - return $this->getViewState('Text',''); |
|
39 | + return $this->getViewState('Text', ''); |
|
40 | 40 | } |
41 | 41 | |
42 | 42 | /** |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | */ |
46 | 46 | public function setText($value) |
47 | 47 | { |
48 | - $this->setViewState('Text',TPropertyValue::ensureString($value),''); |
|
48 | + $this->setViewState('Text', TPropertyValue::ensureString($value), ''); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function getEncode() |
81 | 81 | { |
82 | - return $this->getViewState('Encode',false); |
|
82 | + return $this->getViewState('Encode', false); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function setEncode($value) |
89 | 89 | { |
90 | - $this->setViewState('Encode',TPropertyValue::ensureBoolean($value),false); |
|
90 | + $this->setViewState('Encode', TPropertyValue::ensureBoolean($value), false); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -58,8 +58,7 @@ |
||
58 | 58 | if ($this->sourcepath === NULL) |
59 | 59 | { |
60 | 60 | $this->sourcepath = $sourcepath; |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->sourcepath->append($sourcepath); |
65 | 64 | } |
@@ -43,12 +43,12 @@ discard block |
||
43 | 43 | */ |
44 | 44 | protected function addAttributesToRender($writer) |
45 | 45 | { |
46 | - $writer->addAttribute('id',$this->getClientID()); |
|
47 | - $writer->addAttribute('method',$this->getMethod()); |
|
46 | + $writer->addAttribute('id', $this->getClientID()); |
|
47 | + $writer->addAttribute('method', $this->getMethod()); |
|
48 | 48 | $uri=$this->getRequest()->getRequestURI(); |
49 | - $writer->addAttribute('action',str_replace('&','&',str_replace('&','&',$uri))); |
|
49 | + $writer->addAttribute('action', str_replace('&', '&', str_replace('&', '&', $uri))); |
|
50 | 50 | if(($enctype=$this->getEnctype())!=='') |
51 | - $writer->addAttribute('enctype',$enctype); |
|
51 | + $writer->addAttribute('enctype', $enctype); |
|
52 | 52 | |
53 | 53 | $attributes=$this->getAttributes(); |
54 | 54 | $attributes->remove('action'); |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | if(($button=$this->findControl($butt))!==null) |
60 | 60 | $this->getPage()->getClientScript()->registerDefaultButton($this, $button); |
61 | 61 | else |
62 | - throw new TInvalidDataValueException('form_defaultbutton_invalid',$butt); |
|
62 | + throw new TInvalidDataValueException('form_defaultbutton_invalid', $butt); |
|
63 | 63 | } |
64 | 64 | } |
65 | 65 | |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function getDefaultButton() |
110 | 110 | { |
111 | - return $this->getViewState('DefaultButton',''); |
|
111 | + return $this->getViewState('DefaultButton', ''); |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | /** |
@@ -119,7 +119,7 @@ discard block |
||
119 | 119 | */ |
120 | 120 | public function setDefaultButton($value) |
121 | 121 | { |
122 | - $this->setViewState('DefaultButton',$value,''); |
|
122 | + $this->setViewState('DefaultButton', $value, ''); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | */ |
128 | 128 | public function getMethod() |
129 | 129 | { |
130 | - return $this->getViewState('Method','post'); |
|
130 | + return $this->getViewState('Method', 'post'); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | */ |
136 | 136 | public function setMethod($value) |
137 | 137 | { |
138 | - $this->setViewState('Method',TPropertyValue::ensureEnum($value,'post','get'),'post'); |
|
138 | + $this->setViewState('Method', TPropertyValue::ensureEnum($value, 'post', 'get'), 'post'); |
|
139 | 139 | } |
140 | 140 | |
141 | 141 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function getEnctype() |
145 | 145 | { |
146 | - return $this->getViewState('Enctype',''); |
|
146 | + return $this->getViewState('Enctype', ''); |
|
147 | 147 | } |
148 | 148 | |
149 | 149 | /** |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | */ |
156 | 156 | public function setEnctype($value) |
157 | 157 | { |
158 | - $this->setViewState('Enctype',$value,''); |
|
158 | + $this->setViewState('Enctype', $value, ''); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | /** |
@@ -235,14 +235,12 @@ |
||
235 | 235 | { |
236 | 236 | $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), $token[0]); |
237 | 237 | $this->onSuggest($parameter); |
238 | - } |
|
239 | - else if($token[1] === '__TJuiAutoComplete_onSuggestionSelected__') |
|
238 | + } else if($token[1] === '__TJuiAutoComplete_onSuggestionSelected__') |
|
240 | 239 | { |
241 | 240 | $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), null, $token[0]); |
242 | 241 | $this->onSuggestionSelected($parameter); |
243 | 242 | } |
244 | - } |
|
245 | - else if($this->getAutoPostBack()) |
|
243 | + } else if($this->getAutoPostBack()) |
|
246 | 244 | parent::raiseCallbackEvent($param); |
247 | 245 | } |
248 | 246 |
@@ -260,6 +260,7 @@ discard block |
||
260 | 260 | * method, be sure to call the parent implementation so that the event |
261 | 261 | * handler can be invoked. |
262 | 262 | * @param TCallbackEventParameter event parameter to be passed to the event handlers |
263 | + * @param TJuiAutoCompleteEventParameter $param |
|
263 | 264 | */ |
264 | 265 | public function onSuggest($param) |
265 | 266 | { |
@@ -272,6 +273,7 @@ discard block |
||
272 | 273 | * method, be sure to call the parent implementation so that the event |
273 | 274 | * handler can be invoked. |
274 | 275 | * @param TCallbackEventParameter event parameter to be passed to the event handlers |
276 | + * @param TJuiAutoCompleteEventParameter $param |
|
275 | 277 | */ |
276 | 278 | public function onSuggestionSelected($param) |
277 | 279 | { |
@@ -131,7 +131,7 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function getOptions() |
133 | 133 | { |
134 | - if (($options=$this->getViewState('JuiOptions'))===null) |
|
134 | + if(($options=$this->getViewState('JuiOptions'))===null) |
|
135 | 135 | { |
136 | 136 | $options=new TJuiControlOptions($this); |
137 | 137 | $this->setViewState('JuiOptions', $options); |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | */ |
213 | 213 | public function getMinChars() |
214 | 214 | { |
215 | - return $this->getViewState('minChars',''); |
|
215 | + return $this->getViewState('minChars', ''); |
|
216 | 216 | } |
217 | 217 | |
218 | 218 | /** |
@@ -236,17 +236,17 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public function raiseCallbackEvent($param) |
238 | 238 | { |
239 | - $token = $param->getCallbackParameter(); |
|
240 | - if(is_array($token) && count($token) == 2) |
|
239 | + $token=$param->getCallbackParameter(); |
|
240 | + if(is_array($token) && count($token)==2) |
|
241 | 241 | { |
242 | - if($token[1] === '__TJuiAutoComplete_onSuggest__') |
|
242 | + if($token[1]==='__TJuiAutoComplete_onSuggest__') |
|
243 | 243 | { |
244 | - $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), $token[0]); |
|
244 | + $parameter=new TJuiAutoCompleteEventParameter($this->getResponse(), $token[0]); |
|
245 | 245 | $this->onSuggest($parameter); |
246 | 246 | } |
247 | - else if($token[1] === '__TJuiAutoComplete_onSuggestionSelected__') |
|
247 | + else if($token[1]==='__TJuiAutoComplete_onSuggestionSelected__') |
|
248 | 248 | { |
249 | - $parameter = new TJuiAutoCompleteEventParameter($this->getResponse(), null, $token[0]); |
|
249 | + $parameter=new TJuiAutoCompleteEventParameter($this->getResponse(), null, $token[0]); |
|
250 | 250 | $this->onSuggestionSelected($parameter); |
251 | 251 | } |
252 | 252 | } |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | public function getResultPanel() |
304 | 304 | { |
305 | 305 | if($this->_resultPanel===null) |
306 | - $this->_resultPanel = $this->createResultPanel(); |
|
306 | + $this->_resultPanel=$this->createResultPanel(); |
|
307 | 307 | return $this->_resultPanel; |
308 | 308 | } |
309 | 309 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | */ |
313 | 313 | protected function createResultPanel() |
314 | 314 | { |
315 | - $panel = new TPanel; |
|
315 | + $panel=new TPanel; |
|
316 | 316 | $this->getControls()->add($panel); |
317 | 317 | $panel->setID('result'); |
318 | 318 | return $panel; |
@@ -324,7 +324,7 @@ discard block |
||
324 | 324 | public function getSuggestions() |
325 | 325 | { |
326 | 326 | if($this->_repeater===null) |
327 | - $this->_repeater = $this->createRepeater(); |
|
327 | + $this->_repeater=$this->createRepeater(); |
|
328 | 328 | return $this->_repeater; |
329 | 329 | } |
330 | 330 | |
@@ -333,8 +333,8 @@ discard block |
||
333 | 333 | */ |
334 | 334 | protected function createRepeater() |
335 | 335 | { |
336 | - $repeater = new TRepeater; |
|
337 | - $repeater->setItemTemplate(new TTemplate('<%# $this->Data %>',null)); |
|
336 | + $repeater=new TRepeater; |
|
337 | + $repeater->setItemTemplate(new TTemplate('<%# $this->Data %>', null)); |
|
338 | 338 | $this->getControls()->add($repeater); |
339 | 339 | return $repeater; |
340 | 340 | } |
@@ -376,12 +376,12 @@ discard block |
||
376 | 376 | { |
377 | 377 | $data=array(); |
378 | 378 | $items=$this->getSuggestions()->getItems(); |
379 | - $writer = new TTextWriter; |
|
380 | - for($i=0; $i<$items->Count; $i++) |
|
379 | + $writer=new TTextWriter; |
|
380 | + for($i=0; $i < $items->Count; $i++) |
|
381 | 381 | { |
382 | 382 | $items->itemAt($i)->render($writer); |
383 | 383 | $item=$writer->flush(); |
384 | - $data[]=array( 'id' => $i, 'label' => $item); |
|
384 | + $data[]=array('id' => $i, 'label' => $item); |
|
385 | 385 | } |
386 | 386 | |
387 | 387 | $this->getResponse()->getAdapter()->setResponseData($data); |
@@ -393,25 +393,25 @@ discard block |
||
393 | 393 | */ |
394 | 394 | protected function getPostBackOptions() |
395 | 395 | { |
396 | - $options = $this->getOptions()->toArray(); |
|
396 | + $options=$this->getOptions()->toArray(); |
|
397 | 397 | |
398 | - if(strlen($separator = $this->getSeparator())) |
|
399 | - $options['Separators'] = $separator; |
|
398 | + if(strlen($separator=$this->getSeparator())) |
|
399 | + $options['Separators']=$separator; |
|
400 | 400 | |
401 | 401 | if($this->getAutoPostBack()) |
402 | 402 | { |
403 | - $options = array_merge($options,parent::getPostBackOptions()); |
|
404 | - $options['AutoPostBack'] = true; |
|
403 | + $options=array_merge($options, parent::getPostBackOptions()); |
|
404 | + $options['AutoPostBack']=true; |
|
405 | 405 | } |
406 | - if(strlen($textCssClass = $this->getTextCssClass())) |
|
407 | - $options['textCssClass'] = $textCssClass; |
|
408 | - $options['minLength'] = $this->getMinChars(); |
|
409 | - $options['delay'] = $this->getFrequency()*1000.0; |
|
410 | - $options['appendTo'] = '#'.$this->getResultPanel()->getClientID(); |
|
411 | - $options['ID'] = $this->getClientID(); |
|
412 | - $options['EventTarget'] = $this->getUniqueID(); |
|
413 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
414 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
406 | + if(strlen($textCssClass=$this->getTextCssClass())) |
|
407 | + $options['textCssClass']=$textCssClass; |
|
408 | + $options['minLength']=$this->getMinChars(); |
|
409 | + $options['delay']=$this->getFrequency() * 1000.0; |
|
410 | + $options['appendTo']='#'.$this->getResultPanel()->getClientID(); |
|
411 | + $options['ID']=$this->getClientID(); |
|
412 | + $options['EventTarget']=$this->getUniqueID(); |
|
413 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
414 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
415 | 415 | return $options; |
416 | 416 | } |
417 | 417 |
@@ -58,8 +58,7 @@ |
||
58 | 58 | if ($this->sourcepath === NULL) |
59 | 59 | { |
60 | 60 | $this->sourcepath = $sourcepath; |
61 | - } |
|
62 | - else |
|
61 | + } else |
|
63 | 62 | { |
64 | 63 | $this->sourcepath->append($sourcepath); |
65 | 64 | } |
@@ -135,7 +135,6 @@ discard block |
||
135 | 135 | * Raises the onDrop event. |
136 | 136 | * The drop parameters are encapsulated into a {@link TDropContainerEventParameter} |
137 | 137 | * |
138 | - * @param object $dropControlId |
|
139 | 138 | */ |
140 | 139 | public function onDrop ($dropParams) |
141 | 140 | { |
@@ -223,7 +222,7 @@ discard block |
||
223 | 222 | /** |
224 | 223 | * Override parent implementation to return the container control collection. |
225 | 224 | * |
226 | - * @return TControlCollection |
|
225 | + * @return \Prado\Web\UI\TControlCollection |
|
227 | 226 | */ |
228 | 227 | public function getControls() |
229 | 228 | { |
@@ -137,9 +137,9 @@ discard block |
||
137 | 137 | * |
138 | 138 | * @param object $dropControlId |
139 | 139 | */ |
140 | - public function onDrop ($dropParams) |
|
140 | + public function onDrop($dropParams) |
|
141 | 141 | { |
142 | - $this->raiseEvent('OnDrop', $this, new TDropContainerEventParameter ($dropParams)); |
|
142 | + $this->raiseEvent('OnDrop', $this, new TDropContainerEventParameter($dropParams)); |
|
143 | 143 | |
144 | 144 | } |
145 | 145 | |
@@ -161,11 +161,11 @@ discard block |
||
161 | 161 | */ |
162 | 162 | protected function getPostBackOptions() |
163 | 163 | { |
164 | - $options['ID'] = $this->getClientID(); |
|
165 | - $options['EventTarget'] = $this->getUniqueID(); |
|
164 | + $options['ID']=$this->getClientID(); |
|
165 | + $options['EventTarget']=$this->getUniqueID(); |
|
166 | 166 | |
167 | - $options['accept'] = $this->getAcceptCssClass(); |
|
168 | - $options['hoverclass'] = $this->getHoverCssClass(); |
|
167 | + $options['accept']=$this->getAcceptCssClass(); |
|
168 | + $options['hoverclass']=$this->getHoverCssClass(); |
|
169 | 169 | return $options; |
170 | 170 | } |
171 | 171 | |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | protected function addAttributesToRender($writer) |
198 | 198 | { |
199 | 199 | parent::addAttributesToRender($writer); |
200 | - $writer->addAttribute('id',$this->getClientID()); |
|
200 | + $writer->addAttribute('id', $this->getClientID()); |
|
201 | 201 | |
202 | 202 | $this->getPage()->getClientScript()->registerPradoScript('dragdrop'); |
203 | 203 | $this->getActiveControl()->registerCallbackClientScript( |
@@ -210,11 +210,11 @@ discard block |
||
210 | 210 | * child controls. This container will be a TActivePanel, in order to allow user |
211 | 211 | * to update its content on callback. |
212 | 212 | */ |
213 | - public function createChildControls () |
|
213 | + public function createChildControls() |
|
214 | 214 | { |
215 | - if ($this->_container===null) |
|
215 | + if($this->_container===null) |
|
216 | 216 | { |
217 | - $this->_container= new TActivePanel; |
|
217 | + $this->_container=new TActivePanel; |
|
218 | 218 | $this->_container->setId($this->getId(false).'_content'); |
219 | 219 | parent::getControls()->add($this->_container); |
220 | 220 | } |
@@ -238,17 +238,17 @@ discard block |
||
238 | 238 | * is defered until OnPreRender event is raised. |
239 | 239 | * @param THtmlWriter html writer |
240 | 240 | */ |
241 | - public function render ($writer) |
|
241 | + public function render($writer) |
|
242 | 242 | { |
243 | 243 | if($this->getHasPreRendered()) |
244 | 244 | { |
245 | 245 | parent::render($writer); |
246 | 246 | if($this->getActiveControl()->canUpdateClientSide()) |
247 | - $this->getPage()->getCallbackClient()->replaceContent($this->_container,$writer); |
|
247 | + $this->getPage()->getCallbackClient()->replaceContent($this->_container, $writer); |
|
248 | 248 | } |
249 | 249 | else |
250 | 250 | { |
251 | - $this->getPage()->getAdapter()->registerControlToRender($this->_container,$writer); |
|
251 | + $this->getPage()->getAdapter()->registerControlToRender($this->_container, $writer); |
|
252 | 252 | } |
253 | 253 | } |
254 | 254 | } |
@@ -223,14 +223,12 @@ discard block |
||
223 | 223 | // this is the most secure method, file info can't be forged from client side, no matter what |
224 | 224 | $token = md5('TActiveFileUpload::Params::'.$this->ClientID.'::'+rand(1000*1000,9999*1000)); |
225 | 225 | $cache->set($token, serialize($params), 5*60); // expire in 5 minutes - the callback should arrive back in seconds, actually |
226 | - } |
|
227 | - else |
|
226 | + } else |
|
228 | 227 | if ($mgr = Prado::getApplication()->getSecurityManager()) |
229 | 228 | { |
230 | 229 | // this is a less secure method, file info can be still forged from client side, but only if attacker knows the secret application key |
231 | 230 | $token = urlencode(base64_encode($mgr->encrypt(serialize($params)))); |
232 | - } |
|
233 | - else |
|
231 | + } else |
|
234 | 232 | throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely'); |
235 | 233 | |
236 | 234 | return $token; |
@@ -244,14 +242,12 @@ discard block |
||
244 | 242 | assert($v!=''); |
245 | 243 | $cache->delete($token); // remove it from cache so it can't be used again and won't take up space either |
246 | 244 | $params = unserialize($v); |
247 | - } |
|
248 | - else |
|
245 | + } else |
|
249 | 246 | if ($mgr = Prado::getApplication()->getSecurityManager()) |
250 | 247 | { |
251 | 248 | $v = $mgr->decrypt(base64_decode(urldecode($token))); |
252 | 249 | $params = unserialize($v); |
253 | - } |
|
254 | - else |
|
250 | + } else |
|
255 | 251 | throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely'); |
256 | 252 | |
257 | 253 | assert($params instanceof TActiveFileUploadCallbackParams); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | */ |
54 | 54 | class TActiveFileUpload extends TFileUpload implements IActiveControl, ICallbackEventHandler, INamingContainer |
55 | 55 | { |
56 | - const SCRIPT_PATH = 'activefileupload'; |
|
56 | + const SCRIPT_PATH='activefileupload'; |
|
57 | 57 | |
58 | 58 | /** |
59 | 59 | * @var THiddenField a flag to tell which component is doing the callback. |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * TActiveControlAdapter. If you override this class, be sure to set the |
83 | 83 | * adapter appropriately by, for example, by calling this constructor. |
84 | 84 | */ |
85 | - public function __construct(){ |
|
85 | + public function __construct() { |
|
86 | 86 | parent::__construct(); |
87 | 87 | $this->setAdapter(new TActiveControlAdapter($this)); |
88 | 88 | } |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | */ |
95 | 95 | protected function getAssetUrl($file='') |
96 | 96 | { |
97 | - $base = $this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
97 | + $base=$this->getPage()->getClientScript()->getPradoScriptAssetUrl(); |
|
98 | 98 | return $base.'/'.self::SCRIPT_PATH.'/'.$file; |
99 | 99 | } |
100 | 100 | |
@@ -107,18 +107,18 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function onFileUpload($param) |
109 | 109 | { |
110 | - if ($this->_flag->getValue() && $this->getPage()->getIsPostBack() && $param == $this->_target->getUniqueID()){ |
|
110 | + if($this->_flag->getValue() && $this->getPage()->getIsPostBack() && $param==$this->_target->getUniqueID()) { |
|
111 | 111 | // save the file so that it will persist past the end of this return. |
112 | - $localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),'')); |
|
112 | + $localName=str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()), '')); |
|
113 | 113 | parent::saveAs($localName); |
114 | - $this->_localName = $localName; |
|
114 | + $this->_localName=$localName; |
|
115 | 115 | |
116 | - $params = new TActiveFileUploadCallbackParams; |
|
117 | - $params->localName = $localName; |
|
118 | - $params->fileName = addslashes($this->getFileName()); |
|
119 | - $params->fileSize = $this->getFileSize(); |
|
120 | - $params->fileType = $this->getFileType(); |
|
121 | - $params->errorCode = $this->getErrorCode(); |
|
116 | + $params=new TActiveFileUploadCallbackParams; |
|
117 | + $params->localName=$localName; |
|
118 | + $params->fileName=addslashes($this->getFileName()); |
|
119 | + $params->fileSize=$this->getFileSize(); |
|
120 | + $params->fileType=$this->getFileType(); |
|
121 | + $params->errorCode=$this->getErrorCode(); |
|
122 | 122 | |
123 | 123 | // return some javascript to display a completion status. |
124 | 124 | echo <<<EOS |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @return string the path where the uploaded file will be stored temporarily, in namespace format |
144 | 144 | * default "Application.runtime.*" |
145 | 145 | */ |
146 | - public function getTempPath(){ |
|
146 | + public function getTempPath() { |
|
147 | 147 | return $this->getViewState('TempPath', 'Application.runtime.*'); |
148 | 148 | } |
149 | 149 | |
@@ -151,15 +151,15 @@ discard block |
||
151 | 151 | * @param string the path where the uploaded file will be stored temporarily in namespace format |
152 | 152 | * default "Application.runtime.*" |
153 | 153 | */ |
154 | - public function setTempPath($value){ |
|
155 | - $this->setViewState('TempPath',$value,'Application.runtime.*'); |
|
154 | + public function setTempPath($value) { |
|
155 | + $this->setViewState('TempPath', $value, 'Application.runtime.*'); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | /** |
159 | 159 | * @return boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true. |
160 | 160 | * Note: When set to false, you will need to trigger the callback yourself. |
161 | 161 | */ |
162 | - public function getAutoPostBack(){ |
|
162 | + public function getAutoPostBack() { |
|
163 | 163 | return $this->getViewState('AutoPostBack', true); |
164 | 164 | } |
165 | 165 | |
@@ -167,28 +167,28 @@ discard block |
||
167 | 167 | * @param boolean a value indicating whether an automatic callback to the server will occur whenever the user modifies the text in the TTextBox control and then tabs out of the component. Defaults to true. |
168 | 168 | * Note: When set to false, you will need to trigger the callback yourself. |
169 | 169 | */ |
170 | - public function setAutoPostBack($value){ |
|
171 | - $this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),true); |
|
170 | + public function setAutoPostBack($value) { |
|
171 | + $this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), true); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
175 | 175 | * @return string A chuck of javascript that will need to be called if {{@link getAutoPostBack AutoPostBack} is set to false} |
176 | 176 | */ |
177 | - public function getCallbackJavascript(){ |
|
177 | + public function getCallbackJavascript() { |
|
178 | 178 | return "Prado.WebUI.TActiveFileUpload.fileChanged(\"{$this->getClientID()}\")"; |
179 | 179 | } |
180 | 180 | |
181 | 181 | /** |
182 | 182 | * @throws TInvalidDataValueException if the {@link getTempPath TempPath} is not writable. |
183 | 183 | */ |
184 | - public function onInit($sender){ |
|
184 | + public function onInit($sender) { |
|
185 | 185 | parent::onInit($sender); |
186 | 186 | |
187 | - if (!Prado::getApplication()->getCache()) |
|
188 | - if (!Prado::getApplication()->getSecurityManager()) |
|
187 | + if(!Prado::getApplication()->getCache()) |
|
188 | + if(!Prado::getApplication()->getSecurityManager()) |
|
189 | 189 | throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely'); |
190 | 190 | |
191 | - if (!is_writable(Prado::getPathOfNamespace($this->getTempPath()))){ |
|
191 | + if(!is_writable(Prado::getPathOfNamespace($this->getTempPath()))) { |
|
192 | 192 | throw new TInvalidDataValueException("activefileupload_temppath_invalid", $this->getTempPath()); |
193 | 193 | } |
194 | 194 | } |
@@ -200,17 +200,17 @@ discard block |
||
200 | 200 | * This method is mainly used by framework and control developers. |
201 | 201 | * @param TCallbackEventParameter the event parameter |
202 | 202 | */ |
203 | - public function raiseCallbackEvent($param){ |
|
204 | - $cp = $param->getCallbackParameter(); |
|
205 | - if ($key = $cp->targetID == $this->_target->getUniqueID()){ |
|
203 | + public function raiseCallbackEvent($param) { |
|
204 | + $cp=$param->getCallbackParameter(); |
|
205 | + if($key=$cp->targetID==$this->_target->getUniqueID()) { |
|
206 | 206 | |
207 | - $params = $this->popParamsByToken($cp->callbackToken); |
|
207 | + $params=$this->popParamsByToken($cp->callbackToken); |
|
208 | 208 | |
209 | - $_FILES[$key]['name'] = stripslashes($params->fileName); |
|
210 | - $_FILES[$key]['size'] = intval($params->fileSize); |
|
211 | - $_FILES[$key]['type'] = $params->fileType; |
|
212 | - $_FILES[$key]['error'] = intval($params->errorCode); |
|
213 | - $_FILES[$key]['tmp_name'] = $params->localName; |
|
209 | + $_FILES[$key]['name']=stripslashes($params->fileName); |
|
210 | + $_FILES[$key]['size']=intval($params->fileSize); |
|
211 | + $_FILES[$key]['type']=$params->fileType; |
|
212 | + $_FILES[$key]['error']=intval($params->errorCode); |
|
213 | + $_FILES[$key]['tmp_name']=$params->localName; |
|
214 | 214 | $this->loadPostData($key, null); |
215 | 215 | |
216 | 216 | $this->raiseEvent('OnFileUpload', $this, $param); |
@@ -229,17 +229,17 @@ discard block |
||
229 | 229 | |
230 | 230 | protected function pushParamsAndGetToken(TActiveFileUploadCallbackParams $params) |
231 | 231 | { |
232 | - if ($cache = Prado::getApplication()->getCache()) |
|
232 | + if($cache=Prado::getApplication()->getCache()) |
|
233 | 233 | { |
234 | 234 | // this is the most secure method, file info can't be forged from client side, no matter what |
235 | - $token = md5('TActiveFileUpload::Params::'.$this->ClientID.'::'+rand(1000*1000,9999*1000)); |
|
236 | - $cache->set($token, serialize($params), 5*60); // expire in 5 minutes - the callback should arrive back in seconds, actually |
|
235 | + $token=md5('TActiveFileUpload::Params::'.$this->ClientID.'::'+rand(1000 * 1000, 9999 * 1000)); |
|
236 | + $cache->set($token, serialize($params), 5 * 60); // expire in 5 minutes - the callback should arrive back in seconds, actually |
|
237 | 237 | } |
238 | 238 | else |
239 | - if ($mgr = Prado::getApplication()->getSecurityManager()) |
|
239 | + if($mgr=Prado::getApplication()->getSecurityManager()) |
|
240 | 240 | { |
241 | 241 | // this is a less secure method, file info can be still forged from client side, but only if attacker knows the secret application key |
242 | - $token = urlencode(base64_encode($mgr->encrypt(serialize($params)))); |
|
242 | + $token=urlencode(base64_encode($mgr->encrypt(serialize($params)))); |
|
243 | 243 | } |
244 | 244 | else |
245 | 245 | throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely'); |
@@ -249,18 +249,18 @@ discard block |
||
249 | 249 | |
250 | 250 | protected function popParamsByToken($token) |
251 | 251 | { |
252 | - if ($cache = Prado::getApplication()->getCache()) |
|
252 | + if($cache=Prado::getApplication()->getCache()) |
|
253 | 253 | { |
254 | - $v = $cache->get($token); |
|
254 | + $v=$cache->get($token); |
|
255 | 255 | assert($v!=''); |
256 | 256 | $cache->delete($token); // remove it from cache so it can't be used again and won't take up space either |
257 | - $params = unserialize($v); |
|
257 | + $params=unserialize($v); |
|
258 | 258 | } |
259 | 259 | else |
260 | - if ($mgr = Prado::getApplication()->getSecurityManager()) |
|
260 | + if($mgr=Prado::getApplication()->getSecurityManager()) |
|
261 | 261 | { |
262 | - $v = $mgr->decrypt(base64_decode(urldecode($token))); |
|
263 | - $params = unserialize($v); |
|
262 | + $v=$mgr->decrypt(base64_decode(urldecode($token))); |
|
263 | + $params=unserialize($v); |
|
264 | 264 | } |
265 | 265 | else |
266 | 266 | throw new Exception('TActiveFileUpload needs either an application level cache or a security manager to work securely'); |
@@ -277,19 +277,19 @@ discard block |
||
277 | 277 | { |
278 | 278 | parent::onPreRender($param); |
279 | 279 | |
280 | - if(!$this->getPage()->getIsPostBack() && isset($_GET['TActiveFileUpload_InputId']) && isset($_GET['TActiveFileUpload_TargetId']) && $_GET['TActiveFileUpload_InputId'] == $this->getClientID()) |
|
280 | + if(!$this->getPage()->getIsPostBack() && isset($_GET['TActiveFileUpload_InputId']) && isset($_GET['TActiveFileUpload_TargetId']) && $_GET['TActiveFileUpload_InputId']==$this->getClientID()) |
|
281 | 281 | { |
282 | 282 | // tricky workaround to intercept "uploaded file too big" error: real uploads happens in onFileUpload instead |
283 | - $this->_errorCode = UPLOAD_ERR_FORM_SIZE; |
|
284 | - $localName = str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()),'')); |
|
285 | - $fileName = addslashes($this->getFileName()); |
|
283 | + $this->_errorCode=UPLOAD_ERR_FORM_SIZE; |
|
284 | + $localName=str_replace('\\', '/', tempnam(Prado::getPathOfNamespace($this->getTempPath()), '')); |
|
285 | + $fileName=addslashes($this->getFileName()); |
|
286 | 286 | |
287 | - $params = new TActiveFileUploadCallbackParams; |
|
288 | - $params->localName = $localName; |
|
289 | - $params->fileName = $fileName; |
|
290 | - $params->fileSize = $this->getFileSize(); |
|
291 | - $params->fileType = $this->getFileType(); |
|
292 | - $params->errorCode = $this->getErrorCode(); |
|
287 | + $params=new TActiveFileUploadCallbackParams; |
|
288 | + $params->localName=$localName; |
|
289 | + $params->fileName=$fileName; |
|
290 | + $params->fileSize=$this->getFileSize(); |
|
291 | + $params->fileType=$this->getFileType(); |
|
292 | + $params->errorCode=$this->getErrorCode(); |
|
293 | 293 | |
294 | 294 | echo <<<EOS |
295 | 295 | <script language="Javascript"> |
@@ -311,29 +311,29 @@ discard block |
||
311 | 311 | { |
312 | 312 | $this->getPage()->getClientScript()->registerPradoScript('activefileupload'); |
313 | 313 | |
314 | - $this->_flag = new THiddenField; |
|
314 | + $this->_flag=new THiddenField; |
|
315 | 315 | $this->_flag->setID('Flag'); |
316 | 316 | $this->getControls()->add($this->_flag); |
317 | 317 | |
318 | - $this->_busy = new TImage; |
|
318 | + $this->_busy=new TImage; |
|
319 | 319 | $this->_busy->setID('Busy'); |
320 | 320 | $this->_busy->setImageUrl($this->getAssetUrl('ActiveFileUploadIndicator.gif')); |
321 | 321 | $this->_busy->setStyle("display:none"); |
322 | 322 | $this->getControls()->add($this->_busy); |
323 | 323 | |
324 | - $this->_success = new TImage; |
|
324 | + $this->_success=new TImage; |
|
325 | 325 | $this->_success->setID('Success'); |
326 | 326 | $this->_success->setImageUrl($this->getAssetUrl('ActiveFileUploadComplete.png')); |
327 | 327 | $this->_success->setStyle("display:none"); |
328 | 328 | $this->getControls()->add($this->_success); |
329 | 329 | |
330 | - $this->_error = new TImage; |
|
330 | + $this->_error=new TImage; |
|
331 | 331 | $this->_error->setID('Error'); |
332 | 332 | $this->_error->setImageUrl($this->getAssetUrl('ActiveFileUploadError.png')); |
333 | 333 | $this->_error->setStyle("display:none"); |
334 | 334 | $this->getControls()->add($this->_error); |
335 | 335 | |
336 | - $this->_target = new TInlineFrame; |
|
336 | + $this->_target=new TInlineFrame; |
|
337 | 337 | $this->_target->setID('Target'); |
338 | 338 | $this->_target->setFrameUrl($this->getAssetUrl('ActiveFileUploadBlank.html')); |
339 | 339 | $this->_target->setStyle("width:0px; height:0px;"); |
@@ -344,10 +344,10 @@ discard block |
||
344 | 344 | /** |
345 | 345 | * Removes localfile on ending of the callback. |
346 | 346 | */ |
347 | - public function onUnload($param){ |
|
348 | - if ($this->getPage()->getIsCallback() && |
|
347 | + public function onUnload($param) { |
|
348 | + if($this->getPage()->getIsCallback() && |
|
349 | 349 | $this->getHasFile() && |
350 | - file_exists($this->getLocalName())){ |
|
350 | + file_exists($this->getLocalName())) { |
|
351 | 351 | unlink($this->getLocalName()); |
352 | 352 | } |
353 | 353 | parent::onUnload($param); |
@@ -356,7 +356,7 @@ discard block |
||
356 | 356 | /** |
357 | 357 | * @return TBaseActiveCallbackControl standard callback control options. |
358 | 358 | */ |
359 | - public function getActiveControl(){ |
|
359 | + public function getActiveControl() { |
|
360 | 360 | return $this->getAdapter()->getBaseActiveControl(); |
361 | 361 | } |
362 | 362 | |
@@ -372,17 +372,17 @@ discard block |
||
372 | 372 | * Adds ID attribute, and renders the javascript for active component. |
373 | 373 | * @param THtmlWriter the writer used for the rendering purpose |
374 | 374 | */ |
375 | - public function addAttributesToRender($writer){ |
|
375 | + public function addAttributesToRender($writer) { |
|
376 | 376 | parent::addAttributesToRender($writer); |
377 | - $writer->addAttribute('id',$this->getClientID()); |
|
377 | + $writer->addAttribute('id', $this->getClientID()); |
|
378 | 378 | |
379 | - $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(),$this->getClientOptions()); |
|
379 | + $this->getActiveControl()->registerCallbackClientScript($this->getClientClassName(), $this->getClientOptions()); |
|
380 | 380 | } |
381 | 381 | |
382 | 382 | /** |
383 | 383 | * @return string corresponding javascript class name for this control. |
384 | 384 | */ |
385 | - protected function getClientClassName(){ |
|
385 | + protected function getClientClassName() { |
|
386 | 386 | return 'Prado.WebUI.TActiveFileUpload'; |
387 | 387 | } |
388 | 388 | |
@@ -396,18 +396,18 @@ discard block |
||
396 | 396 | * completeID => complete client ID, |
397 | 397 | * errorID => error client ID) |
398 | 398 | */ |
399 | - protected function getClientOptions(){ |
|
400 | - $options['ID'] = $this->getClientID(); |
|
401 | - $options['EventTarget'] = $this->getUniqueID(); |
|
402 | - |
|
403 | - $options['inputID'] = $this->getClientID(); |
|
404 | - $options['flagID'] = $this->_flag->getClientID(); |
|
405 | - $options['targetID'] = $this->_target->getUniqueID(); |
|
406 | - $options['formID'] = $this->getPage()->getForm()->getClientID(); |
|
407 | - $options['indicatorID'] = $this->_busy->getClientID(); |
|
408 | - $options['completeID'] = $this->_success->getClientID(); |
|
409 | - $options['errorID'] = $this->_error->getClientID(); |
|
410 | - $options['autoPostBack'] = $this->getAutoPostBack(); |
|
399 | + protected function getClientOptions() { |
|
400 | + $options['ID']=$this->getClientID(); |
|
401 | + $options['EventTarget']=$this->getUniqueID(); |
|
402 | + |
|
403 | + $options['inputID']=$this->getClientID(); |
|
404 | + $options['flagID']=$this->_flag->getClientID(); |
|
405 | + $options['targetID']=$this->_target->getUniqueID(); |
|
406 | + $options['formID']=$this->getPage()->getForm()->getClientID(); |
|
407 | + $options['indicatorID']=$this->_busy->getClientID(); |
|
408 | + $options['completeID']=$this->_success->getClientID(); |
|
409 | + $options['errorID']=$this->_error->getClientID(); |
|
410 | + $options['autoPostBack']=$this->getAutoPostBack(); |
|
411 | 411 | return $options; |
412 | 412 | } |
413 | 413 | |
@@ -418,12 +418,12 @@ discard block |
||
418 | 418 | * If true, you will not be able to save the uploaded file again. |
419 | 419 | * @return boolean true if the file saving is successful |
420 | 420 | */ |
421 | - public function saveAs($fileName,$deleteTempFile=true){ |
|
422 | - if (($this->getErrorCode()===UPLOAD_ERR_OK) && (file_exists($this->getLocalName()))){ |
|
423 | - if ($deleteTempFile) |
|
424 | - return rename($this->getLocalName(),$fileName); |
|
421 | + public function saveAs($fileName, $deleteTempFile=true) { |
|
422 | + if(($this->getErrorCode()===UPLOAD_ERR_OK) && (file_exists($this->getLocalName()))) { |
|
423 | + if($deleteTempFile) |
|
424 | + return rename($this->getLocalName(), $fileName); |
|
425 | 425 | else |
426 | - return copy($this->getLocalName(),$fileName); |
|
426 | + return copy($this->getLocalName(), $fileName); |
|
427 | 427 | } else |
428 | 428 | return false; |
429 | 429 | } |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | * @return TImage the image displayed when an upload |
433 | 433 | * completes successfully. |
434 | 434 | */ |
435 | - public function getSuccessImage(){ |
|
435 | + public function getSuccessImage() { |
|
436 | 436 | $this->ensureChildControls(); |
437 | 437 | return $this->_success; |
438 | 438 | } |
@@ -441,7 +441,7 @@ discard block |
||
441 | 441 | * @return TImage the image displayed when an upload |
442 | 442 | * does not complete successfully. |
443 | 443 | */ |
444 | - public function getErrorImage(){ |
|
444 | + public function getErrorImage() { |
|
445 | 445 | $this->ensureChildControls(); |
446 | 446 | return $this->_error; |
447 | 447 | } |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | * @return TImage the image displayed when an upload |
451 | 451 | * is in progress. |
452 | 452 | */ |
453 | - public function getBusyImage(){ |
|
453 | + public function getBusyImage() { |
|
454 | 454 | $this->ensureChildControls(); |
455 | 455 | return $this->_busy; |
456 | 456 | } |
@@ -127,8 +127,7 @@ discard block |
||
127 | 127 | $button->setCssClass($this->getButtonCssClass()); |
128 | 128 | return $button; |
129 | 129 | } |
130 | - } |
|
131 | - else if($buttonType===TPagerButtonType::ImageButton) |
|
130 | + } else if($buttonType===TPagerButtonType::ImageButton) |
|
132 | 131 | { |
133 | 132 | $button = new TActiveImageButton; |
134 | 133 | $button->setImageUrl($this->getPageImageUrl($text,$commandName)); |
@@ -136,8 +135,7 @@ discard block |
||
136 | 135 | $button->Visible = true; |
137 | 136 | else |
138 | 137 | $button->Visible = false; |
139 | - } |
|
140 | - else |
|
138 | + } else |
|
141 | 139 | { |
142 | 140 | $button=new TActiveButton; |
143 | 141 | if(!$enabled) |
@@ -197,8 +195,7 @@ discard block |
||
197 | 195 | TWebControl::render($writer); |
198 | 196 | if($this->getActiveControl()->canUpdateClientSide()) |
199 | 197 | $this->getPage()->getCallbackClient()->replaceContent($this,$writer); |
200 | - } |
|
201 | - else |
|
198 | + } else |
|
202 | 199 | { |
203 | 200 | $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
204 | 201 | } |
@@ -94,11 +94,11 @@ discard block |
||
94 | 94 | ); |
95 | 95 | |
96 | 96 | $this->getControls()->add($list); |
97 | - $list->setDataSource(range(1,$this->getPageCount())); |
|
97 | + $list->setDataSource(range(1, $this->getPageCount())); |
|
98 | 98 | $list->dataBind(); |
99 | 99 | $list->setSelectedIndex($this->getCurrentPageIndex()); |
100 | 100 | $list->setAutoPostBack(true); |
101 | - $list->attachEventHandler('OnSelectedIndexChanged',array($this,'listIndexChanged')); |
|
101 | + $list->attachEventHandler('OnSelectedIndexChanged', array($this, 'listIndexChanged')); |
|
102 | 102 | $list->attachEventHandler('OnCallback', array($this, 'handleCallback')); |
103 | 103 | } |
104 | 104 | |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | * @param string CommandParameter corresponding to the OnCommand event of the button |
115 | 115 | * @return mixed the button instance |
116 | 116 | */ |
117 | - protected function createPagerButton($buttonType,$enabled,$text,$commandName,$commandParameter) |
|
117 | + protected function createPagerButton($buttonType, $enabled, $text, $commandName, $commandParameter) |
|
118 | 118 | { |
119 | 119 | if($buttonType===TPagerButtonType::LinkButton) |
120 | 120 | { |
@@ -130,12 +130,12 @@ discard block |
||
130 | 130 | } |
131 | 131 | else if($buttonType===TPagerButtonType::ImageButton) |
132 | 132 | { |
133 | - $button = new TActiveImageButton; |
|
134 | - $button->setImageUrl($this->getPageImageUrl($text,$commandName)); |
|
133 | + $button=new TActiveImageButton; |
|
134 | + $button->setImageUrl($this->getPageImageUrl($text, $commandName)); |
|
135 | 135 | if($enabled) |
136 | - $button->Visible = true; |
|
136 | + $button->Visible=true; |
|
137 | 137 | else |
138 | - $button->Visible = false; |
|
138 | + $button->Visible=false; |
|
139 | 139 | } |
140 | 140 | else |
141 | 141 | { |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | |
147 | 147 | if($buttonType===TPagerButtonType::ImageButton) |
148 | 148 | { |
149 | - $button->ImageUrl = $text; |
|
149 | + $button->ImageUrl=$text; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | $button->setText($text); |
@@ -170,14 +170,14 @@ discard block |
||
170 | 170 | * @param mixed $sender |
171 | 171 | * @param TCallbackEventParameter $param |
172 | 172 | */ |
173 | - public function handleCallback ($sender,$param) |
|
173 | + public function handleCallback($sender, $param) |
|
174 | 174 | { |
175 | 175 | // Update all the buttons pagers attached to the same control. |
176 | 176 | // Dropdown pagers doesn't need to be re-rendered. |
177 | 177 | $controlToPaginate=$this->getControlToPaginate(); |
178 | - foreach ($this->getNamingContainer()->findControlsByType('TActivePager', false) as $control) |
|
178 | + foreach($this->getNamingContainer()->findControlsByType('TActivePager', false) as $control) |
|
179 | 179 | { |
180 | - if ($control->getMode() !== TPagerMode::DropDownList && $control->getControlToPaginate()===$controlToPaginate) |
|
180 | + if($control->getMode()!==TPagerMode::DropDownList && $control->getControlToPaginate()===$controlToPaginate) |
|
181 | 181 | { |
182 | 182 | $control->render($param->getNewWriter()); |
183 | 183 | // FIXME : With some very fast machine, the getNewWriter() consecutive calls are in the same microsecond, resulting |
@@ -189,18 +189,18 @@ discard block |
||
189 | 189 | $this->onCallback($param); |
190 | 190 | } |
191 | 191 | |
192 | - public function render ($writer) |
|
192 | + public function render($writer) |
|
193 | 193 | { |
194 | 194 | if($this->getHasPreRendered()) |
195 | 195 | { |
196 | - $this->setDisplay(($this->getPageCount()==1)?TDisplayStyle::None:TDisplayStyle::Dynamic); |
|
196 | + $this->setDisplay(($this->getPageCount()==1) ? TDisplayStyle::None : TDisplayStyle::Dynamic); |
|
197 | 197 | TWebControl::render($writer); |
198 | 198 | if($this->getActiveControl()->canUpdateClientSide()) |
199 | - $this->getPage()->getCallbackClient()->replaceContent($this,$writer); |
|
199 | + $this->getPage()->getCallbackClient()->replaceContent($this, $writer); |
|
200 | 200 | } |
201 | 201 | else |
202 | 202 | { |
203 | - $this->getPage()->getAdapter()->registerControlToRender($this,$writer); |
|
203 | + $this->getPage()->getAdapter()->registerControlToRender($this, $writer); |
|
204 | 204 | } |
205 | 205 | } |
206 | 206 | } |