Completed
Push — namespace2 ( fc6e2b...8a6673 )
by Fabio
08:49
created
framework/Web/UI/WebControls/TXmlTransform.php 2 patches
Indentation   +69 added lines, -69 removed lines patch added patch discarded remove patch
@@ -46,50 +46,50 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
Spacing   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -36,8 +36,8 @@  discard block
 block discarded – undo
36 36
  */
37 37
 class TXmlTransform extends TControl {
38 38
 
39
-  const EXT_XML_FILE = '.xml';
40
-  const EXT_XSL_FILE = '.xsl';
39
+  const EXT_XML_FILE='.xml';
40
+  const EXT_XSL_FILE='.xsl';
41 41
 
42 42
   /**
43 43
    * Constructor
@@ -63,8 +63,8 @@  discard block
 block discarded – undo
63 63
    */
64 64
   public function setTransformPath($value) {
65 65
     if(!is_file($value)) {
66
-      $value = Prado::getPathOfNamespace($value, self::EXT_XSL_FILE);
67
-      if($value === null) {
66
+      $value=Prado::getPathOfNamespace($value, self::EXT_XSL_FILE);
67
+      if($value===null) {
68 68
 	throw new TInvalidDataValueException('xmltransform_transformpath_invalid', $value);
69 69
       }
70 70
     }
@@ -98,8 +98,8 @@  discard block
 block discarded – undo
98 98
    */
99 99
   public function setDocumentPath($value) {
100 100
     if(!is_file($value)) {
101
-      $value = Prado::getPathOfNamespace($value, self::EXT_XML_FILE);
102
-      if($value === null) {
101
+      $value=Prado::getPathOfNamespace($value, self::EXT_XML_FILE);
102
+      if($value===null) {
103 103
 	throw new TInvalidDataValueException('xmltransform_documentpath_invalid', $value);
104 104
       }
105 105
     }
@@ -125,22 +125,22 @@  discard block
 block discarded – undo
125 125
    * @return TAttributeCollection the list of custom parameters
126 126
    */
127 127
   public function getParameters() {
128
-    if($params = $this->getViewState('Parameters',null)) {
128
+    if($params=$this->getViewState('Parameters', null)) {
129 129
       return $params;
130 130
     } else {
131
-      $params = new TAttributeCollection();
131
+      $params=new TAttributeCollection();
132 132
       $this->setViewState('Parameters', $params, null);
133 133
       return $params;
134 134
     }
135 135
   }
136 136
 
137 137
   private function getTransformXmlDocument() {
138
-    if(($content = $this->getTransformContent()) !== '') {
139
-      $document = new DOMDocument();
138
+    if(($content=$this->getTransformContent())!=='') {
139
+      $document=new DOMDocument();
140 140
       $document->loadXML($content);
141 141
       return $document;
142
-    } else if(($path = $this->getTransformPath()) !== '') {
143
-      $document = new DOMDocument();
142
+    } else if(($path=$this->getTransformPath())!=='') {
143
+      $document=new DOMDocument();
144 144
       $document->load($path);
145 145
       return $document;
146 146
     } else {
@@ -149,12 +149,12 @@  discard block
 block discarded – undo
149 149
   }
150 150
 
151 151
   private function getSourceXmlDocument() {
152
-    if(($content = $this->getDocumentContent()) !== '') {
153
-      $document = new DOMDocument();
152
+    if(($content=$this->getDocumentContent())!=='') {
153
+      $document=new DOMDocument();
154 154
       $document->loadXML($content);
155 155
       return $document;
156
-    } else if(($path = $this->getDocumentPath()) !== '') {
157
-      $document = new DOMDocument();
156
+    } else if(($path=$this->getDocumentPath())!=='') {
157
+      $document=new DOMDocument();
158 158
       $document->load($path);
159 159
       return $document;
160 160
     } else {
@@ -167,24 +167,24 @@  discard block
 block discarded – undo
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) {
171
-	  $htmlWriter = Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
170
+    if(($document=$this->getSourceXmlDocument())===null) {
171
+	  $htmlWriter=Prado::createComponent($this->GetResponse()->getHtmlWriterType(), new TTextWriter());
172 172
 	  parent::render($htmlWriter);
173
-      $document = new DOMDocument();
173
+      $document=new DOMDocument();
174 174
       $document->loadXML($htmlWriter->flush());
175 175
     }
176
-    $stylesheet = $this->getTransformXmlDocument();
176
+    $stylesheet=$this->getTransformXmlDocument();
177 177
 
178 178
     // Perform XSL transformation
179
-    $xslt = new XSLTProcessor();
179
+    $xslt=new XSLTProcessor();
180 180
     $xslt->importStyleSheet($stylesheet);
181 181
 
182 182
     // Check for parameters
183
-    $parameters = $this->getParameters();
183
+    $parameters=$this->getParameters();
184 184
     foreach($parameters as $name => $value) {
185 185
       $xslt->setParameter('', $name, $value);
186 186
     }
187
-    $output = $xslt->transformToXML($document);
187
+    $output=$xslt->transformToXML($document);
188 188
 
189 189
     // Write output
190 190
     $writer->write($output);
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TReCaptcha.php 3 patches
Indentation   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -170,12 +170,12 @@
 block discarded – undo
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(
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -246,8 +246,7 @@
 block discarded – undo
246 246
 				$writer->write($html);
247 247
 
248 248
 				$cs->registerEndScript('ReCaptcha::EventScript', 'jQuery(document).ready(function() { '.$readyscript.'; } );');
249
-			}
250
-		else
249
+			} else
251 250
 			{
252 251
 				$options = $this->getClientSideOptions();
253 252
 				$options['callback'] = new TJavaScriptLiteral('function() { '.$readyscript.'; '.$this->getCallbackScript().'; }');
Please login to merge, or discard this patch.
Spacing   +27 added lines, -28 removed lines patch added patch discarded remove patch
@@ -55,8 +55,8 @@  discard block
 block discarded – undo
55 55
 {
56 56
 	private $_isValid=true;
57 57
 
58
-	const ChallengeFieldName = 'recaptcha_challenge_field';
59
-	const ResponseFieldName = 'recaptcha_response_field';
58
+	const ChallengeFieldName='recaptcha_challenge_field';
59
+	const ResponseFieldName='recaptcha_response_field';
60 60
 
61 61
 	public function getTagName()
62 62
 	{
@@ -157,28 +157,27 @@  discard block
 block discarded – undo
157 157
 	
158 158
 	public function getClientSideOptions()
159 159
 	{
160
-		$options = array();
161
-		if ($theme = $this->getThemeName())
162
-			$options['theme'] = $theme;
163
-		if ($lang = $this->getLanguage())
164
-			$options['lang'] = $lang;
165
-		if ($trans = $this->getCustomTranslations())
166
-			$options['custom_translations'] = $trans;
160
+		$options=array();
161
+		if($theme=$this->getThemeName())
162
+			$options['theme']=$theme;
163
+		if($lang=$this->getLanguage())
164
+			$options['lang']=$lang;
165
+		if($trans=$this->getCustomTranslations())
166
+			$options['custom_translations']=$trans;
167 167
 		return $options;
168 168
 	}
169 169
 
170 170
 	public function validate()
171 171
 	{
172
-		if (!
173
-		      (
174
-			($challenge = @$_POST[$this->getChallengeFieldName()])
172
+		if(!(
173
+			($challenge=@$_POST[$this->getChallengeFieldName()])
175 174
 			and
176
-			($response = @$_POST[$this->getResponseFieldName()])
175
+			($response=@$_POST[$this->getResponseFieldName()])
177 176
 		      )
178 177
                    )
179 178
 		   return false;
180 179
 
181
-		$resp = recaptcha_check_answer(
180
+		$resp=recaptcha_check_answer(
182 181
 			$this->getPrivateKey(),
183 182
 			$_SERVER["REMOTE_ADDR"],
184 183
 			$challenge,
@@ -195,13 +194,13 @@  discard block
 block discarded – undo
195 194
 	{
196 195
 		parent::onPreRender($param);
197 196
 
198
-		if("" == $this->getPublicKey())
197
+		if(""==$this->getPublicKey())
199 198
 			throw new TConfigurationException('recaptcha_publickey_unknown');
200
-		if("" == $this->getPrivateKey())
199
+		if(""==$this->getPrivateKey())
201 200
 			throw new TConfigurationException('recaptcha_privatekey_unknown');
202 201
 
203 202
 		// need to register captcha fields so they will be sent back also in callbacks 
204
-		$page = $this->getPage();
203
+		$page=$this->getPage();
205 204
 		$page->registerRequiresPostData($this->getChallengeFieldName());
206 205
 		$page->registerRequiresPostData($this->getResponseFieldName());
207 206
 	}
@@ -209,32 +208,32 @@  discard block
 block discarded – undo
209 208
 	protected function addAttributesToRender($writer)
210 209
 	{
211 210
 		parent::addAttributesToRender($writer);
212
-		$writer->addAttribute('id',$this->getClientID());
211
+		$writer->addAttribute('id', $this->getClientID());
213 212
 	}
214 213
 
215 214
 	public function regenerateToken()
216 215
 	{
217 216
 		// if we're in a callback, then schedule re-rendering of the control 
218 217
 		// if not, don't do anything, because a new challenge will be rendered anyway
219
-		if ($this->Page->IsCallback)
220
-			$this->Page->CallbackClient->jQuery($this->getClientID().' #recaptcha_reload','click');
218
+		if($this->Page->IsCallback)
219
+			$this->Page->CallbackClient->jQuery($this->getClientID().' #recaptcha_reload', 'click');
221 220
 	}
222 221
 
223 222
 	public function renderContents($writer)
224 223
 	{
225
-		$readyscript = 'jQuery(document).trigger('.TJavaScript::quoteString('captchaready:'.$this->getClientID()).')';
226
-		$cs = $this->Page->ClientScript;
227
-		$id = $this->getClientID();
228
-		$divid = $id.'_1_recaptchadiv';
224
+		$readyscript='jQuery(document).trigger('.TJavaScript::quoteString('captchaready:'.$this->getClientID()).')';
225
+		$cs=$this->Page->ClientScript;
226
+		$id=$this->getClientID();
227
+		$divid=$id.'_1_recaptchadiv';
229 228
 		$writer->write('<div id="'.htmlspecialchars($divid).'">');
230 229
 	
231
-		if (!$this->Page->IsCallback)
230
+		if(!$this->Page->IsCallback)
232 231
 			{
233 232
 				$writer->write(TJavaScript::renderScriptBlock(
234 233
 					'var RecaptchaOptions = '.TJavaScript::jsonEncode($this->getClientSideOptions()).';'
235 234
 				));
236 235
 	
237
-				$html = recaptcha_get_html($this->getPublicKey());
236
+				$html=recaptcha_get_html($this->getPublicKey());
238 237
 				/*
239 238
 				reCAPTCHA currently does not support multiple validations per page
240 239
 				$html = str_replace(
@@ -249,8 +248,8 @@  discard block
 block discarded – undo
249 248
 			}
250 249
 		else
251 250
 			{
252
-				$options = $this->getClientSideOptions();
253
-				$options['callback'] = new TJavaScriptLiteral('function() { '.$readyscript.'; '.$this->getCallbackScript().'; }');
251
+				$options=$this->getClientSideOptions();
252
+				$options['callback']=new TJavaScriptLiteral('function() { '.$readyscript.'; '.$this->getCallbackScript().'; }');
254 253
 				$cs->registerScriptFile('ReCaptcha::AjaxScript', 'http://www.google.com/recaptcha/api/js/recaptcha_ajax.js');
255 254
 				$cs->registerEndScript('ReCaptcha::CreateScript::'.$id, implode(' ', array(
256 255
 					'if (!jQuery('.TJavaScript::quoteString('#'.$this->getResponseFieldName()).'))',
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TInlineFrame.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -159,7 +159,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 	
Please login to merge, or discard this patch.
Spacing   +36 added lines, -36 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	 */
48 48
 	public function getAlign()
49 49
 	{
50
-		return $this->getViewState('Align',TInlineFrameAlign::NotSet);
50
+		return $this->getViewState('Align', TInlineFrameAlign::NotSet);
51 51
 	}
52 52
 
53 53
 	/**
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 	 */
56 56
 	public function setAlign($value)
57 57
 	{
58
-		$this->setViewState('Align',TPropertyValue::ensureEnum($value,'Prado\\Web\\UI\\WebControls\\TInlineFrameAlign'),TInlineFrameAlign::NotSet);
58
+		$this->setViewState('Align', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TInlineFrameAlign'), TInlineFrameAlign::NotSet);
59 59
 	}
60 60
 
61 61
 	/**
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 */
64 64
 	public function getDescriptionUrl()
65 65
 	{
66
-		return $this->getViewState('DescriptionUrl','');
66
+		return $this->getViewState('DescriptionUrl', '');
67 67
 	}
68 68
 
69 69
 	/**
@@ -71,7 +71,7 @@  discard block
 block discarded – undo
71 71
 	 */
72 72
 	public function setDescriptionUrl($value)
73 73
 	{
74
-		$this->setViewState('DescriptionUrl',$value,'');
74
+		$this->setViewState('DescriptionUrl', $value, '');
75 75
 	}
76 76
 
77 77
 	/**
@@ -79,7 +79,7 @@  discard block
 block discarded – undo
79 79
 	 */
80 80
 	public function getShowBorder()
81 81
 	{
82
-		return $this->getViewState('ShowBorder',true);
82
+		return $this->getViewState('ShowBorder', true);
83 83
 	}
84 84
 
85 85
 	/**
@@ -87,7 +87,7 @@  discard block
 block discarded – undo
87 87
 	 */
88 88
 	public function setShowBorder($value)
89 89
 	{
90
-		$this->setViewState('ShowBorder',TPropertyValue::ensureBoolean($value),true);
90
+		$this->setViewState('ShowBorder', TPropertyValue::ensureBoolean($value), true);
91 91
 	}
92 92
 
93 93
 	/**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 */
96 96
 	public function getFrameUrl()
97 97
 	{
98
-		return $this->getViewState('FrameUrl','');
98
+		return $this->getViewState('FrameUrl', '');
99 99
 	}
100 100
 
101 101
 	/**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	public function setFrameUrl($value)
105 105
 	{
106
-		$this->setViewState('FrameUrl',$value,'');
106
+		$this->setViewState('FrameUrl', $value, '');
107 107
 	}
108 108
 
109 109
 	/**
@@ -137,7 +137,7 @@  discard block
 block discarded – undo
137 137
 	 */
138 138
 	public function getScrollBars()
139 139
 	{
140
-		return $this->getViewState('ScrollBars',TInlineFrameScrollBars::Auto);
140
+		return $this->getViewState('ScrollBars', TInlineFrameScrollBars::Auto);
141 141
 	}
142 142
 
143 143
 	/**
@@ -145,7 +145,7 @@  discard block
 block discarded – undo
145 145
 	 */
146 146
 	public function setScrollBars($value)
147 147
 	{
148
-		$this->setViewState('ScrollBars',TPropertyValue::ensureEnum($value,'Prado\\Web\\UI\\WebControls\\TInlineFrameScrollBars'),TInlineFrameScrollBars::Auto);
148
+		$this->setViewState('ScrollBars', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TInlineFrameScrollBars'), TInlineFrameScrollBars::Auto);
149 149
 	}
150 150
 
151 151
 	/**
@@ -153,7 +153,7 @@  discard block
 block discarded – undo
153 153
 	 */
154 154
 	public function getWidth()
155 155
 	{
156
-	  return $this->getViewState('Width',-1);
156
+	  return $this->getViewState('Width', -1);
157 157
 	}
158 158
 	
159 159
 	/**
@@ -161,9 +161,9 @@  discard block
 block discarded – undo
161 161
 	 */
162 162
 	public function setWidth($value)
163 163
 	{
164
-	  if(($value=TPropertyValue::ensureInteger($value))<0)
164
+	  if(($value=TPropertyValue::ensureInteger($value)) < 0)
165 165
 	    $value=-1;
166
-	  $this->setViewState('Width',$value,-1);
166
+	  $this->setViewState('Width', $value, -1);
167 167
 	}
168 168
 	
169 169
 	/**
@@ -171,7 +171,7 @@  discard block
 block discarded – undo
171 171
 	 */
172 172
 	public function getHeight()
173 173
 	{
174
-	  return $this->getViewState('Height',-1);
174
+	  return $this->getViewState('Height', -1);
175 175
 	}
176 176
 	
177 177
 	/**
@@ -179,9 +179,9 @@  discard block
 block discarded – undo
179 179
 	 */
180 180
 	public function setHeight($value)
181 181
 	{
182
-	  if(($value=TPropertyValue::ensureInteger($value))<0)
182
+	  if(($value=TPropertyValue::ensureInteger($value)) < 0)
183 183
 	    $value=-1;
184
-	  $this->setViewState('Height',$value,-1);
184
+	  $this->setViewState('Height', $value, -1);
185 185
 	}
186 186
 	
187 187
 	/**
@@ -190,7 +190,7 @@  discard block
 block discarded – undo
190 190
 	 */
191 191
 	public function getMarginWidth()
192 192
 	{
193
-		return $this->getViewState('MarginWidth',-1);
193
+		return $this->getViewState('MarginWidth', -1);
194 194
 	}
195 195
 
196 196
 	/**
@@ -199,9 +199,9 @@  discard block
 block discarded – undo
199 199
 	 */
200 200
 	public function setMarginWidth($value)
201 201
 	{
202
-		if(($value=TPropertyValue::ensureInteger($value))<0)
202
+		if(($value=TPropertyValue::ensureInteger($value)) < 0)
203 203
 			$value=-1;
204
-		$this->setViewState('MarginWidth',$value,-1);
204
+		$this->setViewState('MarginWidth', $value, -1);
205 205
 	}
206 206
 
207 207
 	/**
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 	 */
211 211
 	public function getMarginHeight()
212 212
 	{
213
-		return $this->getViewState('MarginHeight',-1);
213
+		return $this->getViewState('MarginHeight', -1);
214 214
 	}
215 215
 
216 216
 	/**
@@ -219,9 +219,9 @@  discard block
 block discarded – undo
219 219
 	 */
220 220
 	public function setMarginHeight($value)
221 221
 	{
222
-		if(($value=TPropertyValue::ensureInteger($value))<0)
222
+		if(($value=TPropertyValue::ensureInteger($value)) < 0)
223 223
 			$value=-1;
224
-		$this->setViewState('MarginHeight',$value,-1);
224
+		$this->setViewState('MarginHeight', $value, -1);
225 225
 	}
226 226
 
227 227
 	/**
@@ -232,37 +232,37 @@  discard block
 block discarded – undo
232 232
 	protected function addAttributesToRender($writer)
233 233
 	{
234 234
 		if($this->getID()!=='')
235
-			$writer->addAttribute('name',$this->getUniqueID());
235
+			$writer->addAttribute('name', $this->getUniqueID());
236 236
 
237 237
 		if(($src=$this->getFrameUrl())!=='')
238
-			$writer->addAttribute('src',$src);
238
+			$writer->addAttribute('src', $src);
239 239
 
240 240
 		if(($align=strtolower($this->getAlign()))!=='notset')
241
-			$writer->addAttribute('align',$align);
241
+			$writer->addAttribute('align', $align);
242 242
 
243 243
 		$scrollBars=$this->getScrollBars();
244 244
 		if($scrollBars===TInlineFrameScrollBars::None)
245
-			$writer->addAttribute('scrolling','no');
245
+			$writer->addAttribute('scrolling', 'no');
246 246
 		else if($scrollBars===TInlineFrameScrollBars::Both)
247
-			$writer->addAttribute('scrolling','yes');
247
+			$writer->addAttribute('scrolling', 'yes');
248 248
 
249
-		if (!$this->getShowBorder())
250
-			$writer->addAttribute('frameborder','0');
249
+		if(!$this->getShowBorder())
250
+			$writer->addAttribute('frameborder', '0');
251 251
 
252 252
 		if(($longdesc=$this->getDescriptionUrl())!=='')
253
-			$writer->addAttribute('longdesc',$longdesc);
253
+			$writer->addAttribute('longdesc', $longdesc);
254 254
 		
255
-		if (($width=$this->getWidth())!==-1)
256
-		  $writer->addAttribute('width',$width);
255
+		if(($width=$this->getWidth())!==-1)
256
+		  $writer->addAttribute('width', $width);
257 257
 		
258
-		if (($height=$this->getHeight())!==-1)
259
-		  $writer->addAttribute('height',$height);
258
+		if(($height=$this->getHeight())!==-1)
259
+		  $writer->addAttribute('height', $height);
260 260
 
261 261
 		if(($marginheight=$this->getMarginHeight())!==-1)
262
-			$writer->addAttribute('marginheight',$marginheight);
262
+			$writer->addAttribute('marginheight', $marginheight);
263 263
 
264 264
 		if(($marginwidth=$this->getMarginWidth())!==-1)
265
-			$writer->addAttribute('marginwidth',$marginwidth);
265
+			$writer->addAttribute('marginwidth', $marginwidth);
266 266
 
267 267
 		parent::addAttributesToRender($writer);
268 268
 	}
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/assets/captcha.php 2 patches
Indentation   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -100,21 +100,21 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Spacing   +98 added lines, -99 removed lines patch added patch discarded remove patch
@@ -9,12 +9,12 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTableRow.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -89,7 +89,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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)
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -121,7 +121,7 @@  discard block
 block discarded – undo
121 121
 	 */
122 122
 	public function getTableSection()
123 123
 	{
124
-		return $this->getViewState('TableSection',TTableRowSection::Body);
124
+		return $this->getViewState('TableSection', TTableRowSection::Body);
125 125
 	}
126 126
 
127 127
 	/**
@@ -129,7 +129,7 @@  discard block
 block discarded – undo
129 129
 	 */
130 130
 	public function setTableSection($value)
131 131
 	{
132
-		$this->setViewState('TableSection',TPropertyValue::ensureEnum($value,'Prado\\Web\\UI\\WebControls\\TTableRowSection'),TTableRowSection::Body);
132
+		$this->setViewState('TableSection', TPropertyValue::ensureEnum($value, 'Prado\\Web\\UI\\WebControls\\TTableRowSection'), TTableRowSection::Body);
133 133
 	}
134 134
 
135 135
 	/**
Please login to merge, or discard this patch.
framework/Web/UI/WebControls/TTabPanel.php 3 patches
Indentation   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -81,9 +81,9 @@  discard block
 block discarded – undo
81 81
 	}
82 82
 
83 83
 	/**
84
-     * Returns the index of the active tab view.
85
-     * Note, this property may not return the correct index.
86
-     * To ensure the correctness, call {@link getActiveView()} first.
84
+	 * Returns the index of the active tab view.
85
+	 * Note, this property may not return the correct index.
86
+	 * To ensure the correctness, call {@link getActiveView()} first.
87 87
 	 * @return integer the zero-based index of the active tab view. If -1, it means no active tab view. Default is 0 (the first view is active).
88 88
 	 */
89 89
 	public function getActiveViewIndex()
@@ -100,24 +100,24 @@  discard block
 block discarded – undo
100 100
 		$this->setViewState('ActiveViewIndex',TPropertyValue::ensureInteger($value),0);
101 101
 	}
102 102
 
103
-    /**
104
-     * Returns the ID of the active tab view.
105
-     * Note, this property may not return the correct ID.
106
-     * To ensure the correctness, call {@link getActiveView()} first.
107
-     * @return string The ID of the active tab view. Defaults to '', meaning not set.
108
-     */
109
-    public function getActiveViewID()
110
-    {
103
+	/**
104
+	 * Returns the ID of the active tab view.
105
+	 * Note, this property may not return the correct ID.
106
+	 * To ensure the correctness, call {@link getActiveView()} first.
107
+	 * @return string The ID of the active tab view. Defaults to '', meaning not set.
108
+	 */
109
+	public function getActiveViewID()
110
+	{
111 111
 		return $this->getViewState('ActiveViewID','');
112
-    }
112
+	}
113 113
 
114
-    /**
115
-     * @param string The ID of the active tab view.
116
-     */
117
-    public function setActiveViewID($value)
118
-    {
114
+	/**
115
+	 * @param string The ID of the active tab view.
116
+	 */
117
+	public function setActiveViewID($value)
118
+	{
119 119
 		$this->setViewState('ActiveViewID',$value,'');
120
-    }
120
+	}
121 121
 
122 122
 	/**
123 123
 	 * Returns the currently active view.
@@ -172,63 +172,63 @@  discard block
 block discarded – undo
172 172
 			throw new TInvalidOperationException('tabpanel_view_inexistent');
173 173
 	}
174 174
 
175
-    /**
176
-     * @return bool status of automatic tab switch on hover
177
-     */
178
-    public function getAutoSwitch()
179
-    {
180
-        return TPropertyValue::ensureBoolean($this->getViewState('AutoSwitch'));
181
-    }
182
-
183
-    /**
184
-     * @param bool whether to enable automatic tab switch on hover
185
-     */
186
-    public function setAutoSwitch($value)
187
-    {
188
-        $this->setViewState('AutoSwitch',TPropertyValue::ensureBoolean($value));
189
-    }
190
-
191
-
192
-    /**
193
-     * @return string URL for the CSS file including all relevant CSS class definitions. Defaults to ''.
194
-     */
195
-    public function getCssUrl()
196
-    {
197
-        return $this->getViewState('CssUrl','default');
198
-    }
199
-
200
-    /**
201
-     * @param string URL for the CSS file including all relevant CSS class definitions.
202
-     */
203
-    public function setCssUrl($value)
204
-    {
205
-        $this->setViewState('CssUrl',TPropertyValue::ensureString($value),'');
206
-    }
207
-
208
-    /**
209
-     * @return string CSS class for the whole tab control div. Defaults to 'tab-panel'.
210
-     */
211
-    public function getCssClass()
212
-    {
213
-    	$cssClass=parent::getCssClass();
214
-    	return $cssClass===''?'tab-panel':$cssClass;
215
-    }
216
-
217
-    /**
218
-     * @return string CSS class for the currently displayed view div. Defaults to 'tab-view'.
219
-     */
220
-    public function getViewCssClass()
221
-    {
222
-        return $this->getViewStyle()->getCssClass();
223
-    }
224
-
225
-    /**
226
-     * @param string CSS class for the currently displayed view div.
227
-     */
228
-    public function setViewCssClass($value)
229
-    {
230
-        $this->getViewStyle()->setCssClass($value);
231
-    }
175
+	/**
176
+	 * @return bool status of automatic tab switch on hover
177
+	 */
178
+	public function getAutoSwitch()
179
+	{
180
+		return TPropertyValue::ensureBoolean($this->getViewState('AutoSwitch'));
181
+	}
182
+
183
+	/**
184
+	 * @param bool whether to enable automatic tab switch on hover
185
+	 */
186
+	public function setAutoSwitch($value)
187
+	{
188
+		$this->setViewState('AutoSwitch',TPropertyValue::ensureBoolean($value));
189
+	}
190
+
191
+
192
+	/**
193
+	 * @return string URL for the CSS file including all relevant CSS class definitions. Defaults to ''.
194
+	 */
195
+	public function getCssUrl()
196
+	{
197
+		return $this->getViewState('CssUrl','default');
198
+	}
199
+
200
+	/**
201
+	 * @param string URL for the CSS file including all relevant CSS class definitions.
202
+	 */
203
+	public function setCssUrl($value)
204
+	{
205
+		$this->setViewState('CssUrl',TPropertyValue::ensureString($value),'');
206
+	}
207
+
208
+	/**
209
+	 * @return string CSS class for the whole tab control div. Defaults to 'tab-panel'.
210
+	 */
211
+	public function getCssClass()
212
+	{
213
+		$cssClass=parent::getCssClass();
214
+		return $cssClass===''?'tab-panel':$cssClass;
215
+	}
216
+
217
+	/**
218
+	 * @return string CSS class for the currently displayed view div. Defaults to 'tab-view'.
219
+	 */
220
+	public function getViewCssClass()
221
+	{
222
+		return $this->getViewStyle()->getCssClass();
223
+	}
224
+
225
+	/**
226
+	 * @param string CSS class for the currently displayed view div.
227
+	 */
228
+	public function setViewCssClass($value)
229
+	{
230
+		$this->getViewStyle()->setCssClass($value);
231
+	}
232 232
 
233 233
 	/**
234 234
 	 * @return TStyle the style for all the view div
@@ -244,21 +244,21 @@  discard block
 block discarded – undo
244 244
 		return $style;
245 245
 	}
246 246
 
247
-    /**
248
-     * @return string CSS class for non-active tabs. Defaults to 'tab-normal'.
249
-     */
250
-    public function getTabCssClass()
251
-    {
252
-        return $this->getTabStyle()->getCssClass();
253
-    }
247
+	/**
248
+	 * @return string CSS class for non-active tabs. Defaults to 'tab-normal'.
249
+	 */
250
+	public function getTabCssClass()
251
+	{
252
+		return $this->getTabStyle()->getCssClass();
253
+	}
254 254
 
255
-    /**
256
-     * @param string CSS class for non-active tabs.
257
-     */
258
-    public function setTabCssClass($value)
259
-    {
260
-        $this->getTabStyle()->setCssClass($value);
261
-    }
255
+	/**
256
+	 * @param string CSS class for non-active tabs.
257
+	 */
258
+	public function setTabCssClass($value)
259
+	{
260
+		$this->getTabStyle()->setCssClass($value);
261
+	}
262 262
 
263 263
 	/**
264 264
 	 * @return TStyle the style for all the inactive tab div
@@ -274,21 +274,21 @@  discard block
 block discarded – undo
274 274
 		return $style;
275 275
 	}
276 276
 
277
-    /**
278
-     * @return string CSS class for the active tab. Defaults to 'tab-active'.
279
-     */
280
-    public function getActiveTabCssClass()
281
-    {
282
-        return $this->getActiveTabStyle()->getCssClass();
283
-    }
284
-
285
-    /**
286
-     * @param string CSS class for the active tab.
287
-     */
288
-    public function setActiveTabCssClass($value)
289
-    {
290
-        $this->getActiveTabStyle()->setCssClass($value);
291
-    }
277
+	/**
278
+	 * @return string CSS class for the active tab. Defaults to 'tab-active'.
279
+	 */
280
+	public function getActiveTabCssClass()
281
+	{
282
+		return $this->getActiveTabStyle()->getCssClass();
283
+	}
284
+
285
+	/**
286
+	 * @param string CSS class for the active tab.
287
+	 */
288
+	public function setActiveTabCssClass($value)
289
+	{
290
+		$this->getActiveTabStyle()->setCssClass($value);
291
+	}
292 292
 
293 293
 	/**
294 294
 	 * @return TStyle the style for the active tab div
Please login to merge, or discard this patch.
Braces   +3 added lines, -6 removed lines patch added patch discarded remove patch
@@ -136,15 +136,13 @@  discard block
 block discarded – undo
136 136
 				$activeView=$views->itemAt($index);
137 137
 			else
138 138
 				throw new TInvalidDataValueException('tabpanel_activeviewid_invalid',$id);
139
-		}
140
-		else if(($index=$this->getActiveViewIndex())>=0)
139
+		} else if(($index=$this->getActiveViewIndex())>=0)
141 140
 		{
142 141
 			if($index<$views->getCount())
143 142
 				$activeView=$views->itemAt($index);
144 143
 			else
145 144
 				throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid',$index);
146
-		}
147
-		else
145
+		} else
148 146
 		{
149 147
 			foreach($views as $index=>$view)
150 148
 			{
@@ -320,8 +318,7 @@  discard block
 block discarded – undo
320 318
 				$this->setActiveViewIndex($index);
321 319
 				$this->setActiveViewID($view->getID(false));
322 320
 				$view->setActive(true);
323
-			}
324
-			else
321
+			} else
325 322
 				$v->setActive(false);
326 323
 		}
327 324
 	}
Please login to merge, or discard this patch.
Spacing   +41 added lines, -41 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@  discard block
 block discarded – undo
94 94
 	 */
95 95
 	public function getActiveViewIndex()
96 96
 	{
97
-		return $this->getViewState('ActiveViewIndex',0);
97
+		return $this->getViewState('ActiveViewIndex', 0);
98 98
 	}
99 99
 
100 100
 	/**
@@ -103,7 +103,7 @@  discard block
 block discarded – undo
103 103
 	 */
104 104
 	public function setActiveViewIndex($value)
105 105
 	{
106
-		$this->setViewState('ActiveViewIndex',TPropertyValue::ensureInteger($value),0);
106
+		$this->setViewState('ActiveViewIndex', TPropertyValue::ensureInteger($value), 0);
107 107
 	}
108 108
 
109 109
     /**
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
      */
115 115
     public function getActiveViewID()
116 116
     {
117
-		return $this->getViewState('ActiveViewID','');
117
+		return $this->getViewState('ActiveViewID', '');
118 118
     }
119 119
 
120 120
     /**
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
      */
123 123
     public function setActiveViewID($value)
124 124
     {
125
-		$this->setViewState('ActiveViewID',$value,'');
125
+		$this->setViewState('ActiveViewID', $value, '');
126 126
     }
127 127
 
128 128
 	/**
@@ -138,17 +138,17 @@  discard block
 block discarded – undo
138 138
 		$views=$this->getViews();
139 139
 		if(($id=$this->getActiveViewID())!=='')
140 140
 		{
141
-			if(($index=$views->findIndexByID($id))>=0)
141
+			if(($index=$views->findIndexByID($id)) >= 0)
142 142
 				$activeView=$views->itemAt($index);
143 143
 			else
144
-				throw new TInvalidDataValueException('tabpanel_activeviewid_invalid',$id);
144
+				throw new TInvalidDataValueException('tabpanel_activeviewid_invalid', $id);
145 145
 		}
146
-		else if(($index=$this->getActiveViewIndex())>=0)
146
+		else if(($index=$this->getActiveViewIndex()) >= 0)
147 147
 		{
148
-			if($index<$views->getCount())
148
+			if($index < $views->getCount())
149 149
 				$activeView=$views->itemAt($index);
150 150
 			else
151
-				throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid',$index);
151
+				throw new TInvalidDataValueException('tabpanel_activeviewindex_invalid', $index);
152 152
 		}
153 153
 		else
154 154
 		{
@@ -172,7 +172,7 @@  discard block
 block discarded – undo
172 172
 	 */
173 173
 	public function setActiveView($view)
174 174
 	{
175
-		if($this->getViews()->indexOf($view)>=0)
175
+		if($this->getViews()->indexOf($view) >= 0)
176 176
 			$this->activateView($view);
177 177
 		else
178 178
 			throw new TInvalidOperationException('tabpanel_view_inexistent');
@@ -191,7 +191,7 @@  discard block
 block discarded – undo
191 191
      */
192 192
     public function setAutoSwitch($value)
193 193
     {
194
-        $this->setViewState('AutoSwitch',TPropertyValue::ensureBoolean($value));
194
+        $this->setViewState('AutoSwitch', TPropertyValue::ensureBoolean($value));
195 195
     }
196 196
 
197 197
 
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
      */
201 201
     public function getCssUrl()
202 202
     {
203
-        return $this->getViewState('CssUrl','default');
203
+        return $this->getViewState('CssUrl', 'default');
204 204
     }
205 205
 
206 206
     /**
@@ -208,7 +208,7 @@  discard block
 block discarded – undo
208 208
      */
209 209
     public function setCssUrl($value)
210 210
     {
211
-        $this->setViewState('CssUrl',TPropertyValue::ensureString($value),'');
211
+        $this->setViewState('CssUrl', TPropertyValue::ensureString($value), '');
212 212
     }
213 213
 
214 214
     /**
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
     public function getCssClass()
218 218
     {
219 219
     	$cssClass=parent::getCssClass();
220
-    	return $cssClass===''?'tab-panel':$cssClass;
220
+    	return $cssClass==='' ? 'tab-panel' : $cssClass;
221 221
     }
222 222
 
223 223
     /**
@@ -241,11 +241,11 @@  discard block
 block discarded – undo
241 241
 	 */
242 242
 	public function getViewStyle()
243 243
 	{
244
-		if(($style=$this->getViewState('ViewStyle',null))===null)
244
+		if(($style=$this->getViewState('ViewStyle', null))===null)
245 245
 		{
246 246
 			$style=new TStyle;
247 247
 			$style->setCssClass('tab-view');
248
-			$this->setViewState('ViewStyle',$style,null);
248
+			$this->setViewState('ViewStyle', $style, null);
249 249
 		}
250 250
 		return $style;
251 251
 	}
@@ -271,11 +271,11 @@  discard block
 block discarded – undo
271 271
 	 */
272 272
 	public function getTabStyle()
273 273
 	{
274
-		if(($style=$this->getViewState('TabStyle',null))===null)
274
+		if(($style=$this->getViewState('TabStyle', null))===null)
275 275
 		{
276 276
 			$style=new TStyle;
277 277
 			$style->setCssClass('tab-normal');
278
-			$this->setViewState('TabStyle',$style,null);
278
+			$this->setViewState('TabStyle', $style, null);
279 279
 		}
280 280
 		return $style;
281 281
 	}
@@ -301,11 +301,11 @@  discard block
 block discarded – undo
301 301
 	 */
302 302
 	public function getActiveTabStyle()
303 303
 	{
304
-		if(($style=$this->getViewState('ActiveTabStyle',null))===null)
304
+		if(($style=$this->getViewState('ActiveTabStyle', null))===null)
305 305
 		{
306 306
 			$style=new TStyle;
307 307
 			$style->setCssClass('tab-active');
308
-			$this->setViewState('ActiveTabStyle',$style,null);
308
+			$this->setViewState('ActiveTabStyle', $style, null);
309 309
 		}
310 310
 		return $style;
311 311
 	}
@@ -339,11 +339,11 @@  discard block
 block discarded – undo
339 339
 	 * @param array the input data collection
340 340
 	 * @return boolean whether the data of the control has been changed
341 341
 	 */
342
-	public function loadPostData($key,$values)
342
+	public function loadPostData($key, $values)
343 343
 	{
344 344
 		if(($index=$values[$this->getClientID().'_1'])!==null)
345 345
 		{
346
-			$index=(int)$index;
346
+			$index=(int) $index;
347 347
 			$currentIndex=$this->getActiveViewIndex();
348 348
 			if($currentIndex!==$index)
349 349
 			{
@@ -383,7 +383,7 @@  discard block
 block discarded – undo
383 383
 	 */
384 384
 	protected function addAttributesToRender($writer)
385 385
 	{
386
-		$writer->addAttribute('id',$this->getClientID());
386
+		$writer->addAttribute('id', $this->getClientID());
387 387
 		$this->setCssClass($this->getCssClass());
388 388
 		parent::addAttributesToRender($writer);
389 389
 	}
@@ -396,7 +396,7 @@  discard block
 block discarded – undo
396 396
 	public function onPreRender($param)
397 397
 	{
398 398
 		parent::onPreRender($param);
399
-		$this->getActiveView();  // determine the active view
399
+		$this->getActiveView(); // determine the active view
400 400
 		$this->registerStyleSheet();
401 401
 
402 402
 		$page=$this->getPage();
@@ -411,17 +411,17 @@  discard block
 block discarded – undo
411 411
 	 */
412 412
 	protected function registerStyleSheet()
413 413
 	{
414
-		$url = $this->getCssUrl();
414
+		$url=$this->getCssUrl();
415 415
 
416
-		if($url === '') {
416
+		if($url==='') {
417 417
 			return;
418 418
 		}
419 419
 
420
-		if($url === 'default') {
421
-			$url = $this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'tabpanel.css');
420
+		if($url==='default') {
421
+			$url=$this->getApplication()->getAssetManager()->publishFilePath(dirname(__FILE__).DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'tabpanel.css');
422 422
 		}
423 423
 
424
-		if($url !== '') {
424
+		if($url!=='') {
425 425
 			$this->getPage()->getClientScript()->registerStyleSheetFile($url, $url);
426 426
 		}
427 427
 	}
@@ -439,7 +439,7 @@  discard block
 block discarded – undo
439 439
 		$code="new $className($options);";
440 440
 		$cs->registerEndScript("prado:$id", $code);
441 441
 		// ensure an item is always active and visible
442
-		$index = $this->getActiveViewIndex();
442
+		$index=$this->getActiveViewIndex();
443 443
 		if(!$this->getViews()->itemAt($index)->Visible)
444 444
 			$index=0;
445 445
 		$cs->registerHiddenField($id.'_1', $index);
@@ -460,19 +460,19 @@  discard block
 block discarded – undo
460 460
 	 */
461 461
 	protected function getClientOptions()
462 462
 	{
463
-		$options['ID'] = $this->getClientID();
464
-		$options['ActiveCssClass'] = $this->getActiveTabCssClass();
465
-		$options['NormalCssClass'] = $this->getTabCssClass();
466
-		$viewIDs = array();
467
-		$viewVis = array();
463
+		$options['ID']=$this->getClientID();
464
+		$options['ActiveCssClass']=$this->getActiveTabCssClass();
465
+		$options['NormalCssClass']=$this->getTabCssClass();
466
+		$viewIDs=array();
467
+		$viewVis=array();
468 468
 		foreach($this->getViews() as $view)
469 469
 		{
470
-			$viewIDs[] = $view->getClientID();
471
-			$viewVis[] = $view->getVisible();
470
+			$viewIDs[]=$view->getClientID();
471
+			$viewVis[]=$view->getVisible();
472 472
 		}
473
-		$options['Views'] = $viewIDs;
474
-		$options['ViewsVis'] = $viewVis;
475
-		$options['AutoSwitch'] = $this->getAutoSwitch();
473
+		$options['Views']=$viewIDs;
474
+		$options['ViewsVis']=$viewVis;
475
+		$options['AutoSwitch']=$this->getAutoSwitch();
476 476
 
477 477
 		return $options;
478 478
 	}
@@ -507,7 +507,7 @@  discard block
 block discarded – undo
507 507
 	public function renderContents($writer)
508 508
 	{
509 509
 		$views=$this->getViews();
510
-		if($views->getCount()>0)
510
+		if($views->getCount() > 0)
511 511
 		{
512 512
 			$writer->writeLine();
513 513
 			// render tab bar
Please login to merge, or discard this patch.
framework/Web/UI/JuiControls/TJuiDatePicker.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -90,10 +90,10 @@
 block discarded – undo
90 90
 	{
91 91
 		return array('altField', 'altFormat', 'appendText', 'autoSize', 'buttonImage', 'buttonImageOnly', 'buttonText', 'calculateWeek',
92 92
 								 'changeMonth', 'changeYear', 'closeText', 'constrainInput', 'currentText', 'dateFormat', 'dayNames', 'dayNamesMin',
93
-				         'dayNamesShort', 'defaultDate', 'duration', 'firstDay', 'gotoCurrent', 'hideIfNoPrevNext', 'isRTL', 'maxDate',
93
+						 'dayNamesShort', 'defaultDate', 'duration', 'firstDay', 'gotoCurrent', 'hideIfNoPrevNext', 'isRTL', 'maxDate',
94 94
 								 'minDate', 'monthNames', 'monthNamesShort', 'navigationAsDateFormat', 'nextText', 'numberOfMonths', 'prevText',
95 95
 								 'selectOtherMonths', 'shortYearCutoff', 'showAnim', 'showButtonPanel', 'showCurrentAtPos', 'showMonthAfterYear',
96
-				         'showOn', 'showOptions', 'showOtherMonths', 'showWeek', 'stepMonths', 'weekHeader', 'yearRange', 'yearSuffix',
96
+						 'showOn', 'showOptions', 'showOtherMonths', 'showWeek', 'stepMonths', 'weekHeader', 'yearRange', 'yearSuffix',
97 97
 								 'beforeShow', 'beforeShowDay', 'onChangeMonthYear', 'onClose', 'onSelect');
98 98
 	}
99 99
 
Please login to merge, or discard this patch.
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 	 * it will register an additional clientscript to set the language specific global default settings.
40 40
 	 * @var boolean true, if this is the first instance of TJuiDatePicker, false otherwise
41 41
 	 */
42
-	private static $_first = true;
42
+	private static $_first=true;
43 43
 
44 44
 	/**
45 45
 	 * Creates a new callback control, sets the adapter to
@@ -74,7 +74,7 @@  discard block
 block discarded – undo
74 74
 	 */
75 75
 	public function getOptions()
76 76
 	{
77
-		if (($options=$this->getViewState('JuiOptions'))===null)
77
+		if(($options=$this->getViewState('JuiOptions'))===null)
78 78
 		{
79 79
 		  $options=new TJuiControlOptions($this);
80 80
 		  $this->setViewState('JuiOptions', $options);
@@ -168,8 +168,8 @@  discard block
 block discarded – undo
168 168
 	 */
169 169
 	protected function getCurrentCulture()
170 170
 	{
171
-		$app = $this->getApplication()->getGlobalization(false);
172
-		return $this->getCulture() == '' ?
171
+		$app=$this->getApplication()->getGlobalization(false);
172
+		return $this->getCulture()=='' ?
173 173
 				($app ? $app->getCulture() : 'en') : $this->getCulture();
174 174
 	}
175 175
 
@@ -178,7 +178,7 @@  discard block
 block discarded – undo
178 178
 	 */
179 179
 	public function getDateFormat()
180 180
 	{
181
-		return $this->getViewState('DateFormat','dd-MM-yyyy');
181
+		return $this->getViewState('DateFormat', 'dd-MM-yyyy');
182 182
 	}
183 183
 
184 184
 	/**
@@ -187,7 +187,7 @@  discard block
 block discarded – undo
187 187
 	 */
188 188
 	public function setDateFormat($value)
189 189
 	{
190
-		$this->setViewState('DateFormat',$value,'dd-MM-yyyy');
190
+		$this->setViewState('DateFormat', $value, 'dd-MM-yyyy');
191 191
 	}
192 192
 
193 193
 	/**
@@ -253,8 +253,8 @@  discard block
 block discarded – undo
253 253
 			$this->setText('');
254 254
 		else
255 255
 		{
256
-			$date = TPropertyValue::ensureFloat($value);
257
-			$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$this->getDateFormat());
256
+			$date=TPropertyValue::ensureFloat($value);
257
+			$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $this->getDateFormat());
258 258
 			$this->setText($formatter->format($date));
259 259
 		}
260 260
 	}
@@ -265,9 +265,9 @@  discard block
 block discarded – undo
265 265
 	 */
266 266
 	protected function getTimeStampFromText()
267 267
 	{
268
-		$pattern = $this->getDateFormat();
269
-		$pattern = str_replace(array('MMMM', 'MMM'), array('MM','MM'), $pattern);
270
-		$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$pattern);
268
+		$pattern=$this->getDateFormat();
269
+		$pattern=str_replace(array('MMMM', 'MMM'), array('MM', 'MM'), $pattern);
270
+		$formatter=Prado::createComponent('System.Util.TSimpleDateFormatter', $pattern);
271 271
 		return $formatter->parse($this->getText());
272 272
 	}
273 273
 
@@ -278,10 +278,10 @@  discard block
 block discarded – undo
278 278
 	 */
279 279
 	public function getValidationPropertyValue()
280 280
 	{
281
-		if(($text = $this->getText()) === '')
281
+		if(($text=$this->getText())==='')
282 282
 			return '';
283
-		$date = $this->getTimeStamp();
284
-		return $date == null ? $text : $date;
283
+		$date=$this->getTimeStamp();
284
+		return $date==null ? $text : $date;
285 285
 	}
286 286
 
287 287
 }
288 288
\ No newline at end of file
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveMultiView.php 3 patches
Indentation   +23 added lines, -23 removed lines patch added patch discarded remove patch
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 class TActiveMultiView extends TMultiView implements IActiveControl
31 31
 {
32 32
 	/**
33
-	* Creates a new callback control, sets the adapter to
34
-	* TActiveControlAdapter.
35
-	*/
33
+	 * Creates a new callback control, sets the adapter to
34
+	 * TActiveControlAdapter.
35
+	 */
36 36
 	public function __construct()
37 37
 	{
38 38
 		parent::__construct();
@@ -40,28 +40,28 @@  discard block
 block discarded – undo
40 40
 	}
41 41
 
42 42
 	/**
43
-	* @return TBaseActiveControl standard active control options.
44
-	*/
43
+	 * @return TBaseActiveControl standard active control options.
44
+	 */
45 45
 	public function getActiveControl()
46 46
 	{
47 47
 		return $this->getAdapter()->getBaseActiveControl();
48 48
 	}
49 49
 
50 50
 	/**
51
-	* Returns the id of the surrounding container (span).
52
-	* @return string container id
53
-	*/
51
+	 * Returns the id of the surrounding container (span).
52
+	 * @return string container id
53
+	 */
54 54
 	protected function getContainerID()
55 55
 	{
56 56
 		return $this->ClientID.'_Container';
57 57
 	}
58 58
 
59 59
 	/**
60
-	* Renders the TActiveMultiView.
61
-	* If the MutliView did not pass the prerender phase yet, it will register itself for rendering later.
62
-	* Else it will call the {@link renderMultiView()} method which will do the rendering of the MultiView.
63
-	* @param THtmlWriter writer for the rendering purpose
64
-	*/
60
+	 * Renders the TActiveMultiView.
61
+	 * If the MutliView did not pass the prerender phase yet, it will register itself for rendering later.
62
+	 * Else it will call the {@link renderMultiView()} method which will do the rendering of the MultiView.
63
+	 * @param THtmlWriter writer for the rendering purpose
64
+	 */
65 65
 	public function render($writer)
66 66
 	{
67 67
 		if($this->getHasPreRendered()) {
@@ -74,10 +74,10 @@  discard block
 block discarded – undo
74 74
 	}
75 75
 
76 76
 	/**
77
-	* Renders the TActiveMultiView by writing a span tag with the container id obtained from {@link getContainerID()}
78
-	* which will be called by the replacement method of the client script to update it's content.
79
-	* @param $writer THtmlWriter writer for the rendering purpose
80
-	*/
77
+	 * Renders the TActiveMultiView by writing a span tag with the container id obtained from {@link getContainerID()}
78
+	 * which will be called by the replacement method of the client script to update it's content.
79
+	 * @param $writer THtmlWriter writer for the rendering purpose
80
+	 */
81 81
 	protected function renderMultiView($writer)
82 82
 	{
83 83
 		$writer->addAttribute('id', $this->getContainerID());
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
 	}
88 88
 
89 89
 	/**
90
-	* @param integer the zero-based index of the current view in the view collection. -1 if no active view.
91
-	* @throws TInvalidDataValueException if the view index is invalid
92
-	*/
90
+	 * @param integer the zero-based index of the current view in the view collection. -1 if no active view.
91
+	 * @throws TInvalidDataValueException if the view index is invalid
92
+	 */
93 93
 	public function setActiveViewIndex($value)
94 94
 	{
95 95
 		$old=parent::getActiveViewIndex();
@@ -99,9 +99,9 @@  discard block
 block discarded – undo
99 99
 	}
100 100
 
101 101
 	/**
102
-	* @param TView the view to be activated
103
-	* @throws TInvalidOperationException if the view is not in the view collection
104
-	*/
102
+	 * @param TView the view to be activated
103
+	 * @throws TInvalidOperationException if the view is not in the view collection
104
+	 */
105 105
 	public function setActiveView($value)
106 106
 	{
107 107
 		$old=parent::getActiveView();
Please login to merge, or discard this patch.
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -58,8 +58,7 @@
 block discarded – undo
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
 		}
Please login to merge, or discard this patch.
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -67,10 +67,10 @@  discard block
 block discarded – undo
67 67
 		if($this->getHasPreRendered()) {
68 68
 			$this->renderMultiView($writer);
69 69
 			if($this->getActiveControl()->canUpdateClientSide())
70
-				$this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(),$writer);
70
+				$this->getPage()->getCallbackClient()->replaceContent($this->getContainerID(), $writer);
71 71
 		}
72 72
 		else
73
-			$this->getPage()->getAdapter()->registerControlToRender($this,$writer);
73
+			$this->getPage()->getAdapter()->registerControlToRender($this, $writer);
74 74
 	}
75 75
 
76 76
 	/**
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 		$old=parent::getActiveViewIndex();
96 96
 		parent::setActiveViewIndex($value);
97 97
 		if($this->getActiveControl()->canUpdateClientSide() && $old!=$value)
98
-			$this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
98
+			$this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter());
99 99
 	}
100 100
 
101 101
 	/**
@@ -107,6 +107,6 @@  discard block
 block discarded – undo
107 107
 		$old=parent::getActiveView();
108 108
 		parent::setActiveView($value);
109 109
 		if($this->getActiveControl()->canUpdateClientSide() && $old!=$value)
110
-			$this->getPage()->getAdapter()->registerControlToRender($this,$this->getResponse()->createHtmlWriter());
110
+			$this->getPage()->getAdapter()->registerControlToRender($this, $this->getResponse()->createHtmlWriter());
111 111
 	}
112 112
 }
Please login to merge, or discard this patch.
framework/Web/UI/ActiveControls/TActiveDatePicker.php 2 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -32,8 +32,8 @@
 block discarded – undo
32 32
 
33 33
 	/**
34 34
 	 * @return boolean a value indicating whether an automatic postback to the server
35
-     * will occur whenever the user modifies the text in the TActiveDatePicker control and
36
-     * then tabs out of the component. Defaults to true.
35
+	 * will occur whenever the user modifies the text in the TActiveDatePicker control and
36
+	 * then tabs out of the component. Defaults to true.
37 37
 	 */
38 38
 	public function getAutoPostBack()
39 39
 	{
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	public function getAutoPostBack()
39 39
 	{
40
-		return $this->getViewState('AutoPostBack',true);
40
+		return $this->getViewState('AutoPostBack', true);
41 41
 	}
42 42
 
43 43
 	/**
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 	 */
49 49
 	public function setAutoPostBack($value)
50 50
 	{
51
-		$this->setViewState('AutoPostBack',TPropertyValue::ensureBoolean($value),true);
51
+		$this->setViewState('AutoPostBack', TPropertyValue::ensureBoolean($value), true);
52 52
 	}
53 53
 
54 54
 	/**
@@ -57,12 +57,12 @@  discard block
 block discarded – undo
57 57
 	 */
58 58
 	protected function getDatePickerOptions()
59 59
 	{
60
-		$options = parent::getDatePickerOptions();
60
+		$options=parent::getDatePickerOptions();
61 61
 		$options['CausesValidation']=$this->getCausesValidation();
62 62
 		$options['ValidationGroup']=$this->getValidationGroup();
63
-		$options['EventTarget'] = $this->getUniqueID();
64
-		$options['ShowCalendar'] = $this->getShowCalendar();
65
-		$options['AutoPostBack'] = $this->getAutoPostBack();
63
+		$options['EventTarget']=$this->getUniqueID();
64
+		$options['ShowCalendar']=$this->getShowCalendar();
65
+		$options['AutoPostBack']=$this->getAutoPostBack();
66 66
 		return $options;
67 67
 	}
68 68
 
@@ -80,7 +80,7 @@  discard block
 block discarded – undo
80 80
 	/**
81 81
 	 * @return TBaseActiveCallbackControl standard callback control options.
82 82
 	 */
83
-	public function getActiveControl(){
83
+	public function getActiveControl() {
84 84
 		return $this->getAdapter()->getBaseActiveControl();
85 85
 	}
86 86
 
@@ -88,21 +88,21 @@  discard block
 block discarded – undo
88 88
 	 * Client-side Text property can only be updated after the OnLoad stage.
89 89
 	 * @param string text content for the textbox
90 90
 	 */
91
-	public function setText($value){
92
-		if(parent::getText() === $value)
91
+	public function setText($value) {
92
+		if(parent::getText()===$value)
93 93
 			return;
94 94
 
95 95
 		parent::setText($value);
96
-		if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()){
96
+		if($this->getActiveControl()->canUpdateClientSide() && $this->getHasLoadedPostData()) {
97 97
 			$cb=$this->getPage()->getCallbackClient();
98 98
 			$cb->setValue($this, $value);
99
-			if ($this->getInputMode()==TDatePickerInputMode::DropDownList)
99
+			if($this->getInputMode()==TDatePickerInputMode::DropDownList)
100 100
 			{
101
-				$s = Prado::createComponent('System.Util.TDateTimeStamp');
102
-				$date = $s->getDate($this->getTimeStampFromText());
101
+				$s=Prado::createComponent('System.Util.TDateTimeStamp');
102
+				$date=$s->getDate($this->getTimeStampFromText());
103 103
 				$id=$this->getClientID();
104 104
 				$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'day', 'Value', $date['mday'], 'select');
105
-				$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'month', 'Value', $date['mon']-1, 'select');
105
+				$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'month', 'Value', $date['mon'] - 1, 'select');
106 106
 				$cb->select($id.TControl::CLIENT_ID_SEPARATOR.'year', 'Value', $date['year'], 'select');
107 107
 
108 108
 			}
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 	 * This method is mainly used by framework and control developers.
116 116
 	 * @param TCallbackEventParameter the event parameter
117 117
 	 */
118
- 	public function raiseCallbackEvent($param){
118
+ 	public function raiseCallbackEvent($param) {
119 119
 		$this->onCallback($param);
120 120
 	}
121 121
 
@@ -126,7 +126,7 @@  discard block
 block discarded – undo
126 126
 	 * handler can be invoked.
127 127
 	 * @param TCallbackEventParameter event parameter to be passed to the event handlers
128 128
 	 */
129
-	public function onCallback($param){
129
+	public function onCallback($param) {
130 130
 		$this->raiseEvent('OnCallback', $this, $param);
131 131
 	}
132 132
 
@@ -136,22 +136,22 @@  discard block
 block discarded – undo
136 136
 
137 137
 	protected function registerCalendarClientScriptPre()
138 138
 	{
139
-		$cs = $this->getPage()->getClientScript();
139
+		$cs=$this->getPage()->getClientScript();
140 140
 		$cs->registerPradoScript("activedatepicker");
141 141
 	}
142 142
 
143 143
 	protected function renderClientControlScript($writer)
144 144
 	{
145
-		$cs = $this->getPage()->getClientScript();
145
+		$cs=$this->getPage()->getClientScript();
146 146
 		if(!$cs->isEndScriptRegistered('TDatePicker.spacer'))
147 147
 		{
148
-			$spacer = $this->getAssetUrl('spacer.gif');
149
-			$code = "Prado.WebUI.TDatePicker.spacer = '$spacer';";
148
+			$spacer=$this->getAssetUrl('spacer.gif');
149
+			$code="Prado.WebUI.TDatePicker.spacer = '$spacer';";
150 150
 			$cs->registerEndScript('TDatePicker.spacer', $code);
151 151
 		}
152 152
 
153
-		$options = TJavaScript::encode($this->getDatePickerOptions());
154
-		$code = "new Prado.WebUI.TActiveDatePicker($options);";
153
+		$options=TJavaScript::encode($this->getDatePickerOptions());
154
+		$code="new Prado.WebUI.TActiveDatePicker($options);";
155 155
 		$cs->registerEndScript("prado:".$this->getClientID(), $code);
156 156
 	}
157 157
 
Please login to merge, or discard this patch.