Passed
Branch master (ef3387)
by Anthony
09:36
created
index.php 1 patch
Braces   +6 added lines, -12 removed lines patch added patch discarded remove patch
@@ -35,8 +35,7 @@  discard block
 block discarded – undo
35 35
 		if ((isset($_GET['page'])) && ($_GET['page'] != null)) {
36 36
 			$page = $_GET['page'];
37 37
 			$contenu->getHeadPage(0, $page);
38
-		}
39
-		else {
38
+		} else {
40 39
 			$contenu->getHeadPage(1);
41 40
 		}
42 41
 
@@ -70,17 +69,14 @@  discard block
 block discarded – undo
70 69
 			//si c'est un controleur de base on va cerhcer dans core/admin
71 70
 			if ($core !== false) {
72 71
 				require_once(ROOT.$lien.".php");
73
-			}
74
-			else if ($module !== false) {
72
+			} else if ($module !== false) {
75 73
 				$explode = explode("/", $lien, 3);
76 74
 
77 75
 				require_once(ROOT.$explode[0]."/".$explode[1]."/app/controller/".$explode[2].".php");
78
-			}
79
-			else {
76
+			} else {
80 77
 				require_once("app/controller/".$lien.".php");
81 78
 			}
82
-		}
83
-		else {
79
+		} else {
84 80
 			$cache = new \core\Cache($page);
85 81
 
86 82
 			$router_module = new RouterModule();
@@ -98,8 +94,7 @@  discard block
 block discarded – undo
98 94
 				echo("<pre>");
99 95
 				print_r($arr);
100 96
 				echo("</pre>");
101
-			}
102
-			else {
97
+			} else {
103 98
 				$contenu->getContenuPage();
104 99
 				$contenu_page = $contenu->getContenu();
105 100
 
@@ -122,8 +117,7 @@  discard block
 block discarded – undo
122 117
 			}
123 118
 			$cache->setEnd();
124 119
 		}
125
-	}
126
-	else {
120
+	} else {
127 121
 		$contenu->getContenuPage();
128 122
 		$contenu_page = $contenu->getContenu();
129 123
 
Please login to merge, or discard this patch.
admin/views/template/principal.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -9,7 +9,7 @@  discard block
 block discarded – undo
9 9
 		<link rel="stylesheet" type="text/css" href="<?=LIBSWEBROOT?>reset_css/reset.css">
10 10
 		<link rel="stylesheet" type="text/css" href="<?=WEBROOT?>admin/views/template/css/style.css">
11 11
 		<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.2.0/jquery.min.js"></script>
12
-		<?php require_once(ROOT."admin/views/template/js/menu.php");?>
12
+		<?php require_once(ROOT."admin/views/template/js/menu.php"); ?>
13 13
 
14 14
 		<!-- Les librairies utlisées -->
15 15
 		<link rel="stylesheet" type="text/css" href="<?=LIBSWEBROOT?>popup/css/style.css">
@@ -19,7 +19,7 @@  discard block
 block discarded – undo
19 19
 	</head>
20 20
 	<?=\core\HTML\flashmessage\FlashMessage::getFlash(); ?>
21 21
 	<body>
22
-		<nav class="menu <?php if (($_SESSION["menu_plie".CLEF_SITE] == "deplie") || (!isset($_SESSION["menu_plie".CLEF_SITE]))):?>active<?php endif;?>">
22
+		<nav class="menu <?php if (($_SESSION["menu_plie".CLEF_SITE] == "deplie") || (!isset($_SESSION["menu_plie".CLEF_SITE]))):?>active<?php endif; ?>">
23 23
 			<div class="titre">
24 24
 				<h1>Ribs V2.3.5.6</h1>
25 25
 				<i class="fa fa-bars"></i>
@@ -41,14 +41,14 @@  discard block
 block discarded – undo
41 41
 										<a href="<?=ADMWEBROOT?>notifications"><i class="fa fa-bell  <?php if ($admin->getNotification() == 1):?> animated infinite swing<?php endif; ?>"></i></a>
42 42
 									</div>
43 43
 								</div>
44
-							<?php endif;?>
44
+							<?php endif; ?>
45 45
 							<?php if (($droit_acces->getSuperAdmin() == 1) || ($droit_acces->getDroitAccesPage("configuration/mon-compte"))):?>
46 46
 								<div class="colonne">
47 47
 									<div class="config">
48 48
 										<a href="<?=ADMWEBROOT?>configuration/index"><i class="fa fa-gear"></i></a>
49 49
 									</div>
50 50
 								</div>
51
-							<?php endif;?>
51
+							<?php endif; ?>
52 52
 							<div class="colonne">
53 53
 								<div class="logout">
54 54
 									<a href="<?=WEBROOT?>administrator/controller/core/auth/connexion/logout"><i class="fa fa-sign-out animated activate swing infinite"></i></a>
@@ -67,7 +67,7 @@  discard block
 block discarded – undo
67 67
 							<ul>
68 68
 								<?php if ($droit_acces->getDroitAccesAction("CREATION COMPTE ADMIN")):?>
69 69
 									<li><i class="fa fa-user"></i><a href="<?=ADMWEBROOT?>gestion-comptes/creer-utilisateur">Créer un utilisateur</a></li>
70
-								<?php endif;?>
70
+								<?php endif; ?>
71 71
 							</ul>
72 72
 						</li>
73 73
 					<?php endif; ?>
Please login to merge, or discard this patch.
admin/views/gestion-contenus/inline.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 <button id="supprimer-page-contenu" type="button" class="submit-contenu supprimer-page supprimer open-popup" popup="supprimer-page" href="<?=ADMWEBROOT?>gestion-contenus/modifier-contenu?id=<?=$id_page_courante?>"><i class="fa fa-times"></i>Annuler</button>
18 18
 
19 19
 
20
-<?php if ($config->getResponsive() == 1){?>
20
+<?php if ($config->getResponsive() == 1) {?>
21 21
 	<link rel="stylesheet" type="text/css" href="<?=WEBROOT?>admin/views/template/css/foundation-inline.css">
22 22
 <?php }?>
23 23
 <link rel="stylesheet" type="text/css" href="<?=TPLWEBROOT?>css/page.css">
@@ -33,13 +33,13 @@  discard block
 block discarded – undo
33 33
 <script>
34 34
 	CKEDITOR.disableAutoInline = true;
35 35
 
36
-	<?php for($i=0 ; $i<$bloc_editable ; $i++):?>
36
+	<?php for ($i = 0; $i < $bloc_editable; $i++):?>
37 37
 		$(document).ready(function() {
38 38
 			console.log("editor<?=$i?>");
39 39
 			$("#editor<?=$i?>").attr("contenteditable", true);
40 40
 		})
41 41
 		var editor<?=$i?> = CKEDITOR.inline("editor<?=$i?>", { customConfig: "<?=WEBROOT?>config/config_ckeditor.js" });
42 42
 		CKFinder.setupCKEditor( editor<?=$i?>, "<?=LIBSWEBROOT?>ckfinder/" );
43
-	<?php endfor;?>
43
+	<?php endfor; ?>
44 44
 </script>
45
-<?php require_once(ROOT."admin/views/gestion-contenus/js/inline.php");?>
46 45
\ No newline at end of file
46
+<?php require_once(ROOT."admin/views/gestion-contenus/js/inline.php"); ?>
47 47
\ No newline at end of file
Please login to merge, or discard this patch.
admin/controller/ckeditor.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,5 +2,5 @@
 block discarded – undo
2 2
 	include_once(ROOT.'libs/ckeditor/ckeditor.php');
3 3
 	require_once(ROOT.'libs/ckfinder/ckfinder.php');
4 4
 	$ckeditor = new CKEditor();
5
-	$ckeditor->basePath	= WEBROOT.'libs/ckeditor/';
5
+	$ckeditor->basePath = WEBROOT.'libs/ckeditor/';
6 6
 	CKFinder::SetupCKEditor($ckeditor, WEBROOT.'libs/ckfinder/');
7 7
\ No newline at end of file
Please login to merge, or discard this patch.
admin/controller/initialise_all.php 1 patch
Braces   +5 added lines, -10 removed lines patch added patch discarded remove patch
@@ -36,8 +36,7 @@  discard block
 block discarded – undo
36 36
 			$acces_admin = $_SESSION['acces_admin'];
37 37
 
38 38
 			unset($_SESSION['err_ajout_utilisateur']);
39
-		}
40
-		else {
39
+		} else {
41 40
 			$nom = null;
42 41
 			$prenom = null;
43 42
 			$pseudo = null;
@@ -63,8 +62,7 @@  discard block
 block discarded – undo
63 62
 			$parent_courant = $_SESSION['parent'];
64 63
 
65 64
 			unset($_SESSION['err_modification_contenu']);
66
-		}
67
-		else if (($page == "gestion-contenus/modifier-contenu") || ($page == "gestion-contenus/inline")) {
65
+		} else if (($page == "gestion-contenus/modifier-contenu") || ($page == "gestion-contenus/inline")) {
68 66
 			$id_page_courante = $_GET['id'];
69 67
 
70 68
 			$contenu->getHeadPage($id_page_courante);
@@ -78,8 +76,7 @@  discard block
 block discarded – undo
78 76
 			$texte_parent_courant = $gestion_contenu->getParentTexte($parent_courant);
79 77
 			$contenu_page = $contenu->getContenu();
80 78
 			$bloc_editable = $gestion_contenu->getBlocEditable($id_page_courante);
81
-		}
82
-		else {
79
+		} else {
83 80
 			$balise_title = null;
84 81
 			$url = null;
85 82
 			$meta_description = null;
@@ -117,8 +114,7 @@  discard block
 block discarded – undo
117 114
 			$contenu_dynamique = $config->getContenusDynamique();
118 115
 			$responsive = $config->getResponsive();
119 116
 			$cache_config = $config->getCache();
120
-		}
121
-		else {
117
+		} else {
122 118
 			$config = new \core\Configuration();
123 119
 			$nom_site = $config->getNomSite();
124 120
 			$url_site = $config->getUrlSite();
@@ -154,8 +150,7 @@  discard block
 block discarded – undo
154 150
 			$db_host_prod = $_SESSION["db_host_prod"];
155 151
 
156 152
 			unset($_SESSION['err_modification_configini']);
157
-		}
158
-		else {
153
+		} else {
159 154
 			$developpement = $ini["developpment"];
160 155
 
161 156
 			$db_type_dev = $ini["dev"]["DB_TYPE"];
Please login to merge, or discard this patch.
installation.php 1 patch
Braces   +2 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,13 +18,11 @@
 block discarded – undo
18 18
 
19 19
 			//si c'est un controleur de base on va cerhcer dans core/admin
20 20
 			require_once("installation/controller/".$lien.".php");
21
-		}
22
-		else {
21
+		} else {
23 22
 			require("installation/controller/initialise_all.php");
24 23
 			require("installation/views/template/principal.php");
25 24
 		}
26
-	}
27
-	else {
25
+	} else {
28 26
 		$page = "installation/views/index";
29 27
 		require("installation/views/template/principal.php");
30 28
 	}
Please login to merge, or discard this patch.
libs/ckeditor/ckeditor_php4.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -75,7 +75,7 @@  discard block
 block discarded – undo
75 75
 	 * When %CKEditor is created with the editor() method, a HTML &lt;textarea&gt; element is created,
76 76
 	 * it will be displayed to anyone with JavaScript disabled or with incompatible browser.
77 77
 	 */
78
-	var $textareaAttributes = array( "rows" => 8, "cols" => 60 );
78
+	var $textareaAttributes = array("rows" => 8, "cols" => 60);
79 79
 	/**
80 80
 	 * A string indicating the creation date of %CKEditor.
81 81
 	 * Do not change it unless you want to force browsers to not use previously cached version of %CKEditor.
@@ -136,9 +136,9 @@  discard block
 block discarded – undo
136 136
 	{
137 137
 		$attr = "";
138 138
 		foreach ($this->textareaAttributes as $key => $val) {
139
-			$attr.= " " . $key . '="' . str_replace('"', '&quot;', $val) . '"';
139
+			$attr .= " ".$key.'="'.str_replace('"', '&quot;', $val).'"';
140 140
 		}
141
-		$out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n";
141
+		$out = "<textarea name=\"".$name."\"".$attr.">".htmlspecialchars($value)."</textarea>\n";
142 142
 		if (!$this->initialized) {
143 143
 			$out .= $this->init();
144 144
 		}
@@ -239,11 +239,11 @@  discard block
 block discarded – undo
239 239
 			$classDetection = "";
240 240
 			$js .= "CKEDITOR.replaceAll( function(textarea, config) {\n";
241 241
 			if (!empty($className)) {
242
-				$js .= "	var classRegex = new RegExp('(?:^| )' + '". $className ."' + '(?:$| )');\n";
242
+				$js .= "	var classRegex = new RegExp('(?:^| )' + '".$className."' + '(?:$| )');\n";
243 243
 				$js .= "	if (!classRegex.test(textarea.className))\n";
244 244
 				$js .= "		return false;\n";
245 245
 			}
246
-			$js .= "	CKEDITOR.tools.extend(config, ". $this->jsEncode($_config) .", true);";
246
+			$js .= "	CKEDITOR.tools.extend(config, ".$this->jsEncode($_config).", true);";
247 247
 			$js .= "} );";
248 248
 
249 249
 		}
@@ -384,7 +384,7 @@  discard block
 block discarded – undo
384 384
 		}
385 385
 
386 386
 		if (!empty($_events)) {
387
-			foreach($_events as $eventName => $handlers) {
387
+			foreach ($_events as $eventName => $handlers) {
388 388
 				if (empty($handlers)) {
389 389
 					continue;
390 390
 				}
@@ -425,7 +425,7 @@  discard block
 block discarded – undo
425 425
 					}
426 426
 					// Return only new events
427 427
 					if (!in_array($code, $returnedEvents[$eventName])) {
428
-						$out .= ($code ? "\n" : "") . "CKEDITOR.on('". $eventName ."', $code);";
428
+						$out .= ($code ? "\n" : "")."CKEDITOR.on('".$eventName."', $code);";
429 429
 						$returnedEvents[$eventName][] = $code;
430 430
 					}
431 431
 				}
@@ -457,19 +457,19 @@  discard block
 block discarded – undo
457 457
 		$ckeditorPath = $this->ckeditorPath();
458 458
 
459 459
 		if (!empty($this->timestamp) && $this->timestamp != "%"."TIMESTAMP%") {
460
-			$args = '?t=' . $this->timestamp;
460
+			$args = '?t='.$this->timestamp;
461 461
 		}
462 462
 
463 463
 		// Skip relative paths...
464 464
 		if (strpos($ckeditorPath, '..') !== 0) {
465
-			$out .= $this->script("window.CKEDITOR_BASEPATH='". $ckeditorPath ."';");
465
+			$out .= $this->script("window.CKEDITOR_BASEPATH='".$ckeditorPath."';");
466 466
 		}
467 467
 
468
-		$out .= "<script type=\"text/javascript\" src=\"" . $ckeditorPath . 'ckeditor.js' . $args . "\"></script>\n";
468
+		$out .= "<script type=\"text/javascript\" src=\"".$ckeditorPath.'ckeditor.js'.$args."\"></script>\n";
469 469
 
470 470
 		$extraCode = "";
471 471
 		if ($this->timestamp != $this->_timestamp) {
472
-			$extraCode .= ($extraCode ? "\n" : "") . "CKEDITOR.timestamp = '". $this->timestamp ."';";
472
+			$extraCode .= ($extraCode ? "\n" : "")."CKEDITOR.timestamp = '".$this->timestamp."';";
473 473
 		}
474 474
 		if ($extraCode) {
475 475
 			$out .= $this->script($extraCode);
@@ -502,7 +502,7 @@  discard block
 block discarded – undo
502 502
 			/**
503 503
 			 * realpath - Returns canonicalized absolute pathname
504 504
 			 */
505
-			$realPath = realpath( './' ) ;
505
+			$realPath = realpath('./');
506 506
 		}
507 507
 
508 508
 		/**
@@ -546,14 +546,14 @@  discard block
 block discarded – undo
546 546
 			return str_replace(',', '.', $val);
547 547
 		}
548 548
 		if (is_array($val) || is_object($val)) {
549
-			if (is_array($val) && (array_keys($val) === range(0,count($val)-1))) {
550
-				return '[' . implode(',', array_map(array($this, 'jsEncode'), $val)) . ']';
549
+			if (is_array($val) && (array_keys($val) === range(0, count($val) - 1))) {
550
+				return '['.implode(',', array_map(array($this, 'jsEncode'), $val)).']';
551 551
 			}
552 552
 			$temp = array();
553
-			foreach ($val as $k => $v){
554
-				$temp[] = $this->jsEncode("{$k}") . ':' . $this->jsEncode($v);
553
+			foreach ($val as $k => $v) {
554
+				$temp[] = $this->jsEncode("{$k}").':'.$this->jsEncode($v);
555 555
 			}
556
-			return '{' . implode(',', $temp) . '}';
556
+			return '{'.implode(',', $temp).'}';
557 557
 		}
558 558
 		// String otherwise
559 559
 		if (strpos($val, '@@') === 0)
@@ -561,6 +561,6 @@  discard block
 block discarded – undo
561 561
 		if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.')
562 562
 			return $val;
563 563
 
564
-		return '"' . str_replace(array("\\", "/", "\n", "\t", "\r", "\x08", "\x0c", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'), $val) . '"';
564
+		return '"'.str_replace(array("\\", "/", "\n", "\t", "\r", "\x08", "\x0c", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'), $val).'"';
565 565
 	}
566 566
 }
Please login to merge, or discard this patch.
Braces   +19 added lines, -24 removed lines patch added patch discarded remove patch
@@ -146,10 +146,11 @@  discard block
 block discarded – undo
146 146
 		$_config = $this->configSettings($config, $events);
147 147
 
148 148
 		$js = $this->returnGlobalEvents();
149
-		if (!empty($_config))
150
-			$js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");";
151
-		else
152
-			$js .= "CKEDITOR.replace('".$name."');";
149
+		if (!empty($_config)) {
150
+					$js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");";
151
+		} else {
152
+					$js .= "CKEDITOR.replace('".$name."');";
153
+		}
153 154
 
154 155
 		$out .= $this->script($js);
155 156
 
@@ -186,8 +187,7 @@  discard block
 block discarded – undo
186 187
 		$js = $this->returnGlobalEvents();
187 188
 		if (!empty($_config)) {
188 189
 			$js .= "CKEDITOR.replace('".$id."', ".$this->jsEncode($_config).");";
189
-		}
190
-		else {
190
+		} else {
191 191
 			$js .= "CKEDITOR.replace('".$id."');";
192 192
 		}
193 193
 		$out .= $this->script($js);
@@ -230,12 +230,10 @@  discard block
 block discarded – undo
230 230
 		if (empty($_config)) {
231 231
 			if (empty($className)) {
232 232
 				$js .= "CKEDITOR.replaceAll();";
233
-			}
234
-			else {
233
+			} else {
235 234
 				$js .= "CKEDITOR.replaceAll('".$className."');";
236 235
 			}
237
-		}
238
-		else {
236
+		} else {
239 237
 			$classDetection = "";
240 238
 			$js .= "CKEDITOR.replaceAll( function(textarea, config) {\n";
241 239
 			if (!empty($className)) {
@@ -293,8 +291,7 @@  discard block
 block discarded – undo
293 291
 	{
294 292
 		if (!empty($event)) {
295 293
 			$this->_events[$event] = array();
296
-		}
297
-		else {
294
+		} else {
298 295
 			$this->_events = array();
299 296
 		}
300 297
 	}
@@ -333,8 +330,7 @@  discard block
 block discarded – undo
333 330
 	{
334 331
 		if (!empty($event)) {
335 332
 			$this->_globalEvents[$event] = array();
336
-		}
337
-		else {
333
+		} else {
338 334
 			$this->_globalEvents = array();
339 335
 		}
340 336
 	}
@@ -387,11 +383,9 @@  discard block
 block discarded – undo
387 383
 			foreach($_events as $eventName => $handlers) {
388 384
 				if (empty($handlers)) {
389 385
 					continue;
390
-				}
391
-				else if (count($handlers) == 1) {
386
+				} else if (count($handlers) == 1) {
392 387
 					$_config['on'][$eventName] = '@@'.$handlers[0];
393
-				}
394
-				else {
388
+				} else {
395 389
 					$_config['on'][$eventName] = '@@function (ev){';
396 390
 					foreach ($handlers as $handler => $code) {
397 391
 						$_config['on'][$eventName] .= '('.$code.')(ev);';
@@ -497,8 +491,7 @@  discard block
 block discarded – undo
497 491
 		 */
498 492
 		if (isset($_SERVER['SCRIPT_FILENAME'])) {
499 493
 			$realPath = dirname($_SERVER['SCRIPT_FILENAME']);
500
-		}
501
-		else {
494
+		} else {
502 495
 			/**
503 496
 			 * realpath - Returns canonicalized absolute pathname
504 497
 			 */
@@ -556,10 +549,12 @@  discard block
 block discarded – undo
556 549
 			return '{' . implode(',', $temp) . '}';
557 550
 		}
558 551
 		// String otherwise
559
-		if (strpos($val, '@@') === 0)
560
-			return substr($val, 2);
561
-		if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.')
562
-			return $val;
552
+		if (strpos($val, '@@') === 0) {
553
+					return substr($val, 2);
554
+		}
555
+		if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.') {
556
+					return $val;
557
+		}
563 558
 
564 559
 		return '"' . str_replace(array("\\", "/", "\n", "\t", "\r", "\x08", "\x0c", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'), $val) . '"';
565 560
 	}
Please login to merge, or discard this patch.
libs/ckeditor/ckeditor.php 2 patches
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -23,7 +23,7 @@
 block discarded – undo
23 23
  * @endcode
24 24
  */
25 25
 
26
-if ( !function_exists('version_compare') || version_compare( phpversion(), '5', '<' ) )
27
-	include_once( 'ckeditor_php4.php' ) ;
26
+if (!function_exists('version_compare') || version_compare(phpversion(), '5', '<'))
27
+	include_once('ckeditor_php4.php');
28 28
 else
29
-	include_once( 'ckeditor_php5.php' ) ;
29
+	include_once('ckeditor_php5.php');
Please login to merge, or discard this patch.
Braces   +3 added lines, -2 removed lines patch added patch discarded remove patch
@@ -23,7 +23,8 @@
 block discarded – undo
23 23
  * @endcode
24 24
  */
25 25
 
26
-if ( !function_exists('version_compare') || version_compare( phpversion(), '5', '<' ) )
26
+if ( !function_exists('version_compare') || version_compare( phpversion(), '5', '<' ) ) {
27 27
 	include_once( 'ckeditor_php4.php' ) ;
28
-else
28
+} else {
29 29
 	include_once( 'ckeditor_php5.php' ) ;
30
+}
Please login to merge, or discard this patch.
libs/ckeditor/ckeditor_php5.php 2 patches
Spacing   +18 added lines, -18 removed lines patch added patch discarded remove patch
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 * When %CKEditor is created with the editor() method, a HTML &lt;textarea&gt; element is created,
74 74
 	 * it will be displayed to anyone with JavaScript disabled or with incompatible browser.
75 75
 	 */
76
-	public $textareaAttributes = array( "rows" => 8, "cols" => 60 );
76
+	public $textareaAttributes = array("rows" => 8, "cols" => 60);
77 77
 	/**
78 78
 	 * A string indicating the creation date of %CKEditor.
79 79
 	 * Do not change it unless you want to force browsers to not use previously cached version of %CKEditor.
@@ -132,9 +132,9 @@  discard block
 block discarded – undo
132 132
 	{
133 133
 		$attr = "";
134 134
 		foreach ($this->textareaAttributes as $key => $val) {
135
-			$attr.= " " . $key . '="' . str_replace('"', '&quot;', $val) . '"';
135
+			$attr .= " ".$key.'="'.str_replace('"', '&quot;', $val).'"';
136 136
 		}
137
-		$out = "<textarea name=\"" . $name . "\"" . $attr . ">" . htmlspecialchars($value) . "</textarea>\n";
137
+		$out = "<textarea name=\"".$name."\"".$attr.">".htmlspecialchars($value)."</textarea>\n";
138 138
 		if (!$this->initialized) {
139 139
 			$out .= $this->init();
140 140
 		}
@@ -235,11 +235,11 @@  discard block
 block discarded – undo
235 235
 			$classDetection = "";
236 236
 			$js .= "CKEDITOR.replaceAll( function(textarea, config) {\n";
237 237
 			if (!empty($className)) {
238
-				$js .= "	var classRegex = new RegExp('(?:^| )' + '". $className ."' + '(?:$| )');\n";
238
+				$js .= "	var classRegex = new RegExp('(?:^| )' + '".$className."' + '(?:$| )');\n";
239 239
 				$js .= "	if (!classRegex.test(textarea.className))\n";
240 240
 				$js .= "		return false;\n";
241 241
 			}
242
-			$js .= "	CKEDITOR.tools.extend(config, ". $this->jsEncode($_config) .", true);";
242
+			$js .= "	CKEDITOR.tools.extend(config, ".$this->jsEncode($_config).", true);";
243 243
 			$js .= "} );";
244 244
 
245 245
 		}
@@ -378,7 +378,7 @@  discard block
 block discarded – undo
378 378
 		}
379 379
 
380 380
 		if (!empty($_events)) {
381
-			foreach($_events as $eventName => $handlers) {
381
+			foreach ($_events as $eventName => $handlers) {
382 382
 				if (empty($handlers)) {
383 383
 					continue;
384 384
 				}
@@ -418,7 +418,7 @@  discard block
 block discarded – undo
418 418
 					}
419 419
 					// Return only new events
420 420
 					if (!in_array($code, $returnedEvents[$eventName])) {
421
-						$out .= ($code ? "\n" : "") . "CKEDITOR.on('". $eventName ."', $code);";
421
+						$out .= ($code ? "\n" : "")."CKEDITOR.on('".$eventName."', $code);";
422 422
 						$returnedEvents[$eventName][] = $code;
423 423
 					}
424 424
 				}
@@ -449,19 +449,19 @@  discard block
 block discarded – undo
449 449
 		$ckeditorPath = $this->ckeditorPath();
450 450
 
451 451
 		if (!empty($this->timestamp) && $this->timestamp != "%"."TIMESTAMP%") {
452
-			$args = '?t=' . $this->timestamp;
452
+			$args = '?t='.$this->timestamp;
453 453
 		}
454 454
 
455 455
 		// Skip relative paths...
456 456
 		if (strpos($ckeditorPath, '..') !== 0) {
457
-			$out .= $this->script("window.CKEDITOR_BASEPATH='". $ckeditorPath ."';");
457
+			$out .= $this->script("window.CKEDITOR_BASEPATH='".$ckeditorPath."';");
458 458
 		}
459 459
 
460
-		$out .= "<script type=\"text/javascript\" src=\"" . $ckeditorPath . 'ckeditor.js' . $args . "\"></script>\n";
460
+		$out .= "<script type=\"text/javascript\" src=\"".$ckeditorPath.'ckeditor.js'.$args."\"></script>\n";
461 461
 
462 462
 		$extraCode = "";
463 463
 		if ($this->timestamp != self::timestamp) {
464
-			$extraCode .= ($extraCode ? "\n" : "") . "CKEDITOR.timestamp = '". $this->timestamp ."';";
464
+			$extraCode .= ($extraCode ? "\n" : "")."CKEDITOR.timestamp = '".$this->timestamp."';";
465 465
 		}
466 466
 		if ($extraCode) {
467 467
 			$out .= $this->script($extraCode);
@@ -493,7 +493,7 @@  discard block
 block discarded – undo
493 493
 			/**
494 494
 			 * realpath - Returns canonicalized absolute pathname
495 495
 			 */
496
-			$realPath = realpath( './' ) ;
496
+			$realPath = realpath('./');
497 497
 		}
498 498
 
499 499
 		/**
@@ -536,14 +536,14 @@  discard block
 block discarded – undo
536 536
 			return str_replace(',', '.', $val);
537 537
 		}
538 538
 		if (is_array($val) || is_object($val)) {
539
-			if (is_array($val) && (array_keys($val) === range(0,count($val)-1))) {
540
-				return '[' . implode(',', array_map(array($this, 'jsEncode'), $val)) . ']';
539
+			if (is_array($val) && (array_keys($val) === range(0, count($val) - 1))) {
540
+				return '['.implode(',', array_map(array($this, 'jsEncode'), $val)).']';
541 541
 			}
542 542
 			$temp = array();
543
-			foreach ($val as $k => $v){
544
-				$temp[] = $this->jsEncode("{$k}") . ':' . $this->jsEncode($v);
543
+			foreach ($val as $k => $v) {
544
+				$temp[] = $this->jsEncode("{$k}").':'.$this->jsEncode($v);
545 545
 			}
546
-			return '{' . implode(',', $temp) . '}';
546
+			return '{'.implode(',', $temp).'}';
547 547
 		}
548 548
 		// String otherwise
549 549
 		if (strpos($val, '@@') === 0)
@@ -551,6 +551,6 @@  discard block
 block discarded – undo
551 551
 		if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.')
552 552
 			return $val;
553 553
 
554
-		return '"' . str_replace(array("\\", "/", "\n", "\t", "\r", "\x08", "\x0c", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'), $val) . '"';
554
+		return '"'.str_replace(array("\\", "/", "\n", "\t", "\r", "\x08", "\x0c", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'), $val).'"';
555 555
 	}
556 556
 }
Please login to merge, or discard this patch.
Braces   +19 added lines, -24 removed lines patch added patch discarded remove patch
@@ -142,10 +142,11 @@  discard block
 block discarded – undo
142 142
 		$_config = $this->configSettings($config, $events);
143 143
 
144 144
 		$js = $this->returnGlobalEvents();
145
-		if (!empty($_config))
146
-			$js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");";
147
-		else
148
-			$js .= "CKEDITOR.replace('".$name."');";
145
+		if (!empty($_config)) {
146
+					$js .= "CKEDITOR.replace('".$name."', ".$this->jsEncode($_config).");";
147
+		} else {
148
+					$js .= "CKEDITOR.replace('".$name."');";
149
+		}
149 150
 
150 151
 		$out .= $this->script($js);
151 152
 
@@ -182,8 +183,7 @@  discard block
 block discarded – undo
182 183
 		$js = $this->returnGlobalEvents();
183 184
 		if (!empty($_config)) {
184 185
 			$js .= "CKEDITOR.replace('".$id."', ".$this->jsEncode($_config).");";
185
-		}
186
-		else {
186
+		} else {
187 187
 			$js .= "CKEDITOR.replace('".$id."');";
188 188
 		}
189 189
 		$out .= $this->script($js);
@@ -226,12 +226,10 @@  discard block
 block discarded – undo
226 226
 		if (empty($_config)) {
227 227
 			if (empty($className)) {
228 228
 				$js .= "CKEDITOR.replaceAll();";
229
-			}
230
-			else {
229
+			} else {
231 230
 				$js .= "CKEDITOR.replaceAll('".$className."');";
232 231
 			}
233
-		}
234
-		else {
232
+		} else {
235 233
 			$classDetection = "";
236 234
 			$js .= "CKEDITOR.replaceAll( function(textarea, config) {\n";
237 235
 			if (!empty($className)) {
@@ -289,8 +287,7 @@  discard block
 block discarded – undo
289 287
 	{
290 288
 		if (!empty($event)) {
291 289
 			$this->events[$event] = array();
292
-		}
293
-		else {
290
+		} else {
294 291
 			$this->events = array();
295 292
 		}
296 293
 	}
@@ -329,8 +326,7 @@  discard block
 block discarded – undo
329 326
 	{
330 327
 		if (!empty($event)) {
331 328
 			$this->globalEvents[$event] = array();
332
-		}
333
-		else {
329
+		} else {
334 330
 			$this->globalEvents = array();
335 331
 		}
336 332
 	}
@@ -381,11 +377,9 @@  discard block
 block discarded – undo
381 377
 			foreach($_events as $eventName => $handlers) {
382 378
 				if (empty($handlers)) {
383 379
 					continue;
384
-				}
385
-				else if (count($handlers) == 1) {
380
+				} else if (count($handlers) == 1) {
386 381
 					$_config['on'][$eventName] = '@@'.$handlers[0];
387
-				}
388
-				else {
382
+				} else {
389 383
 					$_config['on'][$eventName] = '@@function (ev){';
390 384
 					foreach ($handlers as $handler => $code) {
391 385
 						$_config['on'][$eventName] .= '('.$code.')(ev);';
@@ -488,8 +482,7 @@  discard block
 block discarded – undo
488 482
 		 */
489 483
 		if (isset($_SERVER['SCRIPT_FILENAME'])) {
490 484
 			$realPath = dirname($_SERVER['SCRIPT_FILENAME']);
491
-		}
492
-		else {
485
+		} else {
493 486
 			/**
494 487
 			 * realpath - Returns canonicalized absolute pathname
495 488
 			 */
@@ -546,10 +539,12 @@  discard block
 block discarded – undo
546 539
 			return '{' . implode(',', $temp) . '}';
547 540
 		}
548 541
 		// String otherwise
549
-		if (strpos($val, '@@') === 0)
550
-			return substr($val, 2);
551
-		if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.')
552
-			return $val;
542
+		if (strpos($val, '@@') === 0) {
543
+					return substr($val, 2);
544
+		}
545
+		if (strtoupper(substr($val, 0, 9)) == 'CKEDITOR.') {
546
+					return $val;
547
+		}
553 548
 
554 549
 		return '"' . str_replace(array("\\", "/", "\n", "\t", "\r", "\x08", "\x0c", '"'), array('\\\\', '\\/', '\\n', '\\t', '\\r', '\\b', '\\f', '\"'), $val) . '"';
555 550
 	}
Please login to merge, or discard this patch.