Passed
Branch develop (d6f62e)
by Tito
06:29
created
extensions/libraries/redcore/controller/admin.php 1 patch
Braces   +1 added lines, -3 removed lines patch added patch discarded remove patch
@@ -34,9 +34,7 @@
 block discarded – undo
34 34
 		{
35 35
 		}
36 36
 	}
37
-}
38
-
39
-else
37
+} else
40 38
 {
41 39
 	/**
42 40
 	 * redCORE Controller Admin
Please login to merge, or discard this patch.
extensions/libraries/redcore/controller/admin/base.php 1 patch
Braces   +9 added lines, -20 removed lines patch added patch discarded remove patch
@@ -97,8 +97,7 @@  discard block
 block discarded – undo
97 97
 		if (!is_array($cid) || count($cid) < 1)
98 98
 		{
99 99
 			JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror');
100
-		}
101
-		else
100
+		} else
102 101
 		{
103 102
 			// Get the model.
104 103
 			$model = $this->getModel();
@@ -111,8 +110,7 @@  discard block
 block discarded – undo
111 110
 			if ($model->delete($cid))
112 111
 			{
113 112
 				$this->setMessage(JText::plural($this->text_prefix . '_N_ITEMS_DELETED', count($cid)));
114
-			}
115
-			else
113
+			} else
116 114
 			{
117 115
 				$this->setMessage($model->getError(), 'error');
118 116
 			}
@@ -142,8 +140,7 @@  discard block
 block discarded – undo
142 140
 		if (empty($cid))
143 141
 		{
144 142
 			JLog::add(JText::_($this->text_prefix . '_NO_ITEM_SELECTED'), JLog::WARNING, 'jerror');
145
-		}
146
-		else
143
+		} else
147 144
 		{
148 145
 			// Get the model.
149 146
 			$model = $this->getModel();
@@ -180,13 +177,11 @@  discard block
 block discarded – undo
180 177
 					}
181 178
 
182 179
 					$this->setMessage(JText::plural($ntext, count($cid)));
183
-				}
184
-				else
180
+				} else
185 181
 				{
186 182
 					$this->setMessage($model->getError(), 'error');
187 183
 				}
188
-			}
189
-			catch (Exception $e)
184
+			} catch (Exception $e)
190 185
 			{
191 186
 				$this->setMessage(JText::_('JLIB_DATABASE_ERROR_ANCESTOR_NODES_LOWER_STATE'), 'error');
192 187
 			}
@@ -224,9 +219,7 @@  discard block
 block discarded – undo
224 219
 			$this->setRedirect($this->getRedirectToListRoute(), $message, 'error');
225 220
 
226 221
 			return false;
227
-		}
228
-
229
-		else
222
+		} else
230 223
 		{
231 224
 			// Reorder succeeded.
232 225
 			$message = JText::_('JLIB_APPLICATION_SUCCESS_ITEM_REORDERED');
@@ -271,9 +264,7 @@  discard block
 block discarded – undo
271 264
 			$this->setRedirect($this->getRedirectToListRoute(), $message, 'error');
272 265
 
273 266
 			return false;
274
-		}
275
-
276
-		else
267
+		} else
277 268
 		{
278 269
 			// Reorder succeeded.
279 270
 			$this->setMessage(JText::_('JLIB_APPLICATION_SUCCESS_ORDERING_SAVED'));
@@ -301,8 +292,7 @@  discard block
 block discarded – undo
301 292
 			$returnUrl = base64_decode($returnUrl);
302 293
 
303 294
 			return JRoute::_($returnUrl . $append, false);
304
-		}
305
-		else
295
+		} else
306 296
 		{
307 297
 			return JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $append, false);
308 298
 		}
@@ -331,8 +321,7 @@  discard block
 block discarded – undo
331 321
 			$this->setRedirect($this->getRedirectToListRoute(), $message, 'error');
332 322
 
333 323
 			return false;
334
-		}
335
-		else
324
+		} else
336 325
 		{
337 326
 			// Checkin succeeded.
338 327
 			$message = JText::plural($this->text_prefix . '_N_ITEMS_CHECKED_IN', count($ids));
Please login to merge, or discard this patch.
extensions/libraries/redcore/controller/form.php 1 patch
Braces   +11 added lines, -23 removed lines patch added patch discarded remove patch
@@ -74,8 +74,7 @@  discard block
 block discarded – undo
74 74
 			if (array_key_exists('name', $config))
75 75
 			{
76 76
 				$this->name = $config['name'];
77
-			}
78
-			else
77
+			} else
79 78
 			{
80 79
 				$this->name = $this->getName();
81 80
 			}
@@ -85,8 +84,7 @@  discard block
 block discarded – undo
85 84
 		if (array_key_exists('base_path', $config))
86 85
 		{
87 86
 			$this->basePath = $config['base_path'];
88
-		}
89
-		else
87
+		} else
90 88
 		{
91 89
 			$this->basePath = JPATH_COMPONENT;
92 90
 		}
@@ -95,8 +93,7 @@  discard block
 block discarded – undo
95 93
 		if (array_key_exists('default_task', $config))
96 94
 		{
97 95
 			$this->registerDefaultTask($config['default_task']);
98
-		}
99
-		else
96
+		} else
100 97
 		{
101 98
 			$this->registerDefaultTask('display');
102 99
 		}
@@ -108,8 +105,7 @@  discard block
 block discarded – undo
108 105
 			{
109 106
 				// User-defined prefix
110 107
 				$this->model_prefix = $config['model_prefix'];
111
-			}
112
-			else
108
+			} else
113 109
 			{
114 110
 				$this->model_prefix = ucfirst($this->name) . 'Model';
115 111
 			}
@@ -120,8 +116,7 @@  discard block
 block discarded – undo
120 116
 		{
121 117
 			// User-defined dirs
122 118
 			$this->addModelPath($config['model_path'], $this->model_prefix);
123
-		}
124
-		else
119
+		} else
125 120
 		{
126 121
 			$this->addModelPath($this->basePath . '/models', $this->model_prefix);
127 122
 		}
@@ -131,8 +126,7 @@  discard block
 block discarded – undo
131 126
 		{
132 127
 			// User-defined dirs
133 128
 			$this->setPath('view', $config['view_path']);
134
-		}
135
-		else
129
+		} else
136 130
 		{
137 131
 			$this->setPath('view', $this->basePath . '/views');
138 132
 		}
@@ -141,8 +135,7 @@  discard block
 block discarded – undo
141 135
 		if (array_key_exists('default_view', $config))
142 136
 		{
143 137
 			$this->default_view = $config['default_view'];
144
-		}
145
-		elseif (empty($this->default_view))
138
+		} elseif (empty($this->default_view))
146 139
 		{
147 140
 			$this->default_view = $this->getName();
148 141
 		}
@@ -264,9 +257,7 @@  discard block
 block discarded – undo
264 257
 				if ($message instanceof Exception)
265 258
 				{
266 259
 					$jsonArray[$key] = $message->getMessage();
267
-				}
268
-
269
-				else
260
+				} else
270 261
 				{
271 262
 					$jsonArray[$key] = $message;
272 263
 				}
@@ -412,8 +403,7 @@  discard block
 block discarded – undo
412 403
 			);
413 404
 
414 405
 			return false;
415
-		}
416
-		else
406
+		} else
417 407
 		{
418 408
 			// Check-out succeeded, push the new record id into the session.
419 409
 			$this->holdEditId($context, $recordId);
@@ -581,8 +571,7 @@  discard block
 block discarded – undo
581 571
 				if ($errors[$i] instanceof Exception)
582 572
 				{
583 573
 					$app->enqueueMessage($errors[$i]->getMessage(), 'warning');
584
-				}
585
-				else
574
+				} else
586 575
 				{
587 576
 					$app->enqueueMessage($errors[$i], 'warning');
588 577
 				}
@@ -756,8 +745,7 @@  discard block
 block discarded – undo
756 745
 			$returnUrl = base64_decode($returnUrl);
757 746
 
758 747
 			return JRoute::_($returnUrl . $append, false);
759
-		}
760
-		else
748
+		} else
761 749
 		{
762 750
 			return JRoute::_('index.php?option=' . $this->option . '&view=' . $this->view_list . $append, false);
763 751
 		}
Please login to merge, or discard this patch.
extensions/libraries/redcore/html/rbootstrap.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -55,8 +55,7 @@  discard block
 block discarded – undo
55 55
 			}
56 56
 
57 57
 			RHtmlMedia::loadFrameworkJs();
58
-		}
59
-		elseif (!$isAdmin && !RBootstrap::$loadFrontendCSS && !version_compare(JVERSION, '3.0', '<'))
58
+		} elseif (!$isAdmin && !RBootstrap::$loadFrontendCSS && !version_compare(JVERSION, '3.0', '<'))
60 59
 		{
61 60
 			JHtml::_('bootstrap.framework');
62 61
 		}
@@ -346,8 +345,7 @@  discard block
 block discarded – undo
346 345
 		if (RHtmlMedia::getFramework() == 'bootstrap3')
347 346
 		{
348 347
 			return RLayoutHelper::render('modal.dialog', $layoutData);
349
-		}
350
-		else
348
+		} else
351 349
 		{
352 350
 			return JLayoutHelper::render('joomla.modal.main', $layoutData);
353 351
 		}
Please login to merge, or discard this patch.
extensions/libraries/redcore/html/rgrid.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -94,7 +94,7 @@
 block discarded – undo
94 94
 	 * @return  string         The Html code
95 95
 	 */
96 96
 	public static function action($i, $task, $prefix = '', $text = '', $active_title = '', $inactive_title = '',
97
-		$tip = false, $active_class = '',$inactive_class = '',
97
+		$tip = false, $active_class = '', $inactive_class = '',
98 98
 		$enabled = true, $translate = true, $checkbox = 'cb', $formId = 'adminForm', $buttonClass = ''
99 99
 	)
100 100
 	{
Please login to merge, or discard this patch.
Braces   +5 added lines, -11 removed lines patch added patch discarded remove patch
@@ -125,9 +125,7 @@  discard block
 block discarded – undo
125 125
 			if ($active_class === 'plus')
126 126
 			{
127 127
 				$buttonClass = 'published';
128
-			}
129
-
130
-			elseif ($active_class === 'minus')
128
+			} elseif ($active_class === 'minus')
131 129
 			{
132 130
 				$buttonClass = 'unpublished';
133 131
 			}
@@ -141,8 +139,7 @@  discard block
 block discarded – undo
141 139
 			$html[] = '<i class="icon-' . $active_class . '">';
142 140
 			$html[] = '</i>';
143 141
 			$html[] = '</a>';
144
-		}
145
-		else
142
+		} else
146 143
 		{
147 144
 			$html[] = '<a class="btn btn-micro disabled jgrid ' . $buttonClass . ' ' . ($tip ? 'hasTooltip' : '') . '" ';
148 145
 			$html[] = ' title="' . addslashes(htmlspecialchars($translate ? JText::_($inactive_title) : $inactive_title, ENT_COMPAT, 'UTF-8')) . '">';
@@ -150,8 +147,7 @@  discard block
 block discarded – undo
150 147
 			if ($active_class == "protected")
151 148
 			{
152 149
 				$html[] = '<i class="icon-lock"></i>';
153
-			}
154
-			else
150
+			} else
155 151
 			{
156 152
 				$html[] = '<i class="icon-' . $inactive_class . '"></i>';
157 153
 			}
@@ -459,8 +455,7 @@  discard block
 block discarded – undo
459 455
 		if ($order != $selected)
460 456
 		{
461 457
 			$direction = $new_direction;
462
-		}
463
-		else
458
+		} else
464 459
 		{
465 460
 			$direction = ($direction == 'desc') ? 'asc' : 'desc';
466 461
 		}
@@ -509,8 +504,7 @@  discard block
 block discarded – undo
509 504
 		if ($order != $selected)
510 505
 		{
511 506
 			$direction = $new_direction;
512
-		}
513
-		else
507
+		} else
514 508
 		{
515 509
 			$direction = ($direction == 'desc') ? 'asc' : 'desc';
516 510
 		}
Please login to merge, or discard this patch.
extensions/libraries/redcore/html/raccess.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -79,8 +79,7 @@
 block discarded – undo
79 79
 					$html[] = '<input type="hidden" name="' . $name . '[]" value="' . $item->id . '" id="' . $eid . '" />';
80 80
 					$html[] = '<button type="button" class="btn btn-small btn-danger" onclick="JRemoveUsergroup(\''
81 81
 						. $eid . '\', \'' . $item->id . '\')">' . JText::_('JREMOVE') . '</button>';
82
-				}
83
-				else
82
+				} else
84 83
 				{
85 84
 					$html[] = '<button type="button" class="btn btn-small btn-success" onclick="JAddUsergroup(\''
86 85
 						. $eid . '\', \'' . $item->id . '\')">' . JText::_('JADD') . '</button>';
Please login to merge, or discard this patch.
extensions/libraries/redcore/html/html.php 2 patches
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -344,7 +344,7 @@
 block discarded – undo
344 344
 
345 345
 				// Try to include files named filename.ext, filename_browser.ext, filename_browser_major.ext, filename_browser_major_minor.ext
346 346
 				// where major and minor are the browser version names
347
-				$potential = array($strip, $strip . '_' . $browser,  $strip . '_' . $browser . '_' . $major,
347
+				$potential = array($strip, $strip . '_' . $browser, $strip . '_' . $browser . '_' . $major,
348 348
 					$strip . '_' . $browser . '_' . $major . '_' . $minor);
349 349
 			}
350 350
 			else
Please login to merge, or discard this patch.
Braces   +22 added lines, -44 removed lines patch added patch discarded remove patch
@@ -324,8 +324,7 @@  discard block
 block discarded – undo
324 324
 		if (strpos($file, 'http') === 0 || strpos($file, '//') === 0)
325 325
 		{
326 326
 			$includes = array($file);
327
-		}
328
-		else
327
+		} else
329 328
 		{
330 329
 			// Extract extension and strip the file
331 330
 			$strip = JFile::stripExt($file);
@@ -346,8 +345,7 @@  discard block
 block discarded – undo
346 345
 				// where major and minor are the browser version names
347 346
 				$potential = array($strip, $strip . '_' . $browser,  $strip . '_' . $browser . '_' . $major,
348 347
 					$strip . '_' . $browser . '_' . $major . '_' . $minor);
349
-			}
350
-			else
348
+			} else
351 349
 			{
352 350
 				$potential = array($strip);
353 351
 			}
@@ -373,8 +371,7 @@  discard block
 block discarded – undo
373 371
 						if (strlen($strip) > 4 && preg_match('#\.min$#', $strip))
374 372
 						{
375 373
 							$files[] = preg_replace('#\.min$#', '.', $strip) . $ext;
376
-						}
377
-						else
374
+						} else
378 375
 						{
379 376
 							$files[] = $strip . '-uncompressed.' . $ext;
380 377
 						}
@@ -397,8 +394,7 @@  discard block
 block discarded – undo
397 394
 							$includes[] = JUri::base(true) . "/templates/$template/$folder/$file" . static::getMd5Version($path);
398 395
 
399 396
 							break;
400
-						}
401
-						else
397
+						} else
402 398
 						{
403 399
 							// If the file contains any /: it can be in an media extension subfolder
404 400
 							if (strpos($file, '/'))
@@ -462,8 +458,7 @@  discard block
 block discarded – undo
462 458
 
463 459
 										break;
464 460
 									}
465
-								}
466
-								else
461
+								} else
467 462
 								{
468 463
 									// Try to deals in the extension media folder
469 464
 									$path = JPATH_ROOT . "/media/$extension/$folder/$file";
@@ -529,8 +524,7 @@  discard block
 block discarded – undo
529 524
 						if (strlen($strip) > 4 && preg_match('#\.min$#', $strip))
530 525
 						{
531 526
 							$files[] = preg_replace('#\.min$#', '.', $strip) . $ext;
532
-						}
533
-						else
527
+						} else
534 528
 						{
535 529
 							$files[] = $strip . '-uncompressed.' . $ext;
536 530
 						}
@@ -645,17 +639,14 @@  discard block
 block discarded – undo
645 639
 			if (count($includes) == 0)
646 640
 			{
647 641
 				return null;
648
-			}
649
-			elseif (count($includes) == 1)
642
+			} elseif (count($includes) == 1)
650 643
 			{
651 644
 				return $includes[0];
652
-			}
653
-			else
645
+			} else
654 646
 			{
655 647
 				return $includes;
656 648
 			}
657
-		}
658
-		else
649
+		} else
659 650
 			// If inclusion is required
660 651
 		{
661 652
 			$document = JFactory::getDocument();
@@ -698,17 +689,14 @@  discard block
 block discarded – undo
698 689
 			if (count($includes) == 0)
699 690
 			{
700 691
 				return null;
701
-			}
702
-			elseif (count($includes) == 1)
692
+			} elseif (count($includes) == 1)
703 693
 			{
704 694
 				return $includes[0];
705
-			}
706
-			else
695
+			} else
707 696
 			{
708 697
 				return $includes;
709 698
 			}
710
-		}
711
-		else
699
+		} else
712 700
 			// If inclusion is required
713 701
 		{
714 702
 			$document = JFactory::getDocument();
@@ -846,8 +834,7 @@  discard block
 block discarded – undo
846 834
 			if (isset($title['title']))
847 835
 			{
848 836
 				$title = $title['title'];
849
-			}
850
-			else
837
+			} else
851 838
 			{
852 839
 				$title = '';
853 840
 			}
@@ -862,8 +849,7 @@  discard block
 block discarded – undo
862 849
 		if ($href)
863 850
 		{
864 851
 			$tip = '<a href="' . $href . '">' . $text . '</a>';
865
-		}
866
-		else
852
+		} else
867 853
 		{
868 854
 			$tip = $text;
869 855
 		}
@@ -878,8 +864,7 @@  discard block
 block discarded – undo
878 864
 				$title = htmlspecialchars($title, ENT_COMPAT, 'UTF-8');
879 865
 				$tooltip = $title . '::' . $tooltip;
880 866
 			}
881
-		}
882
-		else
867
+		} else
883 868
 		{
884 869
 			$tooltip = self::tooltipText($title, $tooltip, 0);
885 870
 		}
@@ -934,8 +919,7 @@  discard block
 block discarded – undo
934 919
 			elseif ($content != '')
935 920
 			{
936 921
 				$result = '<strong>' . $title . '</strong><br />' . $content;
937
-			}
938
-			else
922
+			} else
939 923
 			{
940 924
 				$result = $title;
941 925
 			}
@@ -990,8 +974,7 @@  discard block
 block discarded – undo
990 974
 		if (is_file(JPATH_ROOT . '/media/system/js/fields/calendar-locales/' . strtolower($tag) . '.js'))
991 975
 		{
992 976
 			$localesPath = 'system/fields/calendar-locales/' . strtolower($tag) . '.js';
993
-		}
994
-		elseif (is_file(JPATH_ROOT . '/media/system/js/fields/calendar-locales/' . strtolower(substr($tag, 0, -3)) . '.js'))
977
+		} elseif (is_file(JPATH_ROOT . '/media/system/js/fields/calendar-locales/' . strtolower(substr($tag, 0, -3)) . '.js'))
995 978
 		{
996 979
 			$localesPath = 'system/fields/calendar-locales/' . strtolower(substr($tag, 0, -3)) . '.js';
997 980
 		}
@@ -1025,8 +1008,7 @@  discard block
 block discarded – undo
1025 1008
 			date_default_timezone_set('UTC');
1026 1009
 			$inputvalue = strftime($format, strtotime($value));
1027 1010
 			date_default_timezone_set($tz);
1028
-		}
1029
-		else
1011
+		} else
1030 1012
 		{
1031 1013
 			$inputvalue = '';
1032 1014
 		}
@@ -1121,25 +1103,21 @@  discard block
 block discarded – undo
1121 1103
 			if (is_bool($v))
1122 1104
 			{
1123 1105
 				$elements[] = $key . ': ' . ($v ? 'true' : 'false');
1124
-			}
1125
-			elseif (is_numeric($v))
1106
+			} elseif (is_numeric($v))
1126 1107
 			{
1127 1108
 				$elements[] = $key . ': ' . ($v + 0);
1128
-			}
1129
-			elseif (is_string($v))
1109
+			} elseif (is_string($v))
1130 1110
 			{
1131 1111
 				if (strpos($v, '\\') === 0)
1132 1112
 				{
1133 1113
 					// Items such as functions and JSON objects are prefixed with \, strip the prefix and don't encode them
1134 1114
 					$elements[] = $key . ': ' . substr($v, 1);
1135
-				}
1136
-				else
1115
+				} else
1137 1116
 				{
1138 1117
 					// The safest way to insert a string
1139 1118
 					$elements[] = $key . ': ' . json_encode((string) $v);
1140 1119
 				}
1141
-			}
1142
-			else
1120
+			} else
1143 1121
 			{
1144 1122
 				$elements[] = $key . ': ' . json_encode(is_object($v) ? get_object_vars($v) : $v);
1145 1123
 			}
Please login to merge, or discard this patch.
extensions/libraries/redcore/html/rsearchtools.php 1 patch
Braces   +1 added lines, -2 removed lines patch added patch discarded remove patch
@@ -205,8 +205,7 @@
 block discarded – undo
205 205
 		if ($order != $selected)
206 206
 		{
207 207
 			$direction = $new_direction;
208
-		}
209
-		else
208
+		} else
210 209
 		{
211 210
 			$direction = ($direction == 'desc') ? 'asc' : 'desc';
212 211
 		}
Please login to merge, or discard this patch.
extensions/libraries/redcore/html/media.php 1 patch
Braces   +7 added lines, -14 removed lines patch added patch discarded remove patch
@@ -68,22 +68,19 @@  discard block
 block discarded – undo
68 68
 			self::$frameworkOptions = array(
69 69
 				'disableMootools' => true,
70 70
 			);
71
-		}
72
-		elseif ($framework == 'bootstrap2')
71
+		} elseif ($framework == 'bootstrap2')
73 72
 		{
74 73
 			self::$frameworkSuffix  = 'bs2';
75 74
 			self::$frameworkOptions = array(
76 75
 				'disableMootools' => false,
77 76
 			);
78
-		}
79
-		elseif ($framework == 'foundation5')
77
+		} elseif ($framework == 'foundation5')
80 78
 		{
81 79
 			self::$frameworkSuffix  = 'fd5';
82 80
 			self::$frameworkOptions = array(
83 81
 				'disableMootools' => false,
84 82
 			);
85
-		}
86
-		else
83
+		} else
87 84
 		{
88 85
 			self::$frameworkSuffix  = '';
89 86
 			self::$frameworkOptions = array(
@@ -119,12 +116,10 @@  discard block
 block discarded – undo
119 116
 			if (self::getFramework() == 'bootstrap2')
120 117
 			{
121 118
 				RHelperAsset::load('component.min.css', 'redcore');
122
-			}
123
-			elseif (self::getFramework() == 'bootstrap3')
119
+			} elseif (self::getFramework() == 'bootstrap3')
124 120
 			{
125 121
 				RHelperAsset::load('component.bs3.min.css', 'redcore');
126
-			}
127
-			elseif (self::getFramework() == 'foundation5')
122
+			} elseif (self::getFramework() == 'foundation5')
128 123
 			{
129 124
 			}
130 125
 		}
@@ -154,12 +149,10 @@  discard block
 block discarded – undo
154 149
 			if (self::getFramework() == 'bootstrap2')
155 150
 			{
156 151
 				RHelperAsset::load('lib/bootstrap/js/bootstrap.min.js', 'redcore');
157
-			}
158
-			elseif (self::getFramework() == 'bootstrap3')
152
+			} elseif (self::getFramework() == 'bootstrap3')
159 153
 			{
160 154
 				RHelperAsset::load('lib/bootstrap3/js/bootstrap.min.js', 'redcore');
161
-			}
162
-			elseif (self::getFramework() == 'foundation5')
155
+			} elseif (self::getFramework() == 'foundation5')
163 156
 			{
164 157
 			}
165 158
 		}
Please login to merge, or discard this patch.