Completed
Push — v3.0 ( 23635d...e28df5 )
by Samir
23s
created
web_interface/astpp/system/helpers/html_helper.php 1 patch
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.
web_interface/astpp/system/helpers/directory_helper.php 1 patch
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.
web_interface/astpp/system/helpers/url_helper.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -41,7 +41,7 @@  discard block
 block discarded – undo
41 41
 {
42 42
 	function site_url($uri = '')
43 43
 	{
44
-		$CI =& get_instance();
44
+		$CI = & get_instance();
45 45
 		return $CI->config->site_url($uri);
46 46
 	}
47 47
 }
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 {
64 64
 	function base_url($uri = '')
65 65
 	{
66
-		$CI =& get_instance();
66
+		$CI = & get_instance();
67 67
 		return $CI->config->base_url($uri);
68 68
 	}
69 69
 }
@@ -83,7 +83,7 @@  discard block
 block discarded – undo
83 83
 {
84 84
 	function current_url()
85 85
 	{
86
-		$CI =& get_instance();
86
+		$CI = & get_instance();
87 87
 		return $CI->config->site_url($CI->uri->uri_string());
88 88
 	}
89 89
 }
@@ -101,7 +101,7 @@  discard block
 block discarded – undo
101 101
 {
102 102
 	function uri_string()
103 103
 	{
104
-		$CI =& get_instance();
104
+		$CI = & get_instance();
105 105
 		return $CI->uri->uri_string();
106 106
 	}
107 107
 }
@@ -120,7 +120,7 @@  discard block
 block discarded – undo
120 120
 {
121 121
 	function index_page()
122 122
 	{
123
-		$CI =& get_instance();
123
+		$CI = & get_instance();
124 124
 		return $CI->config->item('index_page');
125 125
 	}
126 126
 }
@@ -142,7 +142,7 @@  discard block
 block discarded – undo
142 142
 {
143 143
 	function anchor($uri = '', $title = '', $attributes = '')
144 144
 	{
145
-		$title = (string) $title;
145
+		$title = (string)$title;
146 146
 
147 147
 		if ( ! is_array($uri))
148 148
 		{
@@ -185,7 +185,7 @@  discard block
 block discarded – undo
185 185
 {
186 186
 	function anchor_popup($uri = '', $title = '', $attributes = FALSE)
187 187
 	{
188
-		$title = (string) $title;
188
+		$title = (string)$title;
189 189
 
190 190
 		$site_url = ( ! preg_match('!^\w+://! i', $uri)) ? site_url($uri) : $uri;
191 191
 
@@ -204,7 +204,7 @@  discard block
 block discarded – undo
204 204
 			$attributes = array();
205 205
 		}
206 206
 
207
-		foreach (array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0', ) as $key => $val)
207
+		foreach (array('width' => '800', 'height' => '600', 'scrollbars' => 'yes', 'status' => 'yes', 'resizable' => 'yes', 'screenx' => '0', 'screeny' => '0',) as $key => $val)
208 208
 		{
209 209
 			$atts[$key] = ( ! isset($attributes[$key])) ? $val : $attributes[$key];
210 210
 			unset($attributes[$key]);
@@ -234,7 +234,7 @@  discard block
 block discarded – undo
234 234
 {
235 235
 	function mailto($email, $title = '', $attributes = '')
236 236
 	{
237
-		$title = (string) $title;
237
+		$title = (string)$title;
238 238
 
239 239
 		if ($title == "")
240 240
 		{
@@ -264,7 +264,7 @@  discard block
 block discarded – undo
264 264
 {
265 265
 	function safe_mailto($email, $title = '', $attributes = '')
266 266
 	{
267
-		$title = (string) $title;
267
+		$title = (string)$title;
268 268
 
269 269
 		if ($title == "")
270 270
 		{
@@ -289,7 +289,7 @@  discard block
 block discarded – undo
289 289
 			{
290 290
 				foreach ($attributes as $key => $val)
291 291
 				{
292
-					$x[] =  ' '.$key.'="';
292
+					$x[] = ' '.$key.'="';
293 293
 					for ($i = 0; $i < strlen($val); $i++)
294 294
 					{
295 295
 						$x[] = "|".ord(substr($val, $i, 1));
@@ -345,7 +345,7 @@  discard block
 block discarded – undo
345 345
 	var l=new Array();
346 346
 	<?php
347 347
 	$i = 0;
348
-	foreach ($x as $val){ ?>l[<?php echo $i++; ?>]='<?php echo $val; ?>';<?php } ?>
348
+	foreach ($x as $val) { ?>l[<?php echo $i++; ?>]='<?php echo $val; ?>';<?php } ?>
349 349
 
350 350
 	for (var i = l.length-1; i >= 0; i=i-1){
351 351
 	if (l[i].substring(0, 1) == '|') document.write("&#"+unescape(l[i].substring(1))+";");
@@ -539,7 +539,7 @@  discard block
 block discarded – undo
539 539
 			$uri = site_url($uri);
540 540
 		}
541 541
 
542
-		switch($method)
542
+		switch ($method)
543 543
 		{
544 544
 			case 'refresh'	: header("Refresh:0;url=".$uri);
545 545
 				break;
@@ -576,11 +576,11 @@  discard block
 block discarded – undo
576 576
 		{
577 577
 			if ($javascript == TRUE)
578 578
 			{
579
-				$att .= $key . '=' . $val . ',';
579
+				$att .= $key.'='.$val.',';
580 580
 			}
581 581
 			else
582 582
 			{
583
-				$att .= ' ' . $key . '="' . $val . '"';
583
+				$att .= ' '.$key.'="'.$val.'"';
584 584
 			}
585 585
 		}
586 586
 
Please login to merge, or discard this patch.
web_interface/astpp/system/helpers/date_helper.php 1 patch
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.
web_interface/astpp/system/helpers/smiley_helper.php 1 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.
web_interface/astpp/system/helpers/form_helper.php 1 patch
Spacing   +104 added lines, -104 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 {
43 43
 	function form_open($action = '', $attributes = '', $hidden = array())
44 44
 	{
45
-		$CI =& get_instance();
45
+		$CI = & get_instance();
46 46
 
47 47
 		if ($attributes == '')
48 48
 		{
@@ -78,11 +78,11 @@  discard block
 block discarded – undo
78 78
 		return $form;
79 79
 	}
80 80
 }
81
-if(!function_exists('form_breadcrumb')){
82
-    function form_breadcrumb($info=''){
83
-     $form=false;
84
-     if(!empty($info))
85
- 	$form.="<div class='breadcrumb'>
81
+if ( ! function_exists('form_breadcrumb')) {
82
+    function form_breadcrumb($info = '') {
83
+     $form = false;
84
+     if ( ! empty($info))
85
+ 	$form .= "<div class='breadcrumb'>
86 86
 	        <a href='".$info['url']."'>".$info['name']."</a>
87 87
 		</div>";
88 88
     return $form;
@@ -200,7 +200,7 @@  discard block
 block discarded – undo
200 200
 		//print_r($data);exit;
201 201
     	//$data["class"] = "col-md-5 form-control";
202 202
 		$defaults = array('type' => 'image', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
203
-		if($data['value'] != ''){
203
+		if ($data['value'] != '') {
204 204
 			return	'<div class="col-md-5 no-padding">
205 205
                    <div class="fileinput fileinput-new input-group" data-provides="fileinput">
206 206
 	                    <div class="form-control" data-trigger="fileinput">
@@ -212,7 +212,7 @@  discard block
 block discarded – undo
212 212
                    		</span>
213 213
                    </div>
214 214
                </div>';
215
-        }else{
215
+        } else {
216 216
         	return "<div class='col-md-5 no-padding'><image "._parse_form_attributes($data, $defaults).$extra." /></div>";
217 217
         }	
218 218
 		
@@ -226,7 +226,7 @@  discard block
 block discarded – undo
226 226
 	{
227 227
 	            //  echo '<pre>'; print_r($data); exit;
228 228
         	//$data["class"] = "col-md-5 form-control";
229
-        	$data['value']='Delete';
229
+        	$data['value'] = 'Delete';
230 230
 		$defaults = array('type' => 'button', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => 'Delete');
231 231
 
232 232
 		return "<div class='col-md-5 no-padding'><input "._parse_form_attributes($data, $defaults).$extra." /></div>";
@@ -378,21 +378,21 @@  discard block
 block discarded – undo
378 378
 
379 379
 		if ($extra != '') $extra = ' '.$extra;
380 380
 		$multiple = (count($selected) > 1 && strpos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : '';
381
-                if(is_array($name)){
382
-                     $str=null;
383
-                     foreach($name as $key=>$value){
384
-                      if($key !='class' && $key!='disabled')
385
-                      $str.=$key."='$value' ";
381
+                if (is_array($name)) {
382
+                     $str = null;
383
+                     foreach ($name as $key=>$value) {
384
+                      if ($key != 'class' && $key != 'disabled')
385
+                      $str .= $key."='$value' ";
386 386
                      }
387
-                     if(isset($name['disabled']) && $name['disabled']== 'disabled'){
388
-                      $str.='disabled = "disabled"';
387
+                     if (isset($name['disabled']) && $name['disabled'] == 'disabled') {
388
+                      $str .= 'disabled = "disabled"';
389 389
                      }
390 390
                                $form = '<select '.$str." class='col-md-5 form-control selectpicker ".$name['class'].$extra."' data-live-search='true'>\n";
391
-                }else{
392
-                    if(!empty($extra)){
393
-                        $form = '<select  name="'.$name.'"' .$multiple." class='col-md-5 form-control selectpicker ".$extra."' data-live-search='true'>\n";
394
-                    }else{
395
-                        $form = '<select  name="'.$name.'"' .$multiple." class='col-md-5 form-control selectpicker' data-live-search='true'>\n";
391
+                } else {
392
+                    if ( ! empty($extra)) {
393
+                        $form = '<select  name="'.$name.'"'.$multiple." class='col-md-5 form-control selectpicker ".$extra."' data-live-search='true'>\n";
394
+                    } else {
395
+                        $form = '<select  name="'.$name.'"'.$multiple." class='col-md-5 form-control selectpicker' data-live-search='true'>\n";
396 396
                     }
397 397
                 }
398 398
 //                if($extra != '' ){
@@ -401,7 +401,7 @@  discard block
 block discarded – undo
401 401
 //                 echo $form;exit;
402 402
 		foreach ($options as $key => $val)
403 403
 		{
404
-			$key = (string) $key;
404
+			$key = (string)$key;
405 405
 
406 406
 			if (is_array($val) && ! empty($val))
407 407
 			{
@@ -411,7 +411,7 @@  discard block
 block discarded – undo
411 411
 				{
412 412
 					$sel = (in_array($optgroup_key, $selected)) ? ' selected="selected"' : '';
413 413
 
414
-					$form .= '<option value="'.$optgroup_key.'"'.$sel.'>'.(string) $optgroup_val."</option>\n";
414
+					$form .= '<option value="'.$optgroup_key.'"'.$sel.'>'.(string)$optgroup_val."</option>\n";
415 415
 				}
416 416
 
417 417
 				$form .= '</optgroup>'."\n";
@@ -420,12 +420,12 @@  discard block
 block discarded – undo
420 420
 			{
421 421
 				$sel = (in_array($key, $selected)) ? ' selected="selected"' : '';
422 422
 
423
-				$form .= '<option value="'.$key.'"'.$sel.'>'.(string) $val."</option>\n";
423
+				$form .= '<option value="'.$key.'"'.$sel.'>'.(string)$val."</option>\n";
424 424
 			}
425 425
 		}
426
-                if(isset($name['option_value']) && isset($name['option_text'])){
427
-		  $sel= isset($name['value']) && $name['value']==$name['option_value']?'selected ="selected"':'';
428
-		  $form .= '<option value="'.$name['option_value'].'"'.$sel.'>'.(string) $name['option_text']."</option>\n";
426
+                if (isset($name['option_value']) && isset($name['option_text'])) {
427
+		  $sel = isset($name['value']) && $name['value'] == $name['option_value'] ? 'selected ="selected"' : '';
428
+		  $form .= '<option value="'.$name['option_value'].'"'.$sel.'>'.(string)$name['option_text']."</option>\n";
429 429
                 }
430 430
 		$form .= '</select>';
431 431
 //echo $form; exit;
@@ -451,21 +451,21 @@  discard block
 block discarded – undo
451 451
 			}
452 452
 		}
453 453
 		if ($extra != '') $extra = ' '.$extra;
454
-                $class= isset($name['class']) && !empty($name['class']) ? "col-md-5 form-control selectpicker $name[class]" :"col-md-5 form-control selectpicker";
454
+                $class = isset($name['class']) && ! empty($name['class']) ? "col-md-5 form-control selectpicker $name[class]" : "col-md-5 form-control selectpicker";
455 455
 		$multiple = (count($selected) > 1 && strpos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : '';
456
-		if(is_array($name) && !isset($name["id"])){
456
+		if (is_array($name) && ! isset($name["id"])) {
457 457
                     $form = '<select name="'.$name['name'].'"'." class='$class' data-live-search='true'>\n";
458
-                }else if(is_array($name) && isset($name["id"])){
458
+                } else if (is_array($name) && isset($name["id"])) {
459 459
                     $form = '<select name="'.$name['name'].'" id="'.$name['id'].'"'."class='$class' data-live-search='true'>\n";
460 460
                 }
461
-                else{
462
-                    $form = '<select name="'.$name.'"' .$multiple." class='$class' data-live-search='true'>\n";
461
+                else {
462
+                    $form = '<select name="'.$name.'"'.$multiple." class='$class' data-live-search='true'>\n";
463 463
                 }   
464 464
 
465 465
 		$form .= '<option value=""> --Select-- </option>';
466 466
 		foreach ($options as $key => $val)
467 467
 		{
468
-			$key = (string) $key;
468
+			$key = (string)$key;
469 469
 
470 470
 			if (is_array($val) && ! empty($val))
471 471
 			{
@@ -475,7 +475,7 @@  discard block
 block discarded – undo
475 475
 				{
476 476
 					$sel = (in_array($optgroup_key, $selected)) ? ' selected="selected"' : '';
477 477
 
478
-					$form .= '<option value="'.$optgroup_key.'"'.$sel.'>'.(string) $optgroup_val."</option>\n";
478
+					$form .= '<option value="'.$optgroup_key.'"'.$sel.'>'.(string)$optgroup_val."</option>\n";
479 479
 				}
480 480
 
481 481
 				$form .= '</optgroup>'."\n";
@@ -484,12 +484,12 @@  discard block
 block discarded – undo
484 484
 			{
485 485
 				$sel = (in_array($key, $selected)) ? ' selected="selected"' : '';
486 486
 
487
-				$form .= '<option value="'.$key.'"'.$sel.'>'.(string) $val."</option>\n";
487
+				$form .= '<option value="'.$key.'"'.$sel.'>'.(string)$val."</option>\n";
488 488
 			}
489 489
 		}
490
-                if(isset($name['option_value']) && isset($name['option_text'])){
491
-		  $sel= isset($name['value']) && $name['value']==$name['option_value']?'selected ="selected"':'';
492
-		  $form .= '<option value="'.$name['option_value'].'"'.$sel.'>'.(string) $name['option_text']."</option>\n";
490
+                if (isset($name['option_value']) && isset($name['option_text'])) {
491
+		  $sel = isset($name['value']) && $name['value'] == $name['option_value'] ? 'selected ="selected"' : '';
492
+		  $form .= '<option value="'.$name['option_value'].'"'.$sel.'>'.(string)$name['option_text']."</option>\n";
493 493
                 }
494 494
 		$form .= '</select>';
495 495
 
@@ -520,35 +520,35 @@  discard block
 block discarded – undo
520 520
 		/*
521 521
 		  ASTPP  3.0  For Search Display In
522 522
 		*/
523
-		if ($extra != '' && !is_array($extra)) $extra = ' '.$extra;
523
+		if ($extra != '' && ! is_array($extra)) $extra = ' '.$extra;
524 524
 	        /**********************************************************/
525 525
 
526
-	    $class= isset($name['class']) && !empty($name['class']) ? "col-md-5 form-control selectpicker $name[class]" :"col-md-5 form-control selectpicker";
526
+	    $class = isset($name['class']) && ! empty($name['class']) ? "col-md-5 form-control selectpicker $name[class]" : "col-md-5 form-control selectpicker";
527 527
 
528 528
 		$multiple = (count($selected) > 1 && strpos($extra, 'multiple') === FALSE) ? ' multiple="multiple"' : '';
529 529
                 /*
530 530
 		  ASTPP  3.0  For Search Display In
531 531
 		*/
532
-                if(empty($extra)){
532
+                if (empty($extra)) {
533 533
                 /*********************************/
534
-		if(is_array($name) && !isset($name["id"])){
534
+		if (is_array($name) && ! isset($name["id"])) {
535 535
                     $form = '<select name="'.$name['name'].'"'." class='col-md-5 form-control $class' style='margin-left:5px;' data-live-search='true'>\n";
536
-                }else if(is_array($name) && isset($name["id"])){
536
+                } else if (is_array($name) && isset($name["id"])) {
537 537
                     $form = '<select name="'.$name['name'].'" id="'.$name['id'].'"'."class='col-md-5 form-control $class' style='margin-left:5px;' data-live-search='true'>\n";
538
-                }else{
539
-                    $form = '<select name="'.$name.'"' .$multiple." class='col-md-5 form-control $class' style='margin-left:5px;' data-live-search='true'>\n";
538
+                } else {
539
+                    $form = '<select name="'.$name.'"'.$multiple." class='col-md-5 form-control $class' style='margin-left:5px;' data-live-search='true'>\n";
540 540
                 }   
541 541
  /*
542 542
 		  ASTPP  3.0  For Search Display In
543 543
 		*/
544
-                }else{
544
+                } else {
545 545
 
546 546
                     $form = '<select name="'.$name['name'].'" id="'.$name['id'].'"'."class='".$extra['class']." $class' style='".$extra['style']."' data-live-search='true'>\n";
547 547
                  }
548 548
 		//$form .= '<option value=""> --Select-- </option>';
549 549
 		foreach ($options as $key => $val)
550 550
 		{
551
-			$key = (string) $key;
551
+			$key = (string)$key;
552 552
 
553 553
 			if (is_array($val) && ! empty($val))
554 554
 			{
@@ -558,7 +558,7 @@  discard block
 block discarded – undo
558 558
 				{
559 559
 					$sel = (in_array($optgroup_key, $selected)) ? ' selected="selected"' : '';
560 560
 
561
-					$form .= '<option value="'.$optgroup_key.'"'.$sel.'>'.(string) $optgroup_val."</option>\n";
561
+					$form .= '<option value="'.$optgroup_key.'"'.$sel.'>'.(string)$optgroup_val."</option>\n";
562 562
 				}
563 563
 
564 564
 				$form .= '</optgroup>'."\n";
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
 			{
568 568
 				$sel = (in_array($key, $selected)) ? ' selected="selected"' : '';
569 569
 
570
-				$form .= '<option value="'.$key.'"'.$sel.'>'.(string) $val."</option>\n";
570
+				$form .= '<option value="'.$key.'"'.$sel.'>'.(string)$val."</option>\n";
571 571
 			}
572 572
 		}
573 573
 
@@ -604,7 +604,7 @@  discard block
 block discarded – undo
604 604
                 
605 605
 		foreach ($options as $key => $val)
606 606
 		{
607
-			$key = (string) $key;
607
+			$key = (string)$key;
608 608
 
609 609
 			if (is_array($val) && ! empty($val))
610 610
 			{
@@ -614,7 +614,7 @@  discard block
 block discarded – undo
614 614
 				{
615 615
 					$sel = (in_array($optgroup_key, $selected)) ? ' selected="selected"' : '';
616 616
 
617
-					$form .= '<option value="'.$optgroup_key.'"'.$sel.'>'.(string) $optgroup_val."</option>\n";
617
+					$form .= '<option value="'.$optgroup_key.'"'.$sel.'>'.(string)$optgroup_val."</option>\n";
618 618
 				}
619 619
 
620 620
 				$form .= '</optgroup>'."\n";
@@ -623,7 +623,7 @@  discard block
 block discarded – undo
623 623
 			{
624 624
 				$sel = (in_array($key, $selected)) ? ' selected="selected"' : '';
625 625
 
626
-				$form .= '<option value="'.$key.'"'.$sel.'>'.(string) $val."</option>\n";
626
+				$form .= '<option value="'.$key.'"'.$sel.'>'.(string)$val."</option>\n";
627 627
 			}
628 628
 		}
629 629
 
@@ -655,10 +655,10 @@  discard block
 block discarded – undo
655 655
 	function form_checkbox($data = '', $value = '', $checked = FALSE, $extra = '')
656 656
 	{
657 657
 		
658
-		if(isset($data) && $data != ''){
658
+		if (isset($data) && $data != '') {
659 659
 			$name = "'".$data."'";
660
-		}else{
661
-			$name='';
660
+		} else {
661
+			$name = '';
662 662
 		}
663 663
 		
664 664
 		/*if(isset($value) && $value != ''){
@@ -667,7 +667,7 @@  discard block
 block discarded – undo
667 667
 			$value='0';
668 668
 		}*/
669 669
 		
670
-		$defaults = array('class'=>'onoffswitch-checkbox' ,'type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
670
+		$defaults = array('class'=>'onoffswitch-checkbox', 'type' => 'checkbox', 'name' => (( ! is_array($data)) ? $data : ''), 'value' => $value);
671 671
 		
672 672
 		if (is_array($data) AND array_key_exists('checked', $data))
673 673
 		{
@@ -690,13 +690,13 @@  discard block
 block discarded – undo
690 690
 		{
691 691
 			unset($defaults['checked']);
692 692
 		}
693
-		$class=NULL;
693
+		$class = NULL;
694 694
 
695 695
 //echo "<pre>".$value; print_r($extra); exit;
696
-	    if(isset($extra[$value]) && !empty($extra) && $extra[$value] == '0'){
697
-		$class='onoffswitch-inner';
698
-	    }else{
699
-		$class='onoffswitch-inner';
696
+	    if (isset($extra[$value]) && ! empty($extra) && $extra[$value] == '0') {
697
+		$class = 'onoffswitch-inner';
698
+	    } else {
699
+		$class = 'onoffswitch-inner';
700 700
  	    }
701 701
 /*            if(isset($extra) && $extra != ''){
702 702
 	      if(isset($extra[0])){
@@ -718,11 +718,11 @@  discard block
 block discarded – undo
718 718
             }*/
719 719
 //            }
720 720
 		//return "<input "._parse_form_attributes($data, $defaults).$extra." />";
721
-		if($class == "onoffswitch-inner_true"){
721
+		if ($class == "onoffswitch-inner_true") {
722 722
 				return '<div style="width: 49%; text-align: -moz-center; padding: 0;">
723 723
 				<input '._parse_form_attributes($data, $defaults).' type="checkbox" id="switch'.$name.'" name="onoffswitch" class="onoffswitch-checkbox" content="Yes">
724 724
 				<label class="onoffswitch-label" for="switch'.$name.'"><span class="'.$class.'"></span></label></div>';	
725
-		}else{
725
+		} else {
726 726
 				return '<div style="width: 41%; text-align: -moz-center; padding: 0;">
727 727
 				<input  type="checkbox" id="switch'.$name.'" name="onoffswitch"  class="onoffswitch-checkbox" content="Yes">
728 728
 				<label class="onoffswitch-label" for="switch'.$name.'"><span class="'.$class.'"></span></label></div>';
@@ -816,7 +816,7 @@  discard block
 block discarded – undo
816 816
 	{
817 817
 		$defaults = array('name' => (( ! is_array($data)) ? $data : ''), 'type' => 'button');
818 818
 
819
-		if ( is_array($data) AND isset($data['content']))
819
+		if (is_array($data) AND isset($data['content']))
820 820
 		{
821 821
 			$content = $data['content'];
822 822
 			unset($data['content']); // content is not an attribute
@@ -1002,7 +1002,7 @@  discard block
 block discarded – undo
1002 1002
 {
1003 1003
 	function set_value($field = '', $default = '')
1004 1004
 	{
1005
-		if (FALSE === ($OBJ =& _get_validation_object()))
1005
+		if (FALSE === ($OBJ = & _get_validation_object()))
1006 1006
 		{
1007 1007
 			if ( ! isset($_POST[$field]))
1008 1008
 			{
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
 {
1035 1035
 	function set_select($field = '', $value = '', $default = FALSE)
1036 1036
 	{
1037
-		$OBJ =& _get_validation_object();
1037
+		$OBJ = & _get_validation_object();
1038 1038
 
1039 1039
 		if ($OBJ === FALSE)
1040 1040
 		{
@@ -1089,7 +1089,7 @@  discard block
 block discarded – undo
1089 1089
 {
1090 1090
 	function set_checkbox($field = '', $value = '', $default = FALSE)
1091 1091
 	{
1092
-		$OBJ =& _get_validation_object();
1092
+		$OBJ = & _get_validation_object();
1093 1093
 
1094 1094
 		if ($OBJ === FALSE)
1095 1095
 		{
@@ -1144,7 +1144,7 @@  discard block
 block discarded – undo
1144 1144
 {
1145 1145
 	function set_radio($field = '', $value = '', $default = FALSE)
1146 1146
 	{
1147
-		$OBJ =& _get_validation_object();
1147
+		$OBJ = & _get_validation_object();
1148 1148
 
1149 1149
 		if ($OBJ === FALSE)
1150 1150
 		{
@@ -1199,7 +1199,7 @@  discard block
 block discarded – undo
1199 1199
 {
1200 1200
 	function form_error($field = '', $prefix = '', $suffix = '')
1201 1201
 	{
1202
-		if (FALSE === ($OBJ =& _get_validation_object()))
1202
+		if (FALSE === ($OBJ = & _get_validation_object()))
1203 1203
 		{
1204 1204
 			return '';
1205 1205
 		}
@@ -1225,7 +1225,7 @@  discard block
 block discarded – undo
1225 1225
 {
1226 1226
 	function validation_errors($prefix = '', $suffix = '')
1227 1227
 	{
1228
-		if (FALSE === ($OBJ =& _get_validation_object()))
1228
+		if (FALSE === ($OBJ = & _get_validation_object()))
1229 1229
 		{
1230 1230
 			return '';
1231 1231
 		}
@@ -1276,7 +1276,7 @@  discard block
 block discarded – undo
1276 1276
 				$val = form_prep($val, $default['name']);
1277 1277
 			}
1278 1278
 
1279
-			$att .= $key . '="' . $val . '" ';
1279
+			$att .= $key.'="'.$val.'" ';
1280 1280
 		}
1281 1281
 
1282 1282
 		return $att;
@@ -1358,7 +1358,7 @@  discard block
 block discarded – undo
1358 1358
 {
1359 1359
 	function &_get_validation_object()
1360 1360
 	{
1361
-		$CI =& get_instance();
1361
+		$CI = & get_instance();
1362 1362
 
1363 1363
 		// We set this as a variable since we're returning by reference.
1364 1364
 		$return = FALSE;
@@ -1388,29 +1388,29 @@  discard block
 block discarded – undo
1388 1388
  * @return	string
1389 1389
  */
1390 1390
 
1391
-if( !function_exists( 'form_countries' ) )
1391
+if ( ! function_exists('form_countries'))
1392 1392
 {
1393
-	function form_countries( $name, $selected = FALSE, $attributes, $form_name="" )
1393
+	function form_countries($name, $selected = FALSE, $attributes, $form_name = "")
1394 1394
 	{
1395 1395
 		$country_list = Common_model::$global_config['country_list'];
1396 1396
 		$form = '<select name="'.$name.'"';
1397 1397
 
1398
-		foreach( $attributes as $key => $value )
1398
+		foreach ($attributes as $key => $value)
1399 1399
 		{
1400 1400
 			$form .= " ".$key.'="'.$value.'"';
1401 1401
 		}
1402 1402
 
1403 1403
 		$form .= ">";
1404 1404
 		
1405
-		if($form_name!=""){
1405
+		if ($form_name != "") {
1406 1406
 			$form .= "\n".'<option value="" selected="selected" >'.$form_name.'</option>';
1407 1407
 		}
1408 1408
 
1409
-		foreach( $country_list as $key => $value )
1409
+		foreach ($country_list as $key => $value)
1410 1410
 		{
1411
-			$form .= "\n".'<option value="'.ucwords( strtolower( $value ) ).'"';
1411
+			$form .= "\n".'<option value="'.ucwords(strtolower($value)).'"';
1412 1412
 
1413
-			if(strtolower(trim($value)) == strtolower(trim($selected)))
1413
+			if (strtolower(trim($value)) == strtolower(trim($selected)))
1414 1414
 			{
1415 1415
                             
1416 1416
                             $form .= ' selected="selected" >';
@@ -1421,7 +1421,7 @@  discard block
 block discarded – undo
1421 1421
 				$form .= '>';
1422 1422
 			}
1423 1423
 			
1424
-			$form .= ucwords( strtolower( $value ) ).'</option>';
1424
+			$form .= ucwords(strtolower($value)).'</option>';
1425 1425
 		}
1426 1426
 
1427 1427
 		$form .= "\n</select>";
@@ -1430,26 +1430,26 @@  discard block
 block discarded – undo
1430 1430
 	}
1431 1431
 }
1432 1432
 //=========================================
1433
-if( !function_exists( 'form_languagelist' ) )
1433
+if ( ! function_exists('form_languagelist'))
1434 1434
 {
1435
-	function form_languagelist( $name, $selected = FALSE, $attributes )
1435
+	function form_languagelist($name, $selected = FALSE, $attributes)
1436 1436
 	{
1437 1437
 		$language_list = Common_model::$global_config['language_list'];
1438 1438
 
1439 1439
 		$form = '<select name="'.$name.'"';
1440 1440
 
1441
-		foreach( $attributes as $key => $value )
1441
+		foreach ($attributes as $key => $value)
1442 1442
 		{
1443 1443
 			$form .= " ".$key.'="'.$value.'"';
1444 1444
 		}
1445 1445
 
1446 1446
 		$form .= ">";
1447 1447
 
1448
-		foreach( $language_list as $key => $value )
1448
+		foreach ($language_list as $key => $value)
1449 1449
 		{
1450
-			$form .= "\n".'<option value="'.( strtolower( $key ) ).'"';
1450
+			$form .= "\n".'<option value="'.(strtolower($key)).'"';
1451 1451
 
1452
-			if( $key == $selected )
1452
+			if ($key == $selected)
1453 1453
 			{
1454 1454
 				$form .= ' selected>';
1455 1455
 			}
@@ -1458,7 +1458,7 @@  discard block
 block discarded – undo
1458 1458
 				$form .= '>';
1459 1459
 			}
1460 1460
 
1461
-			$form .=  ucfirst(strtolower($value)).'</option>';
1461
+			$form .= ucfirst(strtolower($value)).'</option>';
1462 1462
 		}
1463 1463
 
1464 1464
 		$form .= "\n</select>";
@@ -1468,28 +1468,28 @@  discard block
 block discarded – undo
1468 1468
 }
1469 1469
 
1470 1470
 //-----------------------------------------
1471
-if( !function_exists( 'form_select_default' ) )
1471
+if ( ! function_exists('form_select_default'))
1472 1472
 {
1473
-	function form_select_default( $name,$data, $selected = "", $attributes, $form_name="" )
1473
+	function form_select_default($name, $data, $selected = "", $attributes, $form_name = "")
1474 1474
 	{
1475 1475
 		$form = '<select name="'.$name.'"';
1476 1476
 
1477
-		foreach( $attributes as $key => $value )
1477
+		foreach ($attributes as $key => $value)
1478 1478
 		{
1479 1479
 			$form .= " ".$key.'="'.$value.'"';
1480 1480
 		}
1481 1481
 
1482 1482
 		$form .= ">";
1483 1483
 		
1484
-		if($form_name!=""){
1484
+		if ($form_name != "") {
1485 1485
 			$form .= "\n".'<option value="" selected="selected" >'.$form_name.'</option>';
1486 1486
 		}
1487 1487
 		
1488
-		foreach( $data as $key => $value )
1488
+		foreach ($data as $key => $value)
1489 1489
 		{
1490 1490
 			$form .= "\n".'<option value="'.$key.'"';
1491 1491
 			
1492
-			if( $key == $selected )
1492
+			if ($key == $selected)
1493 1493
 			{
1494 1494
 				$form .= ' selected>';
1495 1495
 			}
@@ -1498,7 +1498,7 @@  discard block
 block discarded – undo
1498 1498
 				$form .= '>';
1499 1499
 			}
1500 1500
 
1501
-			$form .= ucwords( strtolower( $value ) ).'</option>';
1501
+			$form .= ucwords(strtolower($value)).'</option>';
1502 1502
 		}
1503 1503
 
1504 1504
 		$form .= "\n</select>";
@@ -1508,30 +1508,30 @@  discard block
 block discarded – undo
1508 1508
 	}
1509 1509
 }	
1510 1510
 // ------------------------------------------------------------------------
1511
-if( !function_exists( 'form_timezone' ) )
1511
+if ( ! function_exists('form_timezone'))
1512 1512
 {
1513
-	function form_timezone( $name, $selected = FALSE, $attributes )
1513
+	function form_timezone($name, $selected = FALSE, $attributes)
1514 1514
 	{
1515
-		$CI =& get_instance();
1515
+		$CI = & get_instance();
1516 1516
 
1517
-		$CI->config->load( 'countries' );
1517
+		$CI->config->load('countries');
1518 1518
 
1519
-		$country_list = $CI->config->item( 'timezone1_list' );
1519
+		$country_list = $CI->config->item('timezone1_list');
1520 1520
 
1521 1521
 		$form = '<select name="'.$name.'"';
1522 1522
 
1523
-		foreach( $attributes as $key => $value )
1523
+		foreach ($attributes as $key => $value)
1524 1524
 		{
1525 1525
 			$form .= " ".$key.'="'.$value.'"';
1526 1526
 		}
1527 1527
 
1528 1528
 		$form .= ">";
1529 1529
 
1530
-		foreach( $country_list as $key => $value )
1530
+		foreach ($country_list as $key => $value)
1531 1531
 		{
1532
-			$form .= "\n".'<option value="'.ucwords( strtolower( $value ) ).'"';
1532
+			$form .= "\n".'<option value="'.ucwords(strtolower($value)).'"';
1533 1533
 
1534
-			if( strtolower($value) == strtolower($selected) )
1534
+			if (strtolower($value) == strtolower($selected))
1535 1535
 			{
1536 1536
 				$form .= '  selected="selected">';
1537 1537
 			}
@@ -1540,7 +1540,7 @@  discard block
 block discarded – undo
1540 1540
 				$form .= '>';
1541 1541
 			}
1542 1542
 
1543
-			$form .= ucwords( strtolower( $value ) ).'</option>';
1543
+			$form .= ucwords(strtolower($value)).'</option>';
1544 1544
 		}
1545 1545
 
1546 1546
 		$form .= "\n</select>";
Please login to merge, or discard this patch.
web_interface/astpp/system/helpers/cookie_helper.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@  discard block
 block discarded – undo
47 47
 	function set_cookie($name = '', $value = '', $expire = '', $domain = '', $path = '/', $prefix = '', $secure = FALSE)
48 48
 	{
49 49
 		// Set the config file options
50
-		$CI =& get_instance();
50
+		$CI = & get_instance();
51 51
 		$CI->input->set_cookie($name, $value, $expire, $domain, $path, $prefix, $secure);
52 52
 	}
53 53
 }
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 {
67 67
 	function get_cookie($index = '', $xss_clean = FALSE)
68 68
 	{
69
-		$CI =& get_instance();
69
+		$CI = & get_instance();
70 70
 
71 71
 		$prefix = '';
72 72
 
Please login to merge, or discard this patch.
web_interface/astpp/system/helpers/inflector_helper.php 1 patch
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -105,24 +105,24 @@
 block discarded – undo
105 105
 		$result = strval($str);
106 106
 	
107 107
 		$plural_rules = array(
108
-			'/^(ox)$/'                 => '\1\2en',     // ox
109
-			'/([m|l])ouse$/'           => '\1ice',      // mouse, louse
110
-			'/(matr|vert|ind)ix|ex$/'  => '\1ices',     // matrix, vertex, index
111
-			'/(x|ch|ss|sh)$/'          => '\1es',       // search, switch, fix, box, process, address
112
-			'/([^aeiouy]|qu)y$/'       => '\1ies',      // query, ability, agency
113
-			'/(hive)$/'                => '\1s',        // archive, hive
114
-			'/(?:([^f])fe|([lr])f)$/'  => '\1\2ves',    // half, safe, wife
115
-			'/sis$/'                   => 'ses',        // basis, diagnosis
116
-			'/([ti])um$/'              => '\1a',        // datum, medium
117
-			'/(p)erson$/'              => '\1eople',    // person, salesperson
118
-			'/(m)an$/'                 => '\1en',       // man, woman, spokesman
119
-			'/(c)hild$/'               => '\1hildren',  // child
120
-			'/(buffal|tomat)o$/'       => '\1\2oes',    // buffalo, tomato
121
-			'/(bu|campu)s$/'           => '\1\2ses',    // bus, campus
122
-			'/(alias|status|virus)/'   => '\1es',       // alias
123
-			'/(octop)us$/'             => '\1i',        // octopus
124
-			'/(ax|cris|test)is$/'      => '\1es',       // axis, crisis
125
-			'/s$/'                     => 's',          // no change (compatibility)
108
+			'/^(ox)$/'                 => '\1\2en', // ox
109
+			'/([m|l])ouse$/'           => '\1ice', // mouse, louse
110
+			'/(matr|vert|ind)ix|ex$/'  => '\1ices', // matrix, vertex, index
111
+			'/(x|ch|ss|sh)$/'          => '\1es', // search, switch, fix, box, process, address
112
+			'/([^aeiouy]|qu)y$/'       => '\1ies', // query, ability, agency
113
+			'/(hive)$/'                => '\1s', // archive, hive
114
+			'/(?:([^f])fe|([lr])f)$/'  => '\1\2ves', // half, safe, wife
115
+			'/sis$/'                   => 'ses', // basis, diagnosis
116
+			'/([ti])um$/'              => '\1a', // datum, medium
117
+			'/(p)erson$/'              => '\1eople', // person, salesperson
118
+			'/(m)an$/'                 => '\1en', // man, woman, spokesman
119
+			'/(c)hild$/'               => '\1hildren', // child
120
+			'/(buffal|tomat)o$/'       => '\1\2oes', // buffalo, tomato
121
+			'/(bu|campu)s$/'           => '\1\2ses', // bus, campus
122
+			'/(alias|status|virus)/'   => '\1es', // alias
123
+			'/(octop)us$/'             => '\1i', // octopus
124
+			'/(ax|cris|test)is$/'      => '\1es', // axis, crisis
125
+			'/s$/'                     => 's', // no change (compatibility)
126 126
 			'/$/'                      => 's',
127 127
 		);
128 128
 
Please login to merge, or discard this patch.
web_interface/astpp/system/helpers/string_helper.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -115,7 +115,7 @@  discard block
 block discarded – undo
115 115
 {
116 116
 	function quotes_to_entities($str)
117 117
 	{
118
-		return str_replace(array("\'","\"","'",'"'), array("&#39;","&quot;","&#39;","&quot;"), $str);
118
+		return str_replace(array("\'", "\"", "'", '"'), array("&#39;", "&quot;", "&#39;", "&quot;"), $str);
119 119
 	}
120 120
 }
121 121
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
 {
196 196
 	function random_string($type = 'alnum', $len = 8)
197 197
 	{
198
-		switch($type)
198
+		switch ($type)
199 199
 		{
200 200
 			case 'basic'	: return mt_rand();
201 201
 				break;
@@ -217,9 +217,9 @@  discard block
 block discarded – undo
217 217
 					}
218 218
 
219 219
 					$str = '';
220
-					for ($i=0; $i < $len; $i++)
220
+					for ($i = 0; $i < $len; $i++)
221 221
 					{
222
-						$str .= substr($pool, mt_rand(0, strlen($pool) -1), 1);
222
+						$str .= substr($pool, mt_rand(0, strlen($pool) - 1), 1);
223 223
 					}
224 224
 					return $str;
225 225
 				break;
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
 			case 'encrypt'	:
232 232
 			case 'sha1'	:
233 233
 
234
-						$CI =& get_instance();
234
+						$CI = & get_instance();
235 235
 						$CI->load->helper('security');
236 236
 
237 237
 						return do_hash(uniqid(mt_rand(), TRUE), 'sha1');
Please login to merge, or discard this patch.