@@ -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 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | */ |
45 | 45 | public function getAlign() |
46 | 46 | { |
47 | - return $this->getViewState('Align',TInlineFrameAlign::NotSet); |
|
47 | + return $this->getViewState('Align', TInlineFrameAlign::NotSet); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | /** |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | */ |
53 | 53 | public function setAlign($value) |
54 | 54 | { |
55 | - $this->setViewState('Align',TPropertyValue::ensureEnum($value,'TInlineFrameAlign'),TInlineFrameAlign::NotSet); |
|
55 | + $this->setViewState('Align', TPropertyValue::ensureEnum($value, 'TInlineFrameAlign'), TInlineFrameAlign::NotSet); |
|
56 | 56 | } |
57 | 57 | |
58 | 58 | /** |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | */ |
61 | 61 | public function getDescriptionUrl() |
62 | 62 | { |
63 | - return $this->getViewState('DescriptionUrl',''); |
|
63 | + return $this->getViewState('DescriptionUrl', ''); |
|
64 | 64 | } |
65 | 65 | |
66 | 66 | /** |
@@ -68,7 +68,7 @@ discard block |
||
68 | 68 | */ |
69 | 69 | public function setDescriptionUrl($value) |
70 | 70 | { |
71 | - $this->setViewState('DescriptionUrl',$value,''); |
|
71 | + $this->setViewState('DescriptionUrl', $value, ''); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | */ |
77 | 77 | public function getShowBorder() |
78 | 78 | { |
79 | - return $this->getViewState('ShowBorder',true); |
|
79 | + return $this->getViewState('ShowBorder', true); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | */ |
85 | 85 | public function setShowBorder($value) |
86 | 86 | { |
87 | - $this->setViewState('ShowBorder',TPropertyValue::ensureBoolean($value),true); |
|
87 | + $this->setViewState('ShowBorder', TPropertyValue::ensureBoolean($value), true); |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | /** |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | */ |
93 | 93 | public function getFrameUrl() |
94 | 94 | { |
95 | - return $this->getViewState('FrameUrl',''); |
|
95 | + return $this->getViewState('FrameUrl', ''); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | /** |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | */ |
101 | 101 | public function setFrameUrl($value) |
102 | 102 | { |
103 | - $this->setViewState('FrameUrl',$value,''); |
|
103 | + $this->setViewState('FrameUrl', $value, ''); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function getScrollBars() |
136 | 136 | { |
137 | - return $this->getViewState('ScrollBars',TInlineFrameScrollBars::Auto); |
|
137 | + return $this->getViewState('ScrollBars', TInlineFrameScrollBars::Auto); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | /** |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | */ |
143 | 143 | public function setScrollBars($value) |
144 | 144 | { |
145 | - $this->setViewState('ScrollBars',TPropertyValue::ensureEnum($value,'TInlineFrameScrollBars'),TInlineFrameScrollBars::Auto); |
|
145 | + $this->setViewState('ScrollBars', TPropertyValue::ensureEnum($value, 'TInlineFrameScrollBars'), TInlineFrameScrollBars::Auto); |
|
146 | 146 | } |
147 | 147 | |
148 | 148 | /** |
@@ -150,7 +150,7 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function getWidth() |
152 | 152 | { |
153 | - return $this->getViewState('Width',-1); |
|
153 | + return $this->getViewState('Width', -1); |
|
154 | 154 | } |
155 | 155 | |
156 | 156 | /** |
@@ -158,9 +158,9 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public function setWidth($value) |
160 | 160 | { |
161 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
161 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
162 | 162 | $value=-1; |
163 | - $this->setViewState('Width',$value,-1); |
|
163 | + $this->setViewState('Width', $value, -1); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | /** |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | */ |
169 | 169 | public function getHeight() |
170 | 170 | { |
171 | - return $this->getViewState('Height',-1); |
|
171 | + return $this->getViewState('Height', -1); |
|
172 | 172 | } |
173 | 173 | |
174 | 174 | /** |
@@ -176,9 +176,9 @@ discard block |
||
176 | 176 | */ |
177 | 177 | public function setHeight($value) |
178 | 178 | { |
179 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
179 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
180 | 180 | $value=-1; |
181 | - $this->setViewState('Height',$value,-1); |
|
181 | + $this->setViewState('Height', $value, -1); |
|
182 | 182 | } |
183 | 183 | |
184 | 184 | /** |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | */ |
188 | 188 | public function getMarginWidth() |
189 | 189 | { |
190 | - return $this->getViewState('MarginWidth',-1); |
|
190 | + return $this->getViewState('MarginWidth', -1); |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | /** |
@@ -196,9 +196,9 @@ discard block |
||
196 | 196 | */ |
197 | 197 | public function setMarginWidth($value) |
198 | 198 | { |
199 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
199 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
200 | 200 | $value=-1; |
201 | - $this->setViewState('MarginWidth',$value,-1); |
|
201 | + $this->setViewState('MarginWidth', $value, -1); |
|
202 | 202 | } |
203 | 203 | |
204 | 204 | /** |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | */ |
208 | 208 | public function getMarginHeight() |
209 | 209 | { |
210 | - return $this->getViewState('MarginHeight',-1); |
|
210 | + return $this->getViewState('MarginHeight', -1); |
|
211 | 211 | } |
212 | 212 | |
213 | 213 | /** |
@@ -216,9 +216,9 @@ discard block |
||
216 | 216 | */ |
217 | 217 | public function setMarginHeight($value) |
218 | 218 | { |
219 | - if(($value=TPropertyValue::ensureInteger($value))<0) |
|
219 | + if(($value=TPropertyValue::ensureInteger($value)) < 0) |
|
220 | 220 | $value=-1; |
221 | - $this->setViewState('MarginHeight',$value,-1); |
|
221 | + $this->setViewState('MarginHeight', $value, -1); |
|
222 | 222 | } |
223 | 223 | |
224 | 224 | /** |
@@ -229,37 +229,37 @@ discard block |
||
229 | 229 | protected function addAttributesToRender($writer) |
230 | 230 | { |
231 | 231 | if($this->getID()!=='') |
232 | - $writer->addAttribute('name',$this->getUniqueID()); |
|
232 | + $writer->addAttribute('name', $this->getUniqueID()); |
|
233 | 233 | |
234 | 234 | if(($src=$this->getFrameUrl())!=='') |
235 | - $writer->addAttribute('src',$src); |
|
235 | + $writer->addAttribute('src', $src); |
|
236 | 236 | |
237 | 237 | if(($align=strtolower($this->getAlign()))!=='notset') |
238 | - $writer->addAttribute('align',$align); |
|
238 | + $writer->addAttribute('align', $align); |
|
239 | 239 | |
240 | 240 | $scrollBars=$this->getScrollBars(); |
241 | 241 | if($scrollBars===TInlineFrameScrollBars::None) |
242 | - $writer->addAttribute('scrolling','no'); |
|
242 | + $writer->addAttribute('scrolling', 'no'); |
|
243 | 243 | else if($scrollBars===TInlineFrameScrollBars::Both) |
244 | - $writer->addAttribute('scrolling','yes'); |
|
244 | + $writer->addAttribute('scrolling', 'yes'); |
|
245 | 245 | |
246 | - if (!$this->getShowBorder()) |
|
247 | - $writer->addAttribute('frameborder','0'); |
|
246 | + if(!$this->getShowBorder()) |
|
247 | + $writer->addAttribute('frameborder', '0'); |
|
248 | 248 | |
249 | 249 | if(($longdesc=$this->getDescriptionUrl())!=='') |
250 | - $writer->addAttribute('longdesc',$longdesc); |
|
250 | + $writer->addAttribute('longdesc', $longdesc); |
|
251 | 251 | |
252 | - if (($width=$this->getWidth())!==-1) |
|
253 | - $writer->addAttribute('width',$width); |
|
252 | + if(($width=$this->getWidth())!==-1) |
|
253 | + $writer->addAttribute('width', $width); |
|
254 | 254 | |
255 | - if (($height=$this->getHeight())!==-1) |
|
256 | - $writer->addAttribute('height',$height); |
|
255 | + if(($height=$this->getHeight())!==-1) |
|
256 | + $writer->addAttribute('height', $height); |
|
257 | 257 | |
258 | 258 | if(($marginheight=$this->getMarginHeight())!==-1) |
259 | - $writer->addAttribute('marginheight',$marginheight); |
|
259 | + $writer->addAttribute('marginheight', $marginheight); |
|
260 | 260 | |
261 | 261 | if(($marginwidth=$this->getMarginWidth())!==-1) |
262 | - $writer->addAttribute('marginwidth',$marginwidth); |
|
262 | + $writer->addAttribute('marginwidth', $marginwidth); |
|
263 | 263 | |
264 | 264 | parent::addAttributesToRender($writer); |
265 | 265 | } |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | protected function __getZappableSleepProps(&$exprops) |
63 | 63 | { |
64 | 64 | parent::__getZappableSleepProps($exprops); |
65 | - if ($this->_flags===0) |
|
66 | - $exprops[] = "\0TFont\0_flags"; |
|
67 | - if ($this->_name==='') |
|
68 | - $exprops[] = "\0TFont\0_name"; |
|
69 | - if ($this->_size==='') |
|
70 | - $exprops[] = "\0TFont\0_size"; |
|
65 | + if($this->_flags===0) |
|
66 | + $exprops[]="\0TFont\0_flags"; |
|
67 | + if($this->_name==='') |
|
68 | + $exprops[]="\0TFont\0_name"; |
|
69 | + if($this->_size==='') |
|
70 | + $exprops[]="\0TFont\0_size"; |
|
71 | 71 | } |
72 | 72 | |
73 | 73 | /** |
@@ -83,11 +83,11 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public function setBold($value) |
85 | 85 | { |
86 | - $this->_flags |= self::IS_SET_BOLD; |
|
86 | + $this->_flags|=self::IS_SET_BOLD; |
|
87 | 87 | if(TPropertyValue::ensureBoolean($value)) |
88 | - $this->_flags |= self::IS_BOLD; |
|
88 | + $this->_flags|=self::IS_BOLD; |
|
89 | 89 | else |
90 | - $this->_flags &= ~self::IS_BOLD; |
|
90 | + $this->_flags&=~self::IS_BOLD; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -103,11 +103,11 @@ discard block |
||
103 | 103 | */ |
104 | 104 | public function setItalic($value) |
105 | 105 | { |
106 | - $this->_flags |= self::IS_SET_ITALIC; |
|
106 | + $this->_flags|=self::IS_SET_ITALIC; |
|
107 | 107 | if(TPropertyValue::ensureBoolean($value)) |
108 | - $this->_flags |= self::IS_ITALIC; |
|
108 | + $this->_flags|=self::IS_ITALIC; |
|
109 | 109 | else |
110 | - $this->_flags &= ~self::IS_ITALIC; |
|
110 | + $this->_flags&=~self::IS_ITALIC; |
|
111 | 111 | } |
112 | 112 | |
113 | 113 | /** |
@@ -123,11 +123,11 @@ discard block |
||
123 | 123 | */ |
124 | 124 | public function setOverline($value) |
125 | 125 | { |
126 | - $this->_flags |= self::IS_SET_OVERLINE; |
|
126 | + $this->_flags|=self::IS_SET_OVERLINE; |
|
127 | 127 | if(TPropertyValue::ensureBoolean($value)) |
128 | - $this->_flags |= self::IS_OVERLINE; |
|
128 | + $this->_flags|=self::IS_OVERLINE; |
|
129 | 129 | else |
130 | - $this->_flags &= ~self::IS_OVERLINE; |
|
130 | + $this->_flags&=~self::IS_OVERLINE; |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | /** |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public function setSize($value) |
145 | 145 | { |
146 | - $this->_flags |= self::IS_SET_SIZE; |
|
146 | + $this->_flags|=self::IS_SET_SIZE; |
|
147 | 147 | $this->_size=$value; |
148 | 148 | } |
149 | 149 | |
@@ -160,11 +160,11 @@ discard block |
||
160 | 160 | */ |
161 | 161 | public function setStrikeout($value) |
162 | 162 | { |
163 | - $this->_flags |= self::IS_SET_STRIKEOUT; |
|
163 | + $this->_flags|=self::IS_SET_STRIKEOUT; |
|
164 | 164 | if(TPropertyValue::ensureBoolean($value)) |
165 | - $this->_flags |= self::IS_STRIKEOUT; |
|
165 | + $this->_flags|=self::IS_STRIKEOUT; |
|
166 | 166 | else |
167 | - $this->_flags &= ~self::IS_STRIKEOUT; |
|
167 | + $this->_flags&=~self::IS_STRIKEOUT; |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function setUnderline($value) |
182 | 182 | { |
183 | - $this->_flags |= self::IS_SET_UNDERLINE; |
|
183 | + $this->_flags|=self::IS_SET_UNDERLINE; |
|
184 | 184 | if(TPropertyValue::ensureBoolean($value)) |
185 | - $this->_flags |= self::IS_UNDERLINE; |
|
185 | + $this->_flags|=self::IS_UNDERLINE; |
|
186 | 186 | else |
187 | - $this->_flags &= ~self::IS_UNDERLINE; |
|
187 | + $this->_flags&=~self::IS_UNDERLINE; |
|
188 | 188 | } |
189 | 189 | |
190 | 190 | /** |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function setName($value) |
202 | 202 | { |
203 | - $this->_flags |= self::IS_SET_NAME; |
|
203 | + $this->_flags|=self::IS_SET_NAME; |
|
204 | 204 | $this->_name=$value; |
205 | 205 | } |
206 | 206 | |
@@ -283,9 +283,9 @@ discard block |
||
283 | 283 | return ''; |
284 | 284 | $str=''; |
285 | 285 | if($this->_flags & self::IS_SET_BOLD) |
286 | - $str.='font-weight:'.(($this->_flags & self::IS_BOLD)?'bold;':'normal;'); |
|
286 | + $str.='font-weight:'.(($this->_flags & self::IS_BOLD) ? 'bold;' : 'normal;'); |
|
287 | 287 | if($this->_flags & self::IS_SET_ITALIC) |
288 | - $str.='font-style:'.(($this->_flags & self::IS_ITALIC)?'italic;':'normal;'); |
|
288 | + $str.='font-style:'.(($this->_flags & self::IS_ITALIC) ? 'italic;' : 'normal;'); |
|
289 | 289 | $textDec=''; |
290 | 290 | if($this->_flags & self::IS_UNDERLINE) |
291 | 291 | $textDec.='underline'; |
@@ -312,9 +312,9 @@ discard block |
||
312 | 312 | if($this->_flags===0) |
313 | 313 | return; |
314 | 314 | if($this->_flags & self::IS_SET_BOLD) |
315 | - $writer->addStyleAttribute('font-weight',(($this->_flags & self::IS_BOLD)?'bold':'normal')); |
|
315 | + $writer->addStyleAttribute('font-weight', (($this->_flags & self::IS_BOLD) ? 'bold' : 'normal')); |
|
316 | 316 | if($this->_flags & self::IS_SET_ITALIC) |
317 | - $writer->addStyleAttribute('font-style',(($this->_flags & self::IS_ITALIC)?'italic':'normal')); |
|
317 | + $writer->addStyleAttribute('font-style', (($this->_flags & self::IS_ITALIC) ? 'italic' : 'normal')); |
|
318 | 318 | $textDec=''; |
319 | 319 | if($this->_flags & self::IS_UNDERLINE) |
320 | 320 | $textDec.='underline'; |
@@ -324,10 +324,10 @@ discard block |
||
324 | 324 | $textDec.=' line-through'; |
325 | 325 | $textDec=ltrim($textDec); |
326 | 326 | if($textDec!=='') |
327 | - $writer->addStyleAttribute('text-decoration',$textDec); |
|
327 | + $writer->addStyleAttribute('text-decoration', $textDec); |
|
328 | 328 | if($this->_size!=='') |
329 | - $writer->addStyleAttribute('font-size',$this->_size); |
|
329 | + $writer->addStyleAttribute('font-size', $this->_size); |
|
330 | 330 | if($this->_name!=='') |
331 | - $writer->addStyleAttribute('font-family',$this->_name); |
|
331 | + $writer->addStyleAttribute('font-family', $this->_name); |
|
332 | 332 | } |
333 | 333 | } |
@@ -73,10 +73,10 @@ discard block |
||
73 | 73 | */ |
74 | 74 | public function getActiveViewIndex() |
75 | 75 | { |
76 | - if($this->_cachedActiveViewIndex>-1) |
|
76 | + if($this->_cachedActiveViewIndex > -1) |
|
77 | 77 | return $this->_cachedActiveViewIndex; |
78 | 78 | else |
79 | - return $this->getControlState('ActiveViewIndex',-1); |
|
79 | + return $this->getControlState('ActiveViewIndex', -1); |
|
80 | 80 | } |
81 | 81 | |
82 | 82 | /** |
@@ -85,21 +85,21 @@ discard block |
||
85 | 85 | */ |
86 | 86 | public function setActiveViewIndex($value) |
87 | 87 | { |
88 | - if(($index=TPropertyValue::ensureInteger($value))<0) |
|
88 | + if(($index=TPropertyValue::ensureInteger($value)) < 0) |
|
89 | 89 | $index=-1; |
90 | 90 | $views=$this->getViews(); |
91 | 91 | $count=$views->getCount(); |
92 | - if($count===0 && $this->getControlStage()<TControl::CS_CHILD_INITIALIZED) |
|
92 | + if($count===0 && $this->getControlStage() < TControl::CS_CHILD_INITIALIZED) |
|
93 | 93 | $this->_cachedActiveViewIndex=$index; |
94 | - else if($index<$count) |
|
94 | + else if($index < $count) |
|
95 | 95 | { |
96 | - $this->setControlState('ActiveViewIndex',$index,-1); |
|
96 | + $this->setControlState('ActiveViewIndex', $index, -1); |
|
97 | 97 | $this->_cachedActiveViewIndex=-1; |
98 | - if($index>=0) |
|
99 | - $this->activateView($views->itemAt($index),true); |
|
98 | + if($index >= 0) |
|
99 | + $this->activateView($views->itemAt($index), true); |
|
100 | 100 | } |
101 | 101 | else |
102 | - throw new TInvalidDataValueException('multiview_activeviewindex_invalid',$index); |
|
102 | + throw new TInvalidDataValueException('multiview_activeviewindex_invalid', $index); |
|
103 | 103 | } |
104 | 104 | |
105 | 105 | /** |
@@ -110,13 +110,13 @@ discard block |
||
110 | 110 | { |
111 | 111 | $index=$this->getActiveViewIndex(); |
112 | 112 | $views=$this->getViews(); |
113 | - if($index>=$views->getCount()) |
|
114 | - throw new TInvalidDataValueException('multiview_activeviewindex_invalid',$index); |
|
115 | - if($index<0) |
|
113 | + if($index >= $views->getCount()) |
|
114 | + throw new TInvalidDataValueException('multiview_activeviewindex_invalid', $index); |
|
115 | + if($index < 0) |
|
116 | 116 | return null; |
117 | 117 | $view=$views->itemAt($index); |
118 | 118 | if(!$view->getActive()) |
119 | - $this->activateView($view,false); |
|
119 | + $this->activateView($view, false); |
|
120 | 120 | return $view; |
121 | 121 | } |
122 | 122 | |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | */ |
127 | 127 | public function setActiveView($view) |
128 | 128 | { |
129 | - if(($index=$this->getViews()->indexOf($view))>=0) |
|
129 | + if(($index=$this->getViews()->indexOf($view)) >= 0) |
|
130 | 130 | $this->setActiveViewIndex($index); |
131 | 131 | else |
132 | 132 | throw new TInvalidOperationException('multiview_view_inexistent'); |
@@ -138,11 +138,11 @@ discard block |
||
138 | 138 | * @param TView the view to be activated |
139 | 139 | * @param boolean whether to trigger OnActiveViewChanged event. |
140 | 140 | */ |
141 | - protected function activateView($view,$triggerViewChangedEvent=true) |
|
141 | + protected function activateView($view, $triggerViewChangedEvent=true) |
|
142 | 142 | { |
143 | 143 | if($view->getActive()) |
144 | 144 | return; |
145 | - $triggerEvent=$triggerViewChangedEvent && ($this->getControlStage()>=TControl::CS_STATE_LOADED || ($this->getPage() && !$this->getPage()->getIsPostBack())); |
|
145 | + $triggerEvent=$triggerViewChangedEvent && ($this->getControlStage() >= TControl::CS_STATE_LOADED || ($this->getPage() && !$this->getPage()->getIsPostBack())); |
|
146 | 146 | foreach($this->getViews() as $v) |
147 | 147 | { |
148 | 148 | if($v===$view) |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | public function onInit($param) |
190 | 190 | { |
191 | 191 | parent::onInit($param); |
192 | - if($this->_cachedActiveViewIndex>=0) |
|
192 | + if($this->_cachedActiveViewIndex >= 0) |
|
193 | 193 | $this->setActiveViewIndex($this->_cachedActiveViewIndex); |
194 | 194 | } |
195 | 195 | |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public function onActiveViewChanged($param) |
202 | 202 | { |
203 | - $this->raiseEvent('OnActiveViewChanged',$this,$param); |
|
203 | + $this->raiseEvent('OnActiveViewChanged', $this, $param); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | /** |
@@ -210,21 +210,21 @@ discard block |
||
210 | 210 | * @param mixed event parameter |
211 | 211 | * @return boolean whether this event is handled |
212 | 212 | */ |
213 | - public function bubbleEvent($sender,$param) |
|
213 | + public function bubbleEvent($sender, $param) |
|
214 | 214 | { |
215 | 215 | if(!$this->_ignoreBubbleEvents && ($param instanceof TCommandEventParameter)) |
216 | 216 | { |
217 | 217 | switch($param->getCommandName()) |
218 | 218 | { |
219 | 219 | case self::CMD_NEXTVIEW: |
220 | - if(($index=$this->getActiveViewIndex())<$this->getViews()->getCount()-1) |
|
221 | - $this->setActiveViewIndex($index+1); |
|
220 | + if(($index=$this->getActiveViewIndex()) < $this->getViews()->getCount() - 1) |
|
221 | + $this->setActiveViewIndex($index + 1); |
|
222 | 222 | else |
223 | 223 | $this->setActiveViewIndex(-1); |
224 | 224 | return true; |
225 | 225 | case self::CMD_PREVIOUSVIEW: |
226 | - if(($index=$this->getActiveViewIndex())>=0) |
|
227 | - $this->setActiveViewIndex($index-1); |
|
226 | + if(($index=$this->getActiveViewIndex()) >= 0) |
|
227 | + $this->setActiveViewIndex($index - 1); |
|
228 | 228 | return true; |
229 | 229 | case self::CMD_SWITCHVIEWID: |
230 | 230 | $view=$this->findControl($viewID=$param->getCommandParameter()); |
@@ -283,10 +283,10 @@ discard block |
||
283 | 283 | * @param mixed new item |
284 | 284 | * @throws TInvalidDataTypeException if the item to be inserted is neither a string nor a TControl. |
285 | 285 | */ |
286 | - public function insertAt($index,$item) |
|
286 | + public function insertAt($index, $item) |
|
287 | 287 | { |
288 | 288 | if($item instanceof TView) |
289 | - parent::insertAt($index,$item); |
|
289 | + parent::insertAt($index, $item); |
|
290 | 290 | else |
291 | 291 | throw new TInvalidDataTypeException('viewcollection_view_required'); |
292 | 292 | } |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | */ |
318 | 318 | public function onActivate($param) |
319 | 319 | { |
320 | - $this->raiseEvent('OnActivate',$this,$param); |
|
320 | + $this->raiseEvent('OnActivate', $this, $param); |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | /** |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | */ |
327 | 327 | public function onDeactivate($param) |
328 | 328 | { |
329 | - $this->raiseEvent('OnDeactivate',$this,$param); |
|
329 | + $this->raiseEvent('OnDeactivate', $this, $param); |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | /** |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | public function getEnableClientScript() |
81 | 81 | { |
82 | - return $this->getViewState('EnableClientScript',true); |
|
82 | + return $this->getViewState('EnableClientScript', true); |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | /** |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | */ |
88 | 88 | public function setEnableClientScript($value) |
89 | 89 | { |
90 | - $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
|
90 | + $this->setViewState('EnableClientScript', TPropertyValue::ensureBoolean($value), true); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
@@ -99,16 +99,16 @@ discard block |
||
99 | 99 | { |
100 | 100 | $page=$this->getPage(); |
101 | 101 | $page->ensureRenderInForm($this); |
102 | - $writer->addAttribute('type','image'); |
|
102 | + $writer->addAttribute('type', 'image'); |
|
103 | 103 | if(($uniqueID=$this->getUniqueID())!=='') |
104 | - $writer->addAttribute('name',$uniqueID); |
|
104 | + $writer->addAttribute('name', $uniqueID); |
|
105 | 105 | if($this->getEnabled(true)) |
106 | 106 | { |
107 | 107 | if($this->getEnableClientScript() && $this->needPostBackScript()) |
108 | 108 | $this->renderClientControlScript($writer); |
109 | 109 | } |
110 | 110 | else if($this->getEnabled()) // in this case, parent will not render 'disabled' |
111 | - $writer->addAttribute('disabled','disabled'); |
|
111 | + $writer->addAttribute('disabled', 'disabled'); |
|
112 | 112 | parent::addAttributesToRender($writer); |
113 | 113 | } |
114 | 114 | |
@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | */ |
118 | 118 | protected function renderClientControlScript($writer) |
119 | 119 | { |
120 | - $writer->addAttribute('id',$this->getClientID()); |
|
121 | - $cs = $this->getPage()->getClientScript(); |
|
122 | - $cs->registerPostBackControl($this->getClientClassName(),$this->getPostBackOptions()); |
|
120 | + $writer->addAttribute('id', $this->getClientID()); |
|
121 | + $cs=$this->getPage()->getClientScript(); |
|
122 | + $cs->registerPostBackControl($this->getClientClassName(), $this->getPostBackOptions()); |
|
123 | 123 | } |
124 | 124 | |
125 | 125 | /** |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | if($this->getCausesValidation()) |
141 | 141 | { |
142 | 142 | $group=$this->getValidationGroup(); |
143 | - return $this->getPage()->getValidators($group)->getCount()>0; |
|
143 | + return $this->getPage()->getValidators($group)->getCount() > 0; |
|
144 | 144 | } |
145 | 145 | else |
146 | 146 | return false; |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | */ |
152 | 152 | public function setIsDefaultButton($value) |
153 | 153 | { |
154 | - $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value),false); |
|
154 | + $this->setViewState('IsDefaultButton', TPropertyValue::ensureBoolean($value), false); |
|
155 | 155 | } |
156 | 156 | |
157 | 157 | /** |
@@ -177,10 +177,10 @@ discard block |
||
177 | 177 | */ |
178 | 178 | protected function getPostBackOptions() |
179 | 179 | { |
180 | - $options['ID'] = $this->getClientID(); |
|
181 | - $options['CausesValidation'] = $this->getCausesValidation(); |
|
182 | - $options['ValidationGroup'] = $this->getValidationGroup(); |
|
183 | - $options['EventTarget'] = $this->getUniqueID(); |
|
180 | + $options['ID']=$this->getClientID(); |
|
181 | + $options['CausesValidation']=$this->getCausesValidation(); |
|
182 | + $options['ValidationGroup']=$this->getValidationGroup(); |
|
183 | + $options['EventTarget']=$this->getUniqueID(); |
|
184 | 184 | |
185 | 185 | return $options; |
186 | 186 | } |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | * @param array the input data collection |
193 | 193 | * @return boolean whether the data of the component has been changed |
194 | 194 | */ |
195 | - public function loadPostData($key,$values) |
|
195 | + public function loadPostData($key, $values) |
|
196 | 196 | { |
197 | 197 | $uid=$this->getUniqueID(); |
198 | 198 | if(isset($values["{$uid}_x"]) && isset($values["{$uid}_y"])) |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | */ |
224 | 224 | public function onClick($param) |
225 | 225 | { |
226 | - $this->raiseEvent('OnClick',$this,$param); |
|
226 | + $this->raiseEvent('OnClick', $this, $param); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | /** |
@@ -235,8 +235,8 @@ discard block |
||
235 | 235 | */ |
236 | 236 | public function onCommand($param) |
237 | 237 | { |
238 | - $this->raiseEvent('OnCommand',$this,$param); |
|
239 | - $this->raiseBubbleEvent($this,$param); |
|
238 | + $this->raiseEvent('OnCommand', $this, $param); |
|
239 | + $this->raiseBubbleEvent($this, $param); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | /** |
@@ -252,8 +252,8 @@ discard block |
||
252 | 252 | { |
253 | 253 | if($this->getCausesValidation()) |
254 | 254 | $this->getPage()->validate($this->getValidationGroup()); |
255 | - $this->onClick(new TImageClickEventParameter($this->_x,$this->_y)); |
|
256 | - $this->onCommand(new TCommandEventParameter($this->getCommandName(),$this->getCommandParameter())); |
|
255 | + $this->onClick(new TImageClickEventParameter($this->_x, $this->_y)); |
|
256 | + $this->onCommand(new TCommandEventParameter($this->getCommandName(), $this->getCommandParameter())); |
|
257 | 257 | } |
258 | 258 | |
259 | 259 | /** |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | */ |
272 | 272 | public function getCausesValidation() |
273 | 273 | { |
274 | - return $this->getViewState('CausesValidation',true); |
|
274 | + return $this->getViewState('CausesValidation', true); |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | /** |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | */ |
280 | 280 | public function setCausesValidation($value) |
281 | 281 | { |
282 | - $this->setViewState('CausesValidation',TPropertyValue::ensureBoolean($value),true); |
|
282 | + $this->setViewState('CausesValidation', TPropertyValue::ensureBoolean($value), true); |
|
283 | 283 | } |
284 | 284 | |
285 | 285 | /** |
@@ -287,7 +287,7 @@ discard block |
||
287 | 287 | */ |
288 | 288 | public function getCommandName() |
289 | 289 | { |
290 | - return $this->getViewState('CommandName',''); |
|
290 | + return $this->getViewState('CommandName', ''); |
|
291 | 291 | } |
292 | 292 | |
293 | 293 | /** |
@@ -295,7 +295,7 @@ discard block |
||
295 | 295 | */ |
296 | 296 | public function setCommandName($value) |
297 | 297 | { |
298 | - $this->setViewState('CommandName',$value,''); |
|
298 | + $this->setViewState('CommandName', $value, ''); |
|
299 | 299 | } |
300 | 300 | |
301 | 301 | /** |
@@ -303,7 +303,7 @@ discard block |
||
303 | 303 | */ |
304 | 304 | public function getCommandParameter() |
305 | 305 | { |
306 | - return $this->getViewState('CommandParameter',''); |
|
306 | + return $this->getViewState('CommandParameter', ''); |
|
307 | 307 | } |
308 | 308 | |
309 | 309 | /** |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | */ |
312 | 312 | public function setCommandParameter($value) |
313 | 313 | { |
314 | - $this->setViewState('CommandParameter',$value,''); |
|
314 | + $this->setViewState('CommandParameter', $value, ''); |
|
315 | 315 | } |
316 | 316 | |
317 | 317 | /** |
@@ -319,7 +319,7 @@ discard block |
||
319 | 319 | */ |
320 | 320 | public function getValidationGroup() |
321 | 321 | { |
322 | - return $this->getViewState('ValidationGroup',''); |
|
322 | + return $this->getViewState('ValidationGroup', ''); |
|
323 | 323 | } |
324 | 324 | |
325 | 325 | /** |
@@ -327,7 +327,7 @@ discard block |
||
327 | 327 | */ |
328 | 328 | public function setValidationGroup($value) |
329 | 329 | { |
330 | - $this->setViewState('ValidationGroup',$value,''); |
|
330 | + $this->setViewState('ValidationGroup', $value, ''); |
|
331 | 331 | } |
332 | 332 | |
333 | 333 | /** |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | * @param integer X coordinate of the clicking point |
398 | 398 | * @param integer Y coordinate of the clicking point |
399 | 399 | */ |
400 | - public function __construct($x,$y) |
|
400 | + public function __construct($x, $y) |
|
401 | 401 | { |
402 | 402 | $this->_x=$x; |
403 | 403 | $this->_y=$y; |
@@ -76,15 +76,15 @@ |
||
76 | 76 | } |
77 | 77 | catch(Exception $e) |
78 | 78 | { |
79 | - throw new TInvalidDataValueException('conditional_condition_invalid',$this->_condition,$e->getMessage()); |
|
79 | + throw new TInvalidDataValueException('conditional_condition_invalid', $this->_condition, $e->getMessage()); |
|
80 | 80 | } |
81 | 81 | if($result) |
82 | 82 | { |
83 | 83 | if($this->_trueTemplate) |
84 | - $this->_trueTemplate->instantiateIn($this->getTemplateControl(),$this); |
|
84 | + $this->_trueTemplate->instantiateIn($this->getTemplateControl(), $this); |
|
85 | 85 | } |
86 | 86 | else if($this->_falseTemplate) |
87 | - $this->_falseTemplate->instantiateIn($this->getTemplateControl(),$this); |
|
87 | + $this->_falseTemplate->instantiateIn($this->getTemplateControl(), $this); |
|
88 | 88 | $this->_creatingChildren=false; |
89 | 89 | } |
90 | 90 |
@@ -53,18 +53,18 @@ discard block |
||
53 | 53 | { |
54 | 54 | $uniqueID=$this->getUniqueID(); |
55 | 55 | $this->getPage()->ensureRenderInForm($this); |
56 | - $writer->addAttribute('type','hidden'); |
|
56 | + $writer->addAttribute('type', 'hidden'); |
|
57 | 57 | if($uniqueID!=='') |
58 | - $writer->addAttribute('name',$uniqueID); |
|
58 | + $writer->addAttribute('name', $uniqueID); |
|
59 | 59 | if($this->getID()!=='') |
60 | - $writer->addAttribute('id',$this->getClientID()); |
|
60 | + $writer->addAttribute('id', $this->getClientID()); |
|
61 | 61 | if(($value=$this->getValue())!=='') |
62 | - $writer->addAttribute('value',$value); |
|
62 | + $writer->addAttribute('value', $value); |
|
63 | 63 | |
64 | 64 | if($this->getHasAttributes()) |
65 | 65 | { |
66 | 66 | foreach($this->getAttributes() as $name=>$value) |
67 | - $writer->addAttribute($name,$value); |
|
67 | + $writer->addAttribute($name, $value); |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $writer->renderBeginTag('input'); |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | * @param array the input data collection |
79 | 79 | * @return boolean whether the data of the component has been changed |
80 | 80 | */ |
81 | - public function loadPostData($key,$values) |
|
81 | + public function loadPostData($key, $values) |
|
82 | 82 | { |
83 | 83 | $value=$values[$key]; |
84 | 84 | if($value===$this->getValue()) |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | */ |
147 | 147 | public function onValueChanged($param) |
148 | 148 | { |
149 | - $this->raiseEvent('OnValueChanged',$this,$param); |
|
149 | + $this->raiseEvent('OnValueChanged', $this, $param); |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | /** |
@@ -154,7 +154,7 @@ discard block |
||
154 | 154 | */ |
155 | 155 | public function getValue() |
156 | 156 | { |
157 | - return $this->getViewState('Value',''); |
|
157 | + return $this->getViewState('Value', ''); |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | /** |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | */ |
164 | 164 | public function setValue($value) |
165 | 165 | { |
166 | - $this->setViewState('Value',$value,''); |
|
166 | + $this->setViewState('Value', $value, ''); |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | /** |
@@ -37,7 +37,7 @@ discard block |
||
37 | 37 | */ |
38 | 38 | public function getTagName() |
39 | 39 | { |
40 | - return ($this->_tagName !== null) ? $this->_tagName : ($this->_tagName = $this->getDefaultTagName()); |
|
40 | + return ($this->_tagName!==null) ? $this->_tagName : ($this->_tagName=$this->getDefaultTagName()); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | /** |
@@ -61,6 +61,6 @@ discard block |
||
61 | 61 | * @return boolean true if TagName has deviated from the default. |
62 | 62 | */ |
63 | 63 | public function getIsMutated() { |
64 | - return $this->_tagName !== null && $this->_tagName != $this->getDefaultTagName(); |
|
64 | + return $this->_tagName!==null && $this->_tagName!=$this->getDefaultTagName(); |
|
65 | 65 | } |
66 | 66 | } |
@@ -9,12 +9,12 @@ discard block |
||
9 | 9 | * @package System.Web.UI.WebControls.assets |
10 | 10 | */ |
11 | 11 | |
12 | -define('THEME_OPAQUE_BACKGROUND',0x0001); |
|
13 | -define('THEME_NOISY_BACKGROUND',0x0002); |
|
14 | -define('THEME_HAS_GRID',0x0004); |
|
15 | -define('THEME_HAS_SCRIBBLE',0x0008); |
|
16 | -define('THEME_MORPH_BACKGROUND',0x0010); |
|
17 | -define('THEME_SHADOWED_TEXT',0x0020); |
|
12 | +define('THEME_OPAQUE_BACKGROUND', 0x0001); |
|
13 | +define('THEME_NOISY_BACKGROUND', 0x0002); |
|
14 | +define('THEME_HAS_GRID', 0x0004); |
|
15 | +define('THEME_HAS_SCRIBBLE', 0x0008); |
|
16 | +define('THEME_MORPH_BACKGROUND', 0x0010); |
|
17 | +define('THEME_SHADOWED_TEXT', 0x0020); |
|
18 | 18 | |
19 | 19 | require_once(dirname(__FILE__).'/captcha_key.php'); |
20 | 20 | |
@@ -24,10 +24,10 @@ discard block |
||
24 | 24 | if(isset($_GET['options'])) |
25 | 25 | { |
26 | 26 | $str=base64_decode($_GET['options']); |
27 | - if(strlen($str)>32) |
|
27 | + if(strlen($str) > 32) |
|
28 | 28 | { |
29 | - $hash=substr($str,0,32); |
|
30 | - $str=substr($str,32); |
|
29 | + $hash=substr($str, 0, 32); |
|
30 | + $str=substr($str, 32); |
|
31 | 31 | if(md5($privateKey.$str)===$hash) |
32 | 32 | { |
33 | 33 | $options=unserialize($str); |
@@ -37,83 +37,82 @@ discard block |
||
37 | 37 | $alphabet=$options['alphabet']; |
38 | 38 | $fontSize=$options['fontSize']; |
39 | 39 | $theme=$options['theme']; |
40 | - if(($randomSeed=$options['randomSeed'])>0) |
|
40 | + if(($randomSeed=$options['randomSeed']) > 0) |
|
41 | 41 | srand($randomSeed); |
42 | 42 | else |
43 | - srand((int)(microtime()*1000000)); |
|
44 | - $token=generateToken($publicKey,$privateKey,$alphabet,$tokenLength,$caseSensitive); |
|
43 | + srand((int) (microtime() * 1000000)); |
|
44 | + $token=generateToken($publicKey, $privateKey, $alphabet, $tokenLength, $caseSensitive); |
|
45 | 45 | } |
46 | 46 | } |
47 | 47 | } |
48 | 48 | |
49 | -displayToken($token,$fontSize,$theme); |
|
49 | +displayToken($token, $fontSize, $theme); |
|
50 | 50 | |
51 | -function generateToken($publicKey,$privateKey,$alphabet,$tokenLength,$caseSensitive) |
|
51 | +function generateToken($publicKey, $privateKey, $alphabet, $tokenLength, $caseSensitive) |
|
52 | 52 | { |
53 | - $token=substr(hash2string(md5($publicKey.$privateKey),$alphabet).hash2string(md5($privateKey.$publicKey),$alphabet),0,$tokenLength); |
|
54 | - return $caseSensitive?$token:strtoupper($token); |
|
53 | + $token=substr(hash2string(md5($publicKey.$privateKey), $alphabet).hash2string(md5($privateKey.$publicKey), $alphabet), 0, $tokenLength); |
|
54 | + return $caseSensitive ? $token : strtoupper($token); |
|
55 | 55 | } |
56 | 56 | |
57 | -function hash2string($hex,$alphabet) |
|
57 | +function hash2string($hex, $alphabet) |
|
58 | 58 | { |
59 | - if(strlen($alphabet)<2) |
|
59 | + if(strlen($alphabet) < 2) |
|
60 | 60 | $alphabet='234578adefhijmnrtABDEFGHJLMNRT'; |
61 | 61 | $hexLength=strlen($hex); |
62 | 62 | $base=strlen($alphabet); |
63 | 63 | $result=''; |
64 | - for($i=0;$i<$hexLength;$i+=6) |
|
64 | + for($i=0; $i < $hexLength; $i+=6) |
|
65 | 65 | { |
66 | - $number=hexdec(substr($hex,$i,6)); |
|
66 | + $number=hexdec(substr($hex, $i, 6)); |
|
67 | 67 | while($number) |
68 | 68 | { |
69 | - $result.=$alphabet[$number%$base]; |
|
70 | - $number=floor($number/$base); |
|
69 | + $result.=$alphabet[$number % $base]; |
|
70 | + $number=floor($number / $base); |
|
71 | 71 | } |
72 | 72 | } |
73 | 73 | return $result; |
74 | 74 | } |
75 | 75 | |
76 | -function displayToken($token,$fontSize,$theme) |
|
76 | +function displayToken($token, $fontSize, $theme) |
|
77 | 77 | { |
78 | - if(($fontSize=(int)$fontSize)<22) |
|
78 | + if(($fontSize=(int) $fontSize) < 22) |
|
79 | 79 | $fontSize=22; |
80 | - if($fontSize>100) |
|
80 | + if($fontSize > 100) |
|
81 | 81 | $fontSize=100; |
82 | 82 | $length=strlen($token); |
83 | 83 | $padding=10; |
84 | 84 | $fontWidth=$fontSize; |
85 | - $fontHeight=floor($fontWidth*1.5); |
|
86 | - $width=$fontWidth*$length+$padding*2; |
|
85 | + $fontHeight=floor($fontWidth * 1.5); |
|
86 | + $width=$fontWidth * $length + $padding * 2; |
|
87 | 87 | $height=$fontHeight; |
88 | - $image=imagecreatetruecolor($width,$height); |
|
88 | + $image=imagecreatetruecolor($width, $height); |
|
89 | 89 | |
90 | - addBackground |
|
91 | - ( |
|
90 | + addBackground( |
|
92 | 91 | $image, $width, $height, |
93 | - $theme&THEME_OPAQUE_BACKGROUND, |
|
94 | - $theme&THEME_NOISY_BACKGROUND, |
|
95 | - $theme&THEME_HAS_GRID, |
|
96 | - $theme&THEME_HAS_SCRIBBLE, |
|
97 | - $theme&THEME_MORPH_BACKGROUND |
|
92 | + $theme & THEME_OPAQUE_BACKGROUND, |
|
93 | + $theme & THEME_NOISY_BACKGROUND, |
|
94 | + $theme & THEME_HAS_GRID, |
|
95 | + $theme & THEME_HAS_SCRIBBLE, |
|
96 | + $theme & THEME_MORPH_BACKGROUND |
|
98 | 97 | ); |
99 | 98 | |
100 | 99 | $font=dirname(__FILE__).DIRECTORY_SEPARATOR.'verase.ttf'; |
101 | 100 | |
102 | 101 | if(function_exists('imagefilter')) |
103 | - imagefilter($image,IMG_FILTER_GAUSSIAN_BLUR); |
|
102 | + imagefilter($image, IMG_FILTER_GAUSSIAN_BLUR); |
|
104 | 103 | |
105 | - $hasShadow=($theme&THEME_SHADOWED_TEXT); |
|
106 | - for($i=0;$i<$length;$i++) |
|
104 | + $hasShadow=($theme & THEME_SHADOWED_TEXT); |
|
105 | + for($i=0; $i < $length; $i++) |
|
107 | 106 | { |
108 | - $color=imagecolorallocate($image,rand(150,220),rand(150,220),rand(150,220)); |
|
109 | - $size=rand($fontWidth-10,$fontWidth); |
|
110 | - $angle=rand(-30,30); |
|
111 | - $x=$padding+$i*$fontWidth; |
|
112 | - $y=rand($fontHeight-15,$fontHeight-10); |
|
113 | - imagettftext($image,$size,$angle,$x,$y,$color,$font,$token[$i]); |
|
107 | + $color=imagecolorallocate($image, rand(150, 220), rand(150, 220), rand(150, 220)); |
|
108 | + $size=rand($fontWidth - 10, $fontWidth); |
|
109 | + $angle=rand(-30, 30); |
|
110 | + $x=$padding + $i * $fontWidth; |
|
111 | + $y=rand($fontHeight - 15, $fontHeight - 10); |
|
112 | + imagettftext($image, $size, $angle, $x, $y, $color, $font, $token[$i]); |
|
114 | 113 | if($hasShadow) |
115 | - imagettftext($image,$size,$angle,$x+2,$y+2,$color,$font,$token[$i]); |
|
116 | - imagecolordeallocate($image,$color); |
|
114 | + imagettftext($image, $size, $angle, $x + 2, $y + 2, $color, $font, $token[$i]); |
|
115 | + imagecolordeallocate($image, $color); |
|
117 | 116 | } |
118 | 117 | |
119 | 118 | header('Content-Type: image/png'); |
@@ -121,103 +120,103 @@ discard block |
||
121 | 120 | imagedestroy($image); |
122 | 121 | } |
123 | 122 | |
124 | -function addBackground($image,$width,$height,$opaque,$noisy,$hasGrid,$hasScribble,$morph) |
|
123 | +function addBackground($image, $width, $height, $opaque, $noisy, $hasGrid, $hasScribble, $morph) |
|
125 | 124 | { |
126 | - $background=imagecreatetruecolor($width*2,$height*2); |
|
127 | - $white=imagecolorallocate($background,255,255,255); |
|
128 | - imagefill($background,0,0,$white); |
|
125 | + $background=imagecreatetruecolor($width * 2, $height * 2); |
|
126 | + $white=imagecolorallocate($background, 255, 255, 255); |
|
127 | + imagefill($background, 0, 0, $white); |
|
129 | 128 | |
130 | 129 | if($opaque) |
131 | - imagefill($background,0,0,imagecolorallocate($background,100,100,100)); |
|
130 | + imagefill($background, 0, 0, imagecolorallocate($background, 100, 100, 100)); |
|
132 | 131 | |
133 | 132 | if($noisy) |
134 | - addNoise($background,$width*2,$height*2); |
|
133 | + addNoise($background, $width * 2, $height * 2); |
|
135 | 134 | |
136 | 135 | if($hasGrid) |
137 | - addGrid($background,$width*2,$height*2); |
|
136 | + addGrid($background, $width * 2, $height * 2); |
|
138 | 137 | |
139 | 138 | if($hasScribble) |
140 | - addScribble($background,$width*2,$height*2); |
|
139 | + addScribble($background, $width * 2, $height * 2); |
|
141 | 140 | |
142 | 141 | if($morph) |
143 | - morphImage($background,$width*2,$height*2); |
|
142 | + morphImage($background, $width * 2, $height * 2); |
|
144 | 143 | |
145 | - imagecopy($image,$background,0,0,30,30,$width,$height); |
|
144 | + imagecopy($image, $background, 0, 0, 30, 30, $width, $height); |
|
146 | 145 | |
147 | 146 | if(!$opaque) |
148 | - imagecolortransparent($image,$white); |
|
147 | + imagecolortransparent($image, $white); |
|
149 | 148 | } |
150 | 149 | |
151 | -function addNoise($image,$width,$height) |
|
150 | +function addNoise($image, $width, $height) |
|
152 | 151 | { |
153 | - for($x=0;$x<$width;++$x) |
|
152 | + for($x=0; $x < $width; ++$x) |
|
154 | 153 | { |
155 | - for($y=0;$y<$height;++$y) |
|
154 | + for($y=0; $y < $height; ++$y) |
|
156 | 155 | { |
157 | - if(rand(0,100)<25) |
|
156 | + if(rand(0, 100) < 25) |
|
158 | 157 | { |
159 | - $color=imagecolorallocate($image,rand(150,220),rand(150,220),rand(150,220)); |
|
160 | - imagesetpixel($image,$x,$y,$color); |
|
161 | - imagecolordeallocate($image,$color); |
|
158 | + $color=imagecolorallocate($image, rand(150, 220), rand(150, 220), rand(150, 220)); |
|
159 | + imagesetpixel($image, $x, $y, $color); |
|
160 | + imagecolordeallocate($image, $color); |
|
162 | 161 | } |
163 | 162 | } |
164 | 163 | } |
165 | 164 | } |
166 | 165 | |
167 | -function addGrid($image,$width,$height) |
|
166 | +function addGrid($image, $width, $height) |
|
168 | 167 | { |
169 | - for($i=0;$i<$width;$i+=rand(15,25)) |
|
168 | + for($i=0; $i < $width; $i+=rand(15, 25)) |
|
170 | 169 | { |
171 | - imagesetthickness($image,rand(2,6)); |
|
172 | - $color=imagecolorallocate($image,rand(100,180),rand(100,180),rand(100,180)); |
|
173 | - imageline($image,$i+rand(-10,20),0,$i+rand(-10,20),$height,$color); |
|
174 | - imagecolordeallocate($image,$color); |
|
170 | + imagesetthickness($image, rand(2, 6)); |
|
171 | + $color=imagecolorallocate($image, rand(100, 180), rand(100, 180), rand(100, 180)); |
|
172 | + imageline($image, $i + rand(-10, 20), 0, $i + rand(-10, 20), $height, $color); |
|
173 | + imagecolordeallocate($image, $color); |
|
175 | 174 | } |
176 | - for($i=0;$i<$height;$i+=rand(15,25)) |
|
175 | + for($i=0; $i < $height; $i+=rand(15, 25)) |
|
177 | 176 | { |
178 | - imagesetthickness($image,rand(2,6)); |
|
179 | - $color=imagecolorallocate($image,rand(100,180),rand(100,180),rand(100,180)); |
|
180 | - imageline($image,0,$i+rand(-10,20),$width,$i+rand(-10,20),$color); |
|
181 | - imagecolordeallocate($image,$color); |
|
177 | + imagesetthickness($image, rand(2, 6)); |
|
178 | + $color=imagecolorallocate($image, rand(100, 180), rand(100, 180), rand(100, 180)); |
|
179 | + imageline($image, 0, $i + rand(-10, 20), $width, $i + rand(-10, 20), $color); |
|
180 | + imagecolordeallocate($image, $color); |
|
182 | 181 | } |
183 | 182 | } |
184 | 183 | |
185 | -function addScribble($image,$width,$height) |
|
184 | +function addScribble($image, $width, $height) |
|
186 | 185 | { |
187 | - for($i=0;$i<8;$i++) |
|
186 | + for($i=0; $i < 8; $i++) |
|
188 | 187 | { |
189 | - $color=imagecolorallocate($image,rand(100,180),rand(100,180),rand(100,180)); |
|
188 | + $color=imagecolorallocate($image, rand(100, 180), rand(100, 180), rand(100, 180)); |
|
190 | 189 | $points=array(); |
191 | - for($j=1;$j<rand(5,10);$j++) |
|
190 | + for($j=1; $j < rand(5, 10); $j++) |
|
192 | 191 | { |
193 | - $points[]=rand(2*(20*($i+1)),2*(50*($i+1))); |
|
194 | - $points[]=rand(30,$height+30); |
|
192 | + $points[]=rand(2 * (20 * ($i + 1)), 2 * (50 * ($i + 1))); |
|
193 | + $points[]=rand(30, $height + 30); |
|
195 | 194 | } |
196 | - imagesetthickness($image,rand(2,6)); |
|
197 | - imagepolygon($image,$points,intval(sizeof($points)/2),$color); |
|
198 | - imagecolordeallocate($image,$color); |
|
195 | + imagesetthickness($image, rand(2, 6)); |
|
196 | + imagepolygon($image, $points, intval(sizeof($points) / 2), $color); |
|
197 | + imagecolordeallocate($image, $color); |
|
199 | 198 | } |
200 | 199 | } |
201 | 200 | |
202 | -function morphImage($image,$width,$height) |
|
201 | +function morphImage($image, $width, $height) |
|
203 | 202 | { |
204 | - $tempImage=imagecreatetruecolor($width,$height); |
|
205 | - $chunk=rand(1,5); |
|
206 | - for($x=$y=0;$x<$width;$x+=$chunk) |
|
203 | + $tempImage=imagecreatetruecolor($width, $height); |
|
204 | + $chunk=rand(1, 5); |
|
205 | + for($x=$y=0; $x < $width; $x+=$chunk) |
|
207 | 206 | { |
208 | - $chunk=rand(1,5); |
|
209 | - $y+=rand(-1,1); |
|
210 | - if($y>=$height) $y=$height-5; |
|
211 | - if($y<0) $y=5; |
|
212 | - imagecopy($tempImage,$image,$x,0,$x,$y,$chunk,$height); |
|
207 | + $chunk=rand(1, 5); |
|
208 | + $y+=rand(-1, 1); |
|
209 | + if($y >= $height) $y=$height - 5; |
|
210 | + if($y < 0) $y=5; |
|
211 | + imagecopy($tempImage, $image, $x, 0, $x, $y, $chunk, $height); |
|
213 | 212 | } |
214 | - for($x=$y=0;$y<$height;$y+=$chunk) |
|
213 | + for($x=$y=0; $y < $height; $y+=$chunk) |
|
215 | 214 | { |
216 | - $chunk=rand(1,5); |
|
217 | - $x+=rand(-1,1); |
|
218 | - if($x>=$width) $x=$width-5; |
|
219 | - if($x<0) $x=5; |
|
220 | - imagecopy($image,$tempImage,$x,$y,0,$y,$width,$chunk); |
|
215 | + $chunk=rand(1, 5); |
|
216 | + $x+=rand(-1, 1); |
|
217 | + if($x >= $width) $x=$width - 5; |
|
218 | + if($x < 0) $x=5; |
|
219 | + imagecopy($image, $tempImage, $x, $y, 0, $y, $width, $chunk); |
|
221 | 220 | } |
222 | 221 | } |
223 | 222 |