@@ -131,14 +131,14 @@ discard block |
||
131 | 131 | */ |
132 | 132 | public function getIsValid() |
133 | 133 | { |
134 | - return $this->_isValid; |
|
134 | + return $this->_isValid; |
|
135 | 135 | } |
136 | 136 | /** |
137 | 137 | * @param bool wether this control is valid. |
138 | 138 | */ |
139 | 139 | public function setIsValid($value) |
140 | 140 | { |
141 | - $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
141 | + $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | /** |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | */ |
289 | 289 | public function getSurroundingTag() |
290 | 290 | { |
291 | - return 'span'; |
|
291 | + return 'span'; |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | /** |
@@ -296,7 +296,7 @@ discard block |
||
296 | 296 | */ |
297 | 297 | public function getSurroundingTagID() |
298 | 298 | { |
299 | - return $this->getSpanNeeded() ? $this->getClientID().'_parent' : $this->getClientID(); |
|
299 | + return $this->getSpanNeeded() ? $this->getClientID().'_parent' : $this->getClientID(); |
|
300 | 300 | } |
301 | 301 | |
302 | 302 | /** |
@@ -326,11 +326,11 @@ discard block |
||
326 | 326 | } |
327 | 327 | else |
328 | 328 | $onclick=''; |
329 | - if($needspan=$this->getSpanNeeded()) |
|
330 | - { |
|
331 | - $writer->addAttribute('id',$this->getSurroundingTagID()); |
|
332 | - $writer->renderBeginTag($this->getSurroundingTag()); |
|
333 | - } |
|
329 | + if($needspan=$this->getSpanNeeded()) |
|
330 | + { |
|
331 | + $writer->addAttribute('id',$this->getSurroundingTagID()); |
|
332 | + $writer->renderBeginTag($this->getSurroundingTag()); |
|
333 | + } |
|
334 | 334 | $clientID=$this->getClientID(); |
335 | 335 | if(($text=$this->getText())!=='') |
336 | 336 | { |
@@ -416,15 +416,15 @@ discard block |
||
416 | 416 | $this->setViewState('EnableClientScript',TPropertyValue::ensureBoolean($value),true); |
417 | 417 | } |
418 | 418 | |
419 | - /** |
|
420 | - * Check if we need a span tag to surround this control. The span tag will be created if |
|
421 | - * the Text property is set for this control. |
|
422 | - * |
|
423 | - * @return bool wether this control needs a surrounding span tag |
|
424 | - */ |
|
425 | - protected function getSpanNeeded() { |
|
426 | - return $this->getText()!==''; |
|
427 | - } |
|
419 | + /** |
|
420 | + * Check if we need a span tag to surround this control. The span tag will be created if |
|
421 | + * the Text property is set for this control. |
|
422 | + * |
|
423 | + * @return bool wether this control needs a surrounding span tag |
|
424 | + */ |
|
425 | + protected function getSpanNeeded() { |
|
426 | + return $this->getText()!==''; |
|
427 | + } |
|
428 | 428 | |
429 | 429 | /** |
430 | 430 | * Renders a label beside the checkbox. |
@@ -46,50 +46,50 @@ discard block |
||
46 | 46 | * @throws TConfigurationException If XSL extension is not available |
47 | 47 | */ |
48 | 48 | public function __construct() { |
49 | - if(!class_exists('XSLTProcessor', false)) { |
|
50 | - throw new TConfigurationException('xmltransform_xslextension_required'); |
|
51 | - } |
|
49 | + if(!class_exists('XSLTProcessor', false)) { |
|
50 | + throw new TConfigurationException('xmltransform_xslextension_required'); |
|
51 | + } |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | /** |
55 | 55 | * @return string The path to the XML style sheet. |
56 | 56 | */ |
57 | 57 | public function getTransformPath() { |
58 | - return $this->getViewState('TransformPath', ''); |
|
58 | + return $this->getViewState('TransformPath', ''); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | /** |
62 | 62 | * @param string The path to the XML style sheet. It must be in namespace format. |
63 | 63 | */ |
64 | 64 | public function setTransformPath($value) { |
65 | - if(!is_file($value)) { |
|
66 | - $value = Prado::getPathOfNamespace($value, self::EXT_XSL_FILE); |
|
67 | - if($value === null) { |
|
65 | + if(!is_file($value)) { |
|
66 | + $value = Prado::getPathOfNamespace($value, self::EXT_XSL_FILE); |
|
67 | + if($value === null) { |
|
68 | 68 | throw new TInvalidDataValueException('xmltransform_transformpath_invalid', $value); |
69 | - } |
|
70 | - } |
|
71 | - $this->setViewState('TransformPath', $value, ''); |
|
69 | + } |
|
70 | + } |
|
71 | + $this->setViewState('TransformPath', $value, ''); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
75 | 75 | * @return string XML style sheet as string |
76 | 76 | */ |
77 | 77 | public function getTransformContent() { |
78 | - return $this->getViewState('TransformContent', ''); |
|
78 | + return $this->getViewState('TransformContent', ''); |
|
79 | 79 | } |
80 | 80 | |
81 | 81 | /** |
82 | 82 | * @param string $value XML style sheet as string |
83 | 83 | */ |
84 | 84 | public function setTransformContent($value) { |
85 | - $this->setViewState('TransformContent', $value, ''); |
|
85 | + $this->setViewState('TransformContent', $value, ''); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | /** |
89 | 89 | * @return string The path to the XML document. It must be in namespace format. |
90 | 90 | */ |
91 | 91 | public function getDocumentPath() { |
92 | - return $this->getViewState('DocumentPath', ''); |
|
92 | + return $this->getViewState('DocumentPath', ''); |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | /** |
@@ -97,27 +97,27 @@ discard block |
||
97 | 97 | * @throws TInvalidDataValueException |
98 | 98 | */ |
99 | 99 | public function setDocumentPath($value) { |
100 | - if(!is_file($value)) { |
|
101 | - $value = Prado::getPathOfNamespace($value, self::EXT_XML_FILE); |
|
102 | - if($value === null) { |
|
100 | + if(!is_file($value)) { |
|
101 | + $value = Prado::getPathOfNamespace($value, self::EXT_XML_FILE); |
|
102 | + if($value === null) { |
|
103 | 103 | throw new TInvalidDataValueException('xmltransform_documentpath_invalid', $value); |
104 | - } |
|
105 | - } |
|
106 | - $this->setViewState('DocumentPath', $value, ''); |
|
104 | + } |
|
105 | + } |
|
106 | + $this->setViewState('DocumentPath', $value, ''); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | /** |
110 | 110 | * @return string XML data |
111 | 111 | */ |
112 | 112 | public function getDocumentContent() { |
113 | - return $this->getViewState('DocumentContent', ''); |
|
113 | + return $this->getViewState('DocumentContent', ''); |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | /** |
117 | 117 | * @param string $value XML data. If not empty, it takes precedence over {@link setDocumentPath DocumentPath}. |
118 | 118 | */ |
119 | 119 | public function setDocumentContent($value) { |
120 | - $this->setViewState('DocumentContent', $value, ''); |
|
120 | + $this->setViewState('DocumentContent', $value, ''); |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | /** |
@@ -125,41 +125,41 @@ discard block |
||
125 | 125 | * @return TAttributeCollection the list of custom parameters |
126 | 126 | */ |
127 | 127 | public function getParameters() { |
128 | - if($params = $this->getViewState('Parameters',null)) { |
|
129 | - return $params; |
|
130 | - } else { |
|
131 | - $params = new TAttributeCollection(); |
|
132 | - $this->setViewState('Parameters', $params, null); |
|
133 | - return $params; |
|
134 | - } |
|
128 | + if($params = $this->getViewState('Parameters',null)) { |
|
129 | + return $params; |
|
130 | + } else { |
|
131 | + $params = new TAttributeCollection(); |
|
132 | + $this->setViewState('Parameters', $params, null); |
|
133 | + return $params; |
|
134 | + } |
|
135 | 135 | } |
136 | 136 | |
137 | 137 | private function getTransformXmlDocument() { |
138 | - if(($content = $this->getTransformContent()) !== '') { |
|
139 | - $document = new DOMDocument(); |
|
140 | - $document->loadXML($content); |
|
141 | - return $document; |
|
142 | - } else if(($path = $this->getTransformPath()) !== '') { |
|
143 | - $document = new DOMDocument(); |
|
144 | - $document->load($path); |
|
145 | - return $document; |
|
146 | - } else { |
|
147 | - throw new TConfigurationException('xmltransform_transform_required'); |
|
148 | - } |
|
138 | + if(($content = $this->getTransformContent()) !== '') { |
|
139 | + $document = new DOMDocument(); |
|
140 | + $document->loadXML($content); |
|
141 | + return $document; |
|
142 | + } else if(($path = $this->getTransformPath()) !== '') { |
|
143 | + $document = new DOMDocument(); |
|
144 | + $document->load($path); |
|
145 | + return $document; |
|
146 | + } else { |
|
147 | + throw new TConfigurationException('xmltransform_transform_required'); |
|
148 | + } |
|
149 | 149 | } |
150 | 150 | |
151 | 151 | private function getSourceXmlDocument() { |
152 | - if(($content = $this->getDocumentContent()) !== '') { |
|
153 | - $document = new DOMDocument(); |
|
154 | - $document->loadXML($content); |
|
155 | - return $document; |
|
156 | - } else if(($path = $this->getDocumentPath()) !== '') { |
|
157 | - $document = new DOMDocument(); |
|
158 | - $document->load($path); |
|
159 | - return $document; |
|
160 | - } else { |
|
161 | - return null; |
|
162 | - } |
|
152 | + if(($content = $this->getDocumentContent()) !== '') { |
|
153 | + $document = new DOMDocument(); |
|
154 | + $document->loadXML($content); |
|
155 | + return $document; |
|
156 | + } else if(($path = $this->getDocumentPath()) !== '') { |
|
157 | + $document = new DOMDocument(); |
|
158 | + $document->load($path); |
|
159 | + return $document; |
|
160 | + } else { |
|
161 | + return null; |
|
162 | + } |
|
163 | 163 | } |
164 | 164 | |
165 | 165 | /** |
@@ -167,27 +167,27 @@ discard block |
||
167 | 167 | * @param THtmlWriter The writer used for the rendering purpose |
168 | 168 | */ |
169 | 169 | public function render($writer) { |
170 | - if(($document=$this->getSourceXmlDocument()) === null) { |
|
170 | + if(($document=$this->getSourceXmlDocument()) === null) { |
|
171 | 171 | $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter()); |
172 | 172 | parent::render($htmlWriter); |
173 | - $document = new DOMDocument(); |
|
174 | - $document->loadXML($htmlWriter->flush()); |
|
175 | - } |
|
176 | - $stylesheet = $this->getTransformXmlDocument(); |
|
177 | - |
|
178 | - // Perform XSL transformation |
|
179 | - $xslt = new XSLTProcessor(); |
|
180 | - $xslt->importStyleSheet($stylesheet); |
|
181 | - |
|
182 | - // Check for parameters |
|
183 | - $parameters = $this->getParameters(); |
|
184 | - foreach($parameters as $name => $value) { |
|
185 | - $xslt->setParameter('', $name, $value); |
|
186 | - } |
|
187 | - $output = $xslt->transformToXML($document); |
|
188 | - |
|
189 | - // Write output |
|
190 | - $writer->write($output); |
|
173 | + $document = new DOMDocument(); |
|
174 | + $document->loadXML($htmlWriter->flush()); |
|
175 | + } |
|
176 | + $stylesheet = $this->getTransformXmlDocument(); |
|
177 | + |
|
178 | + // Perform XSL transformation |
|
179 | + $xslt = new XSLTProcessor(); |
|
180 | + $xslt->importStyleSheet($stylesheet); |
|
181 | + |
|
182 | + // Check for parameters |
|
183 | + $parameters = $this->getParameters(); |
|
184 | + foreach($parameters as $name => $value) { |
|
185 | + $xslt->setParameter('', $name, $value); |
|
186 | + } |
|
187 | + $output = $xslt->transformToXML($document); |
|
188 | + |
|
189 | + // Write output |
|
190 | + $writer->write($output); |
|
191 | 191 | } |
192 | 192 | } |
193 | 193 |
@@ -170,12 +170,12 @@ |
||
170 | 170 | public function validate() |
171 | 171 | { |
172 | 172 | if (! |
173 | - ( |
|
173 | + ( |
|
174 | 174 | ($challenge = @$_POST[$this->getChallengeFieldName()]) |
175 | 175 | and |
176 | 176 | ($response = @$_POST[$this->getResponseFieldName()]) |
177 | - ) |
|
178 | - ) |
|
177 | + ) |
|
178 | + ) |
|
179 | 179 | return false; |
180 | 180 | |
181 | 181 | $resp = recaptcha_check_answer( |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | public function setWidth($value) |
160 | 160 | { |
161 | 161 | if(($value=TPropertyValue::ensureInteger($value))<0) |
162 | - $value=-1; |
|
162 | + $value=-1; |
|
163 | 163 | $this->setViewState('Width',$value,-1); |
164 | 164 | } |
165 | 165 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | public function setHeight($value) |
178 | 178 | { |
179 | 179 | if(($value=TPropertyValue::ensureInteger($value))<0) |
180 | - $value=-1; |
|
180 | + $value=-1; |
|
181 | 181 | $this->setViewState('Height',$value,-1); |
182 | 182 | } |
183 | 183 |
@@ -251,14 +251,14 @@ discard block |
||
251 | 251 | */ |
252 | 252 | public function getIsValid() |
253 | 253 | { |
254 | - return $this->_isValid; |
|
254 | + return $this->_isValid; |
|
255 | 255 | } |
256 | 256 | /** |
257 | 257 | * @param bool wether this control is valid. |
258 | 258 | */ |
259 | 259 | public function setIsValid($value) |
260 | 260 | { |
261 | - $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
261 | + $this->_isValid=TPropertyValue::ensureBoolean($value); |
|
262 | 262 | } |
263 | 263 | |
264 | 264 | /** |
@@ -329,8 +329,8 @@ discard block |
||
329 | 329 | |
330 | 330 | /** |
331 | 331 | * @return boolean a value indicating whether an automatic postback to the server |
332 | - * will occur whenever the user modifies the text in the TTextBox control and |
|
333 | - * then tabs out of the component. Defaults to false. |
|
332 | + * will occur whenever the user modifies the text in the TTextBox control and |
|
333 | + * then tabs out of the component. Defaults to false. |
|
334 | 334 | */ |
335 | 335 | public function getAutoPostBack() |
336 | 336 | { |
@@ -19,7 +19,6 @@ |
||
19 | 19 | * |
20 | 20 | * The following property is provided by TDataRenderer: |
21 | 21 | * - {@link getData Data}: data associated with this renderer. |
22 | - |
|
23 | 22 | * @author Qiang Xue <[email protected]> |
24 | 23 | * @package System.Web.UI.WebControls |
25 | 24 | * @since 3.1.2 |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
218 | - * @return string rating style css class name. |
|
218 | + * @return string rating style css class name. |
|
219 | 219 | */ |
220 | 220 | protected function getRatingStyleCssClass() |
221 | 221 | { |
@@ -258,7 +258,7 @@ discard block |
||
258 | 258 | } |
259 | 259 | |
260 | 260 | /** |
261 | - * @return string find the client ID of the caption control. |
|
261 | + * @return string find the client ID of the caption control. |
|
262 | 262 | */ |
263 | 263 | protected function getCaptionControlID() |
264 | 264 | { |
@@ -100,21 +100,21 @@ discard block |
||
100 | 100 | $font=dirname(__FILE__).DIRECTORY_SEPARATOR.'verase.ttf'; |
101 | 101 | |
102 | 102 | if(function_exists('imagefilter')) |
103 | - imagefilter($image,IMG_FILTER_GAUSSIAN_BLUR); |
|
103 | + imagefilter($image,IMG_FILTER_GAUSSIAN_BLUR); |
|
104 | 104 | |
105 | 105 | $hasShadow=($theme&THEME_SHADOWED_TEXT); |
106 | - for($i=0;$i<$length;$i++) |
|
106 | + for($i=0;$i<$length;$i++) |
|
107 | 107 | { |
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]); |
|
114 | - if($hasShadow) |
|
115 | - imagettftext($image,$size,$angle,$x+2,$y+2,$color,$font,$token[$i]); |
|
116 | - imagecolordeallocate($image,$color); |
|
117 | - } |
|
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]); |
|
114 | + if($hasShadow) |
|
115 | + imagettftext($image,$size,$angle,$x+2,$y+2,$color,$font,$token[$i]); |
|
116 | + imagecolordeallocate($image,$color); |
|
117 | + } |
|
118 | 118 | |
119 | 119 | header('Content-Type: image/png'); |
120 | 120 | imagepng($image); |
@@ -158,8 +158,8 @@ discard block |
||
158 | 158 | { |
159 | 159 | $color=imagecolorallocate($image,rand(150,220),rand(150,220),rand(150,220)); |
160 | 160 | imagesetpixel($image,$x,$y,$color); |
161 | - imagecolordeallocate($image,$color); |
|
162 | - } |
|
161 | + imagecolordeallocate($image,$color); |
|
162 | + } |
|
163 | 163 | } |
164 | 164 | } |
165 | 165 | } |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | |
90 | 90 | /** |
91 | 91 | * Sets the horizontal alignment of the contents within the table item. |
92 | - * Valid values include 'NotSet', 'Justify', 'Left', 'Right', 'Center' |
|
92 | + * Valid values include 'NotSet', 'Justify', 'Left', 'Right', 'Center' |
|
93 | 93 | * @param string the horizontal alignment |
94 | 94 | */ |
95 | 95 | public function setHorizontalAlign($value) |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | |
111 | 111 | /** |
112 | 112 | * Sets the vertical alignment of the contents within the table item. |
113 | - * Valid values include 'NotSet','Top','Bottom','Middle' |
|
113 | + * Valid values include 'NotSet','Top','Bottom','Middle' |
|
114 | 114 | * @param string the horizontal alignment |
115 | 115 | */ |
116 | 116 | public function setVerticalAlign($value) |