Completed
Pull Request — v3.0 (#136)
by
unknown
25:07
created
web_interface/astpp/system/database/DB_forge.php 2 patches
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -24,10 +24,10 @@  discard block
 block discarded – undo
24 24
  */
25 25
 class CI_DB_forge {
26 26
 
27
-	var $fields			= array();
28
-	var $keys			= array();
29
-	var $primary_keys	= array();
30
-	var $db_char_set	=	'';
27
+	var $fields = array();
28
+	var $keys = array();
29
+	var $primary_keys = array();
30
+	var $db_char_set = '';
31 31
 
32 32
 	/**
33 33
 	 * Constructor
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
 	function __construct()
39 39
 	{
40 40
 		// Assign the main database object to $this->db
41
-		$CI =& get_instance();
42
-		$this->db =& $CI->db;
41
+		$CI = & get_instance();
42
+		$this->db = & $CI->db;
43 43
 		log_message('debug', "Database Forge Class Initialized");
44 44
 	}
45 45
 
@@ -371,9 +371,9 @@  discard block
 block discarded – undo
371 371
 	 */
372 372
 	function _reset()
373 373
 	{
374
-		$this->fields		= array();
375
-		$this->keys			= array();
376
-		$this->primary_keys	= array();
374
+		$this->fields = array();
375
+		$this->keys = array();
376
+		$this->primary_keys = array();
377 377
 	}
378 378
 
379 379
 }
Please login to merge, or discard this patch.
Braces   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Code Igniter
4 6
  *
@@ -115,8 +117,7 @@  discard block
 block discarded – undo
115 117
 		if ($primary === TRUE)
116 118
 		{
117 119
 			$this->primary_keys[] = $key;
118
-		}
119
-		else
120
+		} else
120 121
 		{
121 122
 			$this->keys[] = $key;
122 123
 		}
@@ -150,8 +151,7 @@  discard block
 block discarded – undo
150 151
 													)
151 152
 								));
152 153
 				$this->add_key('id', TRUE);
153
-			}
154
-			else
154
+			} else
155 155
 			{
156 156
 				if (strpos($field, ' ') === FALSE)
157 157
 				{
Please login to merge, or discard this patch.
web_interface/astpp/system/helpers/xml_helper.php 2 patches
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -46,19 +46,19 @@
 block discarded – undo
46 46
 
47 47
 		if ($protect_all === TRUE)
48 48
 		{
49
-			$str = preg_replace("/&(\w+);/",  "$temp\\1;", $str);
49
+			$str = preg_replace("/&(\w+);/", "$temp\\1;", $str);
50 50
 		}
51 51
 
52
-		$str = str_replace(array("&","<",">","\"", "'", "-"),
52
+		$str = str_replace(array("&", "<", ">", "\"", "'", "-"),
53 53
 							array("&amp;", "&lt;", "&gt;", "&quot;", "&apos;", "&#45;"),
54 54
 							$str);
55 55
 
56 56
 		// Decode the temp markers back to entities
57
-		$str = preg_replace("/$temp(\d+);/","&#\\1;",$str);
57
+		$str = preg_replace("/$temp(\d+);/", "&#\\1;", $str);
58 58
 
59 59
 		if ($protect_all === TRUE)
60 60
 		{
61
-			$str = preg_replace("/$temp(\w+);/","&\\1;", $str);
61
+			$str = preg_replace("/$temp(\w+);/", "&\\1;", $str);
62 62
 		}
63 63
 
64 64
 		return $str;
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /*
3 5
 | -------------------------------------------------------------------
4 6
 | AUTO-LOADER
Please login to merge, or discard this patch.
web_interface/astpp/system/helpers/typography_helper.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -38,7 +38,7 @@  discard block
 block discarded – undo
38 38
 {
39 39
 	function nl2br_except_pre($str)
40 40
 	{
41
-		$CI =& get_instance();
41
+		$CI = & get_instance();
42 42
 
43 43
 		$CI->load->library('typography');
44 44
 
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
 {
63 63
 	function auto_typography($str, $strip_js_event_handlers = TRUE, $reduce_linebreaks = FALSE)
64 64
 	{
65
-		$CI =& get_instance();
65
+		$CI = & get_instance();
66 66
 		$CI->load->library('typography');
67 67
 		return $CI->typography->auto_typography($str, $strip_js_event_handlers, $reduce_linebreaks);
68 68
 	}
@@ -82,7 +82,7 @@  discard block
 block discarded – undo
82 82
  */
83 83
 if ( ! function_exists('entity_decode'))
84 84
 {
85
-	function entity_decode($str, $charset='UTF-8')
85
+	function entity_decode($str, $charset = 'UTF-8')
86 86
 	{
87 87
 		global $SEC;
88 88
 		return $SEC->entity_decode($str, $charset);
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /*
3 5
 | -------------------------------------------------------------------
4 6
 | AUTO-LOADER
Please login to merge, or discard this patch.
web_interface/astpp/system/helpers/download_helper.php 1 patch
Braces   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -61,8 +63,7 @@  discard block
 block discarded – undo
61 63
 		if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/mimes.php'))
62 64
 		{
63 65
 			include(APPPATH.'config/'.ENVIRONMENT.'/mimes.php');
64
-		}
65
-		elseif (is_file(APPPATH.'config/mimes.php'))
66
+		} elseif (is_file(APPPATH.'config/mimes.php'))
66 67
 		{
67 68
 			include(APPPATH.'config/mimes.php');
68 69
 		}
@@ -71,8 +72,7 @@  discard block
 block discarded – undo
71 72
 		if ( ! isset($mimes[$extension]))
72 73
 		{
73 74
 			$mime = 'application/octet-stream';
74
-		}
75
-		else
75
+		} else
76 76
 		{
77 77
 			$mime = (is_array($mimes[$extension])) ? $mimes[$extension][0] : $mimes[$extension];
78 78
 		}
@@ -87,8 +87,7 @@  discard block
 block discarded – undo
87 87
 			header("Content-Transfer-Encoding: binary");
88 88
 			header('Pragma: public');
89 89
 			header("Content-Length: ".strlen($data));
90
-		}
91
-		else
90
+		} else
92 91
 		{
93 92
 			header('Content-Type: "'.$mime.'"');
94 93
 			header('Content-Disposition: attachment; filename="'.$filename.'"');
Please login to merge, or discard this patch.
web_interface/astpp/system/helpers/html_helper.php 2 patches
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -120,13 +120,13 @@  discard block
 block discarded – undo
120 120
 			$atts = '';
121 121
 			foreach ($attributes as $key => $val)
122 122
 			{
123
-				$atts .= ' ' . $key . '="' . $val . '"';
123
+				$atts .= ' '.$key.'="'.$val.'"';
124 124
 			}
125 125
 			$attributes = $atts;
126 126
 		}
127 127
 		elseif (is_string($attributes) AND strlen($attributes) > 0)
128 128
 		{
129
-			$attributes = ' '. $attributes;
129
+			$attributes = ' '.$attributes;
130 130
 		}
131 131
 
132 132
 		// Write the opening list tag
@@ -199,7 +199,7 @@  discard block
 block discarded – undo
199 199
 {
200 200
 	function img($src = '', $index_page = FALSE)
201 201
 	{
202
-		if ( ! is_array($src) )
202
+		if ( ! is_array($src))
203 203
 		{
204 204
 			$src = array('src' => $src);
205 205
 		}
@@ -217,7 +217,7 @@  discard block
 block discarded – undo
217 217
 
218 218
 			if ($k == 'src' AND strpos($v, '://') === FALSE)
219 219
 			{
220
-				$CI =& get_instance();
220
+				$CI = & get_instance();
221 221
 
222 222
 				if ($index_page === TRUE)
223 223
 				{
@@ -309,7 +309,7 @@  discard block
 block discarded – undo
309 309
 {
310 310
 	function link_tag($href = '', $rel = 'stylesheet', $type = 'text/css', $title = '', $media = '', $index_page = FALSE)
311 311
 	{
312
-		$CI =& get_instance();
312
+		$CI = & get_instance();
313 313
 
314 314
 		$link = '<link ';
315 315
 
@@ -338,7 +338,7 @@  discard block
 block discarded – undo
338 338
 		}
339 339
 		else
340 340
 		{
341
-			if ( strpos($href, '://') !== FALSE)
341
+			if (strpos($href, '://') !== FALSE)
342 342
 			{
343 343
 				$link .= 'href="'.$href.'" ';
344 344
 			}
@@ -353,12 +353,12 @@  discard block
 block discarded – undo
353 353
 
354 354
 			$link .= 'rel="'.$rel.'" type="'.$type.'" ';
355 355
 
356
-			if ($media	!= '')
356
+			if ($media != '')
357 357
 			{
358 358
 				$link .= 'media="'.$media.'" ';
359 359
 			}
360 360
 
361
-			if ($title	!= '')
361
+			if ($title != '')
362 362
 			{
363 363
 				$link .= 'title="'.$title.'" ';
364 364
 			}
@@ -403,9 +403,9 @@  discard block
 block discarded – undo
403 403
 		foreach ($name as $meta)
404 404
 		{
405 405
 			$type		= ( ! isset($meta['type']) OR $meta['type'] == 'name') ? 'name' : 'http-equiv';
406
-			$name		= ( ! isset($meta['name']))		? ''	: $meta['name'];
407
-			$content	= ( ! isset($meta['content']))	? ''	: $meta['content'];
408
-			$newline	= ( ! isset($meta['newline']))	? "\n"	: $meta['newline'];
406
+			$name		= ( ! isset($meta['name'])) ? '' : $meta['name'];
407
+			$content	= ( ! isset($meta['content'])) ? '' : $meta['content'];
408
+			$newline	= ( ! isset($meta['newline'])) ? "\n" : $meta['newline'];
409 409
 
410 410
 			$str .= '<meta '.$type.'="'.$name.'" content="'.$content.'" />'.$newline;
411 411
 		}
Please login to merge, or discard this patch.
Braces   +15 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -123,8 +125,7 @@  discard block
 block discarded – undo
123 125
 				$atts .= ' ' . $key . '="' . $val . '"';
124 126
 			}
125 127
 			$attributes = $atts;
126
-		}
127
-		elseif (is_string($attributes) AND strlen($attributes) > 0)
128
+		} elseif (is_string($attributes) AND strlen($attributes) > 0)
128 129
 		{
129 130
 			$attributes = ' '. $attributes;
130 131
 		}
@@ -146,8 +147,7 @@  discard block
 block discarded – undo
146 147
 			if ( ! is_array($val))
147 148
 			{
148 149
 				$out .= $val;
149
-			}
150
-			else
150
+			} else
151 151
 			{
152 152
 				$out .= $_last_list_item."\n";
153 153
 				$out .= _list($type, $val, '', $depth + 4);
@@ -222,13 +222,11 @@  discard block
 block discarded – undo
222 222
 				if ($index_page === TRUE)
223 223
 				{
224 224
 					$img .= ' src="'.$CI->config->site_url($v).'"';
225
-				}
226
-				else
225
+				} else
227 226
 				{
228 227
 					$img .= ' src="'.$CI->config->slash_item('base_url').$v.'"';
229 228
 				}
230
-			}
231
-			else
229
+			} else
232 230
 			{
233 231
 				$img .= " $k=\"$v\"";
234 232
 			}
@@ -266,8 +264,7 @@  discard block
 block discarded – undo
266 264
 			if (defined('ENVIRONMENT') AND is_file(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php'))
267 265
 			{
268 266
 				include(APPPATH.'config/'.ENVIRONMENT.'/doctypes.php');
269
-			}
270
-			elseif (is_file(APPPATH.'config/doctypes.php'))
267
+			} elseif (is_file(APPPATH.'config/doctypes.php'))
271 268
 			{
272 269
 				include(APPPATH.'config/doctypes.php');
273 270
 			}
@@ -281,8 +278,7 @@  discard block
 block discarded – undo
281 278
 		if (isset($_doctypes[$type]))
282 279
 		{
283 280
 			return $_doctypes[$type];
284
-		}
285
-		else
281
+		} else
286 282
 		{
287 283
 			return FALSE;
288 284
 		}
@@ -322,31 +318,26 @@  discard block
 block discarded – undo
322 318
 					if ($index_page === TRUE)
323 319
 					{
324 320
 						$link .= 'href="'.$CI->config->site_url($v).'" ';
325
-					}
326
-					else
321
+					} else
327 322
 					{
328 323
 						$link .= 'href="'.$CI->config->slash_item('base_url').$v.'" ';
329 324
 					}
330
-				}
331
-				else
325
+				} else
332 326
 				{
333 327
 					$link .= "$k=\"$v\" ";
334 328
 				}
335 329
 			}
336 330
 
337 331
 			$link .= "/>";
338
-		}
339
-		else
332
+		} else
340 333
 		{
341 334
 			if ( strpos($href, '://') !== FALSE)
342 335
 			{
343 336
 				$link .= 'href="'.$href.'" ';
344
-			}
345
-			elseif ($index_page === TRUE)
337
+			} elseif ($index_page === TRUE)
346 338
 			{
347 339
 				$link .= 'href="'.$CI->config->site_url($href).'" ';
348
-			}
349
-			else
340
+			} else
350 341
 			{
351 342
 				$link .= 'href="'.$CI->config->slash_item('base_url').$href.'" ';
352 343
 			}
@@ -389,8 +380,7 @@  discard block
 block discarded – undo
389 380
 		if ( ! is_array($name))
390 381
 		{
391 382
 			$name = array(array('name' => $name, 'content' => $content, 'type' => $type, 'newline' => $newline));
392
-		}
393
-		else
383
+		} else
394 384
 		{
395 385
 			// Turn single array into multidimensional
396 386
 			if (isset($name['name']))
Please login to merge, or discard this patch.
web_interface/astpp/system/helpers/directory_helper.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -45,9 +45,9 @@
 block discarded – undo
45 45
 	{
46 46
 		if ($fp = @opendir($source_dir))
47 47
 		{
48
-			$filedata	= array();
49
-			$new_depth	= $directory_depth - 1;
50
-			$source_dir	= rtrim($source_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
48
+			$filedata = array();
49
+			$new_depth = $directory_depth - 1;
50
+			$source_dir = rtrim($source_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;
51 51
 
52 52
 			while (FALSE !== ($file = readdir($fp)))
53 53
 			{
Please login to merge, or discard this patch.
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -60,8 +62,7 @@  discard block
 block discarded – undo
60 62
 				if (($directory_depth < 1 OR $new_depth > 0) && @is_dir($source_dir.$file))
61 63
 				{
62 64
 					$filedata[$file] = directory_map($source_dir.$file.DIRECTORY_SEPARATOR, $new_depth, $hidden);
63
-				}
64
-				else
65
+				} else
65 66
 				{
66 67
 					$filedata[] = $file;
67 68
 				}
Please login to merge, or discard this patch.
web_interface/astpp/system/helpers/array_helper.php 1 patch
Braces   +4 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -104,8 +106,7 @@  discard block
 block discarded – undo
104 106
 			if (isset($array[$item]))
105 107
 			{
106 108
 				$return[$item] = $array[$item];
107
-			}
108
-			else
109
+			} else
109 110
 			{
110 111
 				$return[$item] = $default;
111 112
 			}
Please login to merge, or discard this patch.
web_interface/astpp/system/helpers/date_helper.php 2 patches
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -39,7 +39,7 @@  discard block
 block discarded – undo
39 39
 {
40 40
 	function now()
41 41
 	{
42
-		$CI =& get_instance();
42
+		$CI = & get_instance();
43 43
 
44 44
 		if (strtolower($CI->config->item('time_reference')) == 'gmt')
45 45
 		{
@@ -149,7 +149,7 @@  discard block
 block discarded – undo
149 149
 {
150 150
 	function timespan($seconds = 1, $time = '')
151 151
 	{
152
-		$CI =& get_instance();
152
+		$CI = & get_instance();
153 153
 		$CI->lang->load('date');
154 154
 
155 155
 		if ( ! is_numeric($seconds))
@@ -176,7 +176,7 @@  discard block
 block discarded – undo
176 176
 
177 177
 		if ($years > 0)
178 178
 		{
179
-			$str .= $years.' '.$CI->lang->line((($years	> 1) ? 'date_years' : 'date_year')).', ';
179
+			$str .= $years.' '.$CI->lang->line((($years > 1) ? 'date_years' : 'date_year')).', ';
180 180
 		}
181 181
 
182 182
 		$seconds -= $years * 31536000;
@@ -186,7 +186,7 @@  discard block
 block discarded – undo
186 186
 		{
187 187
 			if ($months > 0)
188 188
 			{
189
-				$str .= $months.' '.$CI->lang->line((($months	> 1) ? 'date_months' : 'date_month')).', ';
189
+				$str .= $months.' '.$CI->lang->line((($months > 1) ? 'date_months' : 'date_month')).', ';
190 190
 			}
191 191
 
192 192
 			$seconds -= $months * 2628000;
@@ -198,7 +198,7 @@  discard block
 block discarded – undo
198 198
 		{
199 199
 			if ($weeks > 0)
200 200
 			{
201
-				$str .= $weeks.' '.$CI->lang->line((($weeks	> 1) ? 'date_weeks' : 'date_week')).', ';
201
+				$str .= $weeks.' '.$CI->lang->line((($weeks > 1) ? 'date_weeks' : 'date_week')).', ';
202 202
 			}
203 203
 
204 204
 			$seconds -= $weeks * 604800;
@@ -210,7 +210,7 @@  discard block
 block discarded – undo
210 210
 		{
211 211
 			if ($days > 0)
212 212
 			{
213
-				$str .= $days.' '.$CI->lang->line((($days	> 1) ? 'date_days' : 'date_day')).', ';
213
+				$str .= $days.' '.$CI->lang->line((($days > 1) ? 'date_days' : 'date_day')).', ';
214 214
 			}
215 215
 
216 216
 			$seconds -= $days * 86400;
@@ -222,7 +222,7 @@  discard block
 block discarded – undo
222 222
 		{
223 223
 			if ($hours > 0)
224 224
 			{
225
-				$str .= $hours.' '.$CI->lang->line((($hours	> 1) ? 'date_hours' : 'date_hour')).', ';
225
+				$str .= $hours.' '.$CI->lang->line((($hours > 1) ? 'date_hours' : 'date_hour')).', ';
226 226
 			}
227 227
 
228 228
 			$seconds -= $hours * 3600;
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 		{
235 235
 			if ($minutes > 0)
236 236
 			{
237
-				$str .= $minutes.' '.$CI->lang->line((($minutes	> 1) ? 'date_minutes' : 'date_minute')).', ';
237
+				$str .= $minutes.' '.$CI->lang->line((($minutes > 1) ? 'date_minutes' : 'date_minute')).', ';
238 238
 			}
239 239
 
240 240
 			$seconds -= $minutes * 60;
@@ -242,7 +242,7 @@  discard block
 block discarded – undo
242 242
 
243 243
 		if ($str == '')
244 244
 		{
245
-			$str .= $seconds.' '.$CI->lang->line((($seconds	> 1) ? 'date_seconds' : 'date_second')).', ';
245
+			$str .= $seconds.' '.$CI->lang->line((($seconds > 1) ? 'date_seconds' : 'date_second')).', ';
246 246
 		}
247 247
 
248 248
 		return substr(trim($str), 0, -1);
@@ -284,7 +284,7 @@  discard block
 block discarded – undo
284 284
 			}
285 285
 		}
286 286
 
287
-		$days_in_month	= array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
287
+		$days_in_month = array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
288 288
 		return $days_in_month[$month - 1];
289 289
 	}
290 290
 }
@@ -305,7 +305,7 @@  discard block
 block discarded – undo
305 305
 		if ($time == '')
306 306
 			$time = time();
307 307
 
308
-		return mktime( gmdate("H", $time), gmdate("i", $time), gmdate("s", $time), gmdate("m", $time), gmdate("d", $time), gmdate("Y", $time));
308
+		return mktime(gmdate("H", $time), gmdate("i", $time), gmdate("s", $time), gmdate("m", $time), gmdate("d", $time), gmdate("Y", $time));
309 309
 	}
310 310
 }
311 311
 
@@ -394,7 +394,7 @@  discard block
 block discarded – undo
394 394
 {
395 395
 	function unix_to_human($time = '', $seconds = FALSE, $fmt = 'us')
396 396
 	{
397
-		$r  = date('Y', $time).'-'.date('m', $time).'-'.date('d', $time).' ';
397
+		$r = date('Y', $time).'-'.date('m', $time).'-'.date('d', $time).' ';
398 398
 
399 399
 		if ($fmt == 'us')
400 400
 		{
@@ -452,8 +452,8 @@  discard block
 block discarded – undo
452 452
 		$ex = explode("-", $split['0']);
453 453
 
454 454
 		$year  = (strlen($ex['0']) == 2) ? '20'.$ex['0'] : $ex['0'];
455
-		$month = (strlen($ex['1']) == 1) ? '0'.$ex['1']  : $ex['1'];
456
-		$day   = (strlen($ex['2']) == 1) ? '0'.$ex['2']  : $ex['2'];
455
+		$month = (strlen($ex['1']) == 1) ? '0'.$ex['1'] : $ex['1'];
456
+		$day   = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2'];
457 457
 
458 458
 		$ex = explode(":", $split['1']);
459 459
 
@@ -462,7 +462,7 @@  discard block
 block discarded – undo
462 462
 
463 463
 		if (isset($ex['2']) && preg_match('/[0-9]{1,2}/', $ex['2']))
464 464
 		{
465
-			$sec  = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2'];
465
+			$sec = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2'];
466 466
 		}
467 467
 		else
468 468
 		{
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
 				$hour = $hour + 12;
479 479
 
480 480
 			if (substr($ampm, 0, 1) == 'a' AND $hour == 12)
481
-				$hour =  '00';
481
+				$hour = '00';
482 482
 
483 483
 			if (strlen($hour) == 1)
484 484
 				$hour = '0'.$hour;
@@ -505,7 +505,7 @@  discard block
 block discarded – undo
505 505
 {
506 506
 	function timezone_menu($default = 'UTC', $class = "", $name = 'timezones')
507 507
 	{
508
-		$CI =& get_instance();
508
+		$CI = & get_instance();
509 509
 		$CI->lang->load('date');
510 510
 
511 511
 		if ($default == 'GMT')
Please login to merge, or discard this patch.
Braces   +31 added lines, -25 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -53,8 +55,7 @@  discard block
 block discarded – undo
53 55
 			}
54 56
 
55 57
 			return $system_time;
56
-		}
57
-		else
58
+		} else
58 59
 		{
59 60
 			return time();
60 61
 		}
@@ -84,11 +85,13 @@  discard block
 block discarded – undo
84 85
 {
85 86
 	function mdate($datestr = '', $time = '')
86 87
 	{
87
-		if ($datestr == '')
88
-			return '';
88
+		if ($datestr == '') {
89
+					return '';
90
+		}
89 91
 
90
-		if ($time == '')
91
-			$time = now();
92
+		if ($time == '') {
93
+					$time = now();
94
+		}
92 95
 
93 96
 		$datestr = str_replace('%\\', '', preg_replace("/([a-z]+?){1}/i", "\\\\\\1", $datestr));
94 97
 		return date($datestr, $time);
@@ -165,8 +168,7 @@  discard block
 block discarded – undo
165 168
 		if ($time <= $seconds)
166 169
 		{
167 170
 			$seconds = 1;
168
-		}
169
-		else
171
+		} else
170 172
 		{
171 173
 			$seconds = $time - $seconds;
172 174
 		}
@@ -302,8 +304,9 @@  discard block
 block discarded – undo
302 304
 {
303 305
 	function local_to_gmt($time = '')
304 306
 	{
305
-		if ($time == '')
306
-			$time = time();
307
+		if ($time == '') {
308
+					$time = time();
309
+		}
307 310
 
308 311
 		return mktime( gmdate("H", $time), gmdate("i", $time), gmdate("s", $time), gmdate("m", $time), gmdate("d", $time), gmdate("Y", $time));
309 312
 	}
@@ -399,8 +402,7 @@  discard block
 block discarded – undo
399 402
 		if ($fmt == 'us')
400 403
 		{
401 404
 			$r .= date('h', $time).':'.date('i', $time);
402
-		}
403
-		else
405
+		} else
404 406
 		{
405 407
 			$r .= date('H', $time).':'.date('i', $time);
406 408
 		}
@@ -463,8 +465,7 @@  discard block
 block discarded – undo
463 465
 		if (isset($ex['2']) && preg_match('/[0-9]{1,2}/', $ex['2']))
464 466
 		{
465 467
 			$sec  = (strlen($ex['2']) == 1) ? '0'.$ex['2'] : $ex['2'];
466
-		}
467
-		else
468
+		} else
468 469
 		{
469 470
 			// Unless specified, seconds get set to zero.
470 471
 			$sec = '00';
@@ -474,14 +475,17 @@  discard block
 block discarded – undo
474 475
 		{
475 476
 			$ampm = strtolower($split['2']);
476 477
 
477
-			if (substr($ampm, 0, 1) == 'p' AND $hour < 12)
478
-				$hour = $hour + 12;
478
+			if (substr($ampm, 0, 1) == 'p' AND $hour < 12) {
479
+							$hour = $hour + 12;
480
+			}
479 481
 
480
-			if (substr($ampm, 0, 1) == 'a' AND $hour == 12)
481
-				$hour =  '00';
482
+			if (substr($ampm, 0, 1) == 'a' AND $hour == 12) {
483
+							$hour =  '00';
484
+			}
482 485
 
483
-			if (strlen($hour) == 1)
484
-				$hour = '0'.$hour;
486
+			if (strlen($hour) == 1) {
487
+							$hour = '0'.$hour;
488
+			}
485 489
 		}
486 490
 
487 491
 		return mktime($hour, $min, $sec, $month, $day, $year);
@@ -508,8 +512,9 @@  discard block
 block discarded – undo
508 512
 		$CI =& get_instance();
509 513
 		$CI->lang->load('date');
510 514
 
511
-		if ($default == 'GMT')
512
-			$default = 'UTC';
515
+		if ($default == 'GMT') {
516
+					$default = 'UTC';
517
+		}
513 518
 
514 519
 		$menu = '<select name="'.$name.'"';
515 520
 
@@ -599,8 +604,9 @@  discard block
 block discarded – undo
599 604
 			return $zones;
600 605
 		}
601 606
 
602
-		if ($tz == 'GMT')
603
-			$tz = 'UTC';
607
+		if ($tz == 'GMT') {
608
+					$tz = 'UTC';
609
+		}
604 610
 
605 611
 		return ( ! isset($zones[$tz])) ? 0 : $zones[$tz];
606 612
 	}
Please login to merge, or discard this patch.
web_interface/astpp/system/helpers/smiley_helper.php 3 patches
Indentation   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -231,7 +231,7 @@
 block discarded – undo
231 231
 	{
232 232
 		if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'))
233 233
 		{
234
-		    include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php');
234
+			include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php');
235 235
 		}
236 236
 		elseif (file_exists(APPPATH.'config/smileys.php'))
237 237
 		{
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -204,7 +204,7 @@
 block discarded – undo
204 204
 		}
205 205
 
206 206
 		// Add a trailing slash to the file path if needed
207
-		$image_url = preg_replace("/(.+?)\/*$/", "\\1/",  $image_url);
207
+		$image_url = preg_replace("/(.+?)\/*$/", "\\1/", $image_url);
208 208
 
209 209
 		foreach ($smileys as $key => $val)
210 210
 		{
Please login to merge, or discard this patch.
Braces   +6 added lines, -7 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@  discard block
 block discarded – undo
1
-<?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
1
+<?php  if ( ! defined('BASEPATH')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * CodeIgniter
4 6
  *
@@ -96,8 +98,7 @@  discard block
 block discarded – undo
96 98
 					}
97 99
 				}
98 100
 EOF;
99
-		}
100
-		else
101
+		} else
101 102
 		{
102 103
 			if (is_array($alias))
103 104
 			{
@@ -111,8 +112,7 @@  discard block
 block discarded – undo
111 112
 		if ($inline)
112 113
 		{
113 114
 			return '<script type="text/javascript" charset="utf-8">/*<![CDATA[ */'.$r.'// ]]></script>';
114
-		}
115
-		else
115
+		} else
116 116
 		{
117 117
 			return $r;
118 118
 		}
@@ -232,8 +232,7 @@  discard block
 block discarded – undo
232 232
 		if (defined('ENVIRONMENT') AND file_exists(APPPATH.'config/'.ENVIRONMENT.'/smileys.php'))
233 233
 		{
234 234
 		    include(APPPATH.'config/'.ENVIRONMENT.'/smileys.php');
235
-		}
236
-		elseif (file_exists(APPPATH.'config/smileys.php'))
235
+		} elseif (file_exists(APPPATH.'config/smileys.php'))
237 236
 		{
238 237
 			include(APPPATH.'config/smileys.php');
239 238
 		}
Please login to merge, or discard this patch.