Completed
Push — master ( 9a433b...506aa3 )
by Fabio
10:24
created
framework/Web/UI/WebControls/TXmlTransform.php 1 patch
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.
framework/Web/UI/WebControls/assets/captcha.php 1 patch
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.
framework/Web/UI/ActiveControls/TActiveHiddenField.php 1 patch
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -22,7 +22,7 @@
 block discarded – undo
22 22
  */
23 23
 class TActiveHiddenField extends THiddenField implements ICallbackEventHandler, IActiveControl
24 24
 {
25
-    /**
25
+	/**
26 26
 	 * Creates a new callback control, sets the adapter to
27 27
 	 * TActiveControlAdapter. If you override this class, be sure to set the
28 28
 	 * adapter appropriately by, for example, by calling this constructor.
Please login to merge, or discard this patch.
framework/Web/UI/TTemplateControl.php 1 patch
Indentation   +84 added lines, -84 removed lines patch added patch discarded remove patch
@@ -238,90 +238,90 @@
 block discarded – undo
238 238
 		parent::initRecursive($namingContainer);
239 239
 	}
240 240
         
241
-        /**
242
-         * Function to update view controls with data in a given AR object.
243
-         * View controls and AR object need to have the same name in IDs and Attrs respectively.
244
-         * @param TActiveRecord $arObj
245
-         * @param Boolean $throwExceptions Wheter or not to throw exceptions
246
-         * @author Daniel Sampedro <[email protected]>
247
-         */
248
-        public function tryToUpdateView($arObj, $throwExceptions = false)
249
-        {
250
-                $objAttrs = get_class_vars(get_class($arObj));
251
-                foreach (array_keys($objAttrs) as $key)
252
-                {
253
-                        try
254
-                        {
255
-                                if ($key != "RELATIONS")
256
-                                {
257
-                                        $control = $this->{$key};
258
-                                        if ($control instanceof TTextBox)
259
-                                                $control->Text = $arObj->{$key};
260
-                                        elseif ($control instanceof TCheckBox)
261
-                                                $control->Checked = (boolean) $arObj->{$key};
262
-                                        elseif ($control instanceof TDatePicker)
263
-                                                $control->Date = $arObj->{$key};
264
-                                }
265
-                                else
266
-                                {
267
-                                        foreach ($objAttrs["RELATIONS"] as $relKey => $relValues)
268
-                                        {
269
-                                                $relControl = $this->{$relKey};
270
-                                                switch ($relValues[0])
271
-                                                {
272
-                                                        case TActiveRecord::BELONGS_TO:
273
-                                                        case TActiveRecord::HAS_ONE:
274
-                                                                $relControl->Text = $arObj->{$relKey};
275
-                                                                break;
276
-                                                        case TActiveRecord::HAS_MANY:
277
-                                                                if ($relControl instanceof TListControl)
278
-                                                                {
279
-                                                                        $relControl->DataSource = $arObj->{$relKey};
280
-                                                                        $relControl->dataBind();
281
-                                                                }
282
-                                                                break;
283
-                                                }
284
-                                        }
285
-                                        break;
286
-                                }
287
-                        } 
288
-                        catch (Exception $ex)
289
-                        {
290
-                                if ($throwExceptions)
291
-                                        throw $ex;
292
-                        }
293
-                }
294
-        }
241
+		/**
242
+		 * Function to update view controls with data in a given AR object.
243
+		 * View controls and AR object need to have the same name in IDs and Attrs respectively.
244
+		 * @param TActiveRecord $arObj
245
+		 * @param Boolean $throwExceptions Wheter or not to throw exceptions
246
+		 * @author Daniel Sampedro <[email protected]>
247
+		 */
248
+		public function tryToUpdateView($arObj, $throwExceptions = false)
249
+		{
250
+				$objAttrs = get_class_vars(get_class($arObj));
251
+				foreach (array_keys($objAttrs) as $key)
252
+				{
253
+						try
254
+						{
255
+								if ($key != "RELATIONS")
256
+								{
257
+										$control = $this->{$key};
258
+										if ($control instanceof TTextBox)
259
+												$control->Text = $arObj->{$key};
260
+										elseif ($control instanceof TCheckBox)
261
+												$control->Checked = (boolean) $arObj->{$key};
262
+										elseif ($control instanceof TDatePicker)
263
+												$control->Date = $arObj->{$key};
264
+								}
265
+								else
266
+								{
267
+										foreach ($objAttrs["RELATIONS"] as $relKey => $relValues)
268
+										{
269
+												$relControl = $this->{$relKey};
270
+												switch ($relValues[0])
271
+												{
272
+														case TActiveRecord::BELONGS_TO:
273
+														case TActiveRecord::HAS_ONE:
274
+																$relControl->Text = $arObj->{$relKey};
275
+																break;
276
+														case TActiveRecord::HAS_MANY:
277
+																if ($relControl instanceof TListControl)
278
+																{
279
+																		$relControl->DataSource = $arObj->{$relKey};
280
+																		$relControl->dataBind();
281
+																}
282
+																break;
283
+												}
284
+										}
285
+										break;
286
+								}
287
+						} 
288
+						catch (Exception $ex)
289
+						{
290
+								if ($throwExceptions)
291
+										throw $ex;
292
+						}
293
+				}
294
+		}
295 295
 
296
-        /**
297
-         * Function to try to update an AR object with data in view controls.
298
-         * @param TActiveRecord $arObj
299
-         * @param Boolean $throwExceptions Wheter or not to throw exceptions
300
-         * @author Daniel Sampedro <[email protected]>
301
-         */
302
-        public function tryToUpdateAR($arObj, $throwExceptions = false)
303
-        {
304
-                $objAttrs = get_class_vars(get_class($arObj));
305
-                foreach (array_keys($objAttrs) as $key)
306
-                {
307
-                        try
308
-                        {
309
-                                if ($key == "RELATIONS")
310
-                                        break;
311
-                                $control = $this->{$key};
312
-                                if ($control instanceof TTextBox)
313
-                                        $arObj->{$key} = $control->Text;
314
-                                elseif ($control instanceof TCheckBox)
315
-                                        $arObj->{$key} = $control->Checked;
316
-                                elseif ($control instanceof TDatePicker)
317
-                                        $arObj->{$key} = $control->Date;
318
-                        } 
319
-                        catch (Exception $ex)
320
-                        {
321
-                                if ($throwExceptions)
322
-                                        throw $ex;
323
-                        }
324
-                }
325
-        }
296
+		/**
297
+		 * Function to try to update an AR object with data in view controls.
298
+		 * @param TActiveRecord $arObj
299
+		 * @param Boolean $throwExceptions Wheter or not to throw exceptions
300
+		 * @author Daniel Sampedro <[email protected]>
301
+		 */
302
+		public function tryToUpdateAR($arObj, $throwExceptions = false)
303
+		{
304
+				$objAttrs = get_class_vars(get_class($arObj));
305
+				foreach (array_keys($objAttrs) as $key)
306
+				{
307
+						try
308
+						{
309
+								if ($key == "RELATIONS")
310
+										break;
311
+								$control = $this->{$key};
312
+								if ($control instanceof TTextBox)
313
+										$arObj->{$key} = $control->Text;
314
+								elseif ($control instanceof TCheckBox)
315
+										$arObj->{$key} = $control->Checked;
316
+								elseif ($control instanceof TDatePicker)
317
+										$arObj->{$key} = $control->Date;
318
+						} 
319
+						catch (Exception $ex)
320
+						{
321
+								if ($throwExceptions)
322
+										throw $ex;
323
+						}
324
+				}
325
+		}
326 326
 }
327 327
 
Please login to merge, or discard this patch.
framework/Web/THttpSession.php 1 patch
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -306,10 +306,10 @@
 block discarded – undo
306 306
 		{
307 307
 			$value=TPropertyValue::ensureEnum($value,'THttpSessionCookieMode');
308 308
 			if($value===THttpSessionCookieMode::None) 
309
-      {
309
+	  {
310 310
 				ini_set('session.use_cookies','0');
311 311
 			  ini_set('session.use_only_cookies','0');
312
-      }
312
+	  }
313 313
 			else if($value===THttpSessionCookieMode::Allow)
314 314
 			{
315 315
 				ini_set('session.use_cookies','1');
Please login to merge, or discard this patch.
requirements/index.php 1 patch
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -62,31 +62,31 @@
 block discarded – undo
62 62
 		class_exists("DOMDocument",false),
63 63
 		'DOM extension check',
64 64
 		'DOM extension required'),
65
-    array(
66
-        true,
67
-        extension_loaded("SPL"),
68
-        'SPL extension check',
69
-        'SPL extension required'),
70
-    array(
71
-        true,
72
-        extension_loaded("CType"),
73
-        'CType extension check',
74
-        'CType extension required'),
75
-    array(
76
-        true,
77
-        extension_loaded("pcre"),
78
-        'PCRE extension check',
79
-        'PCRE extension required'),
80
-    array(
81
-        true,
82
-        extension_loaded("json"),
83
-        'JSON extension check',
84
-        'JSON extension required'),
85
-    array(
86
-        false,
87
-        class_exists("PDO",false),
88
-        'PDO extension check',
89
-        'PDO extension optional'),
65
+	array(
66
+		true,
67
+		extension_loaded("SPL"),
68
+		'SPL extension check',
69
+		'SPL extension required'),
70
+	array(
71
+		true,
72
+		extension_loaded("CType"),
73
+		'CType extension check',
74
+		'CType extension required'),
75
+	array(
76
+		true,
77
+		extension_loaded("pcre"),
78
+		'PCRE extension check',
79
+		'PCRE extension required'),
80
+	array(
81
+		true,
82
+		extension_loaded("json"),
83
+		'JSON extension check',
84
+		'JSON extension required'),
85
+	array(
86
+		false,
87
+		class_exists("PDO",false),
88
+		'PDO extension check',
89
+		'PDO extension optional'),
90 90
 	array(
91 91
 		false,
92 92
 		function_exists("iconv"),
Please login to merge, or discard this patch.
framework/Util/TDateTimeStamp.php 1 patch
Indentation   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,6 @@  discard block
 block discarded – undo
1 1
 <?php
2 2
 /**
3 3
  * TDateTimeStamp class file.
4
-
5 4
  * @author Fabio Bas ctrlaltca[AT]gmail[DOT]com
6 5
  * @link https://github.com/pradosoft/prado
7 6
  * @copyright Copyright &copy; 2005-2015 The PRADO Group
@@ -186,7 +185,7 @@  discard block
 block discarded – undo
186 185
 
187 186
 	/**
188 187
 	 * @return integer|float a timestamp given a local time
189
-     */
188
+	 */
190 189
 	function getTimeStamp($hr,$min,$sec,$mon=false,$day=false,$year=false,$is_gmt=false)
191 190
 	{
192 191
 		$dt = new DateTime();
Please login to merge, or discard this patch.
framework/TComponent.php 1 patch
Indentation   +12 added lines, -12 removed lines patch added patch discarded remove patch
@@ -1,17 +1,17 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * TComponent, TPropertyValue classes
4
- *
5
- * @author Qiang Xue <[email protected]>
6
- *
7
- * Global Events, intra-object events, Class behaviors, expanded behaviors
8
- * @author Brad Anderson <[email protected]>
9
- *
10
- * @link https://github.com/pradosoft/prado
11
- * @copyright Copyright &copy; 2005-2016 The PRADO Group
12
- * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
13
- * @package System
14
- */
3
+	 * TComponent, TPropertyValue classes
4
+	 *
5
+	 * @author Qiang Xue <[email protected]>
6
+	 *
7
+	 * Global Events, intra-object events, Class behaviors, expanded behaviors
8
+	 * @author Brad Anderson <[email protected]>
9
+	 *
10
+	 * @link https://github.com/pradosoft/prado
11
+	 * @copyright Copyright &copy; 2005-2016 The PRADO Group
12
+	 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
13
+	 * @package System
14
+	 */
15 15
 
16 16
 /**
17 17
  * TComponent class
Please login to merge, or discard this patch.
framework/I18N/TGlobalization.php 1 patch
Indentation   +8 added lines, -8 removed lines patch added patch discarded remove patch
@@ -1,13 +1,13 @@
 block discarded – undo
1 1
 <?php
2 2
 /**
3
- * TGlobalization class file.
4
- *
5
- * @author Wei Zhuo<weizhuo[at]gmail[dot]com>
6
- * @link https://github.com/pradosoft/prado
7
- * @copyright Copyright &copy; 2005-2016 The PRADO Group
8
- * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
- * @package System.I18N
10
- */
3
+	 * TGlobalization class file.
4
+	 *
5
+	 * @author Wei Zhuo<weizhuo[at]gmail[dot]com>
6
+	 * @link https://github.com/pradosoft/prado
7
+	 * @copyright Copyright &copy; 2005-2016 The PRADO Group
8
+	 * @license https://github.com/pradosoft/prado/blob/master/COPYRIGHT
9
+	 * @package System.I18N
10
+	 */
11 11
 
12 12
 
13 13
 /**
Please login to merge, or discard this patch.