Completed
Pull Request — master (#4439)
by Julius
13:40
created
core/templates/layout.user.php 1 patch
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -4,7 +4,7 @@  discard block
 block discarded – undo
4 4
 		<meta charset="utf-8">
5 5
 		<title>
6 6
 			<?php
7
-				p(!empty($_['application'])?$_['application'].' - ':'');
7
+				p(!empty($_['application']) ? $_['application'].' - ' : '');
8 8
 				p($theme->getTitle());
9 9
 			?>
10 10
 		</title>
@@ -14,7 +14,7 @@  discard block
 block discarded – undo
14 14
 		<meta name="apple-itunes-app" content="app-id=<?php p($theme->getiTunesAppId()); ?>">
15 15
 		<meta name="apple-mobile-web-app-capable" content="yes">
16 16
 		<meta name="apple-mobile-web-app-status-bar-style" content="black">
17
-		<meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid']!='files')? $_['application']:$theme->getTitle()); ?>">
17
+		<meta name="apple-mobile-web-app-title" content="<?php p((!empty($_['application']) && $_['appid'] != 'files') ? $_['application'] : $theme->getTitle()); ?>">
18 18
 		<meta name="mobile-web-app-capable" content="yes">
19 19
 		<meta name="theme-color" content="<?php p($theme->getColorPrimary()); ?>">
20 20
 		<link rel="icon" href="<?php print_unescaped(image_path($_['appid'], 'favicon.ico')); /* IE11+ supports png */ ?>">
@@ -26,18 +26,18 @@  discard block
 block discarded – undo
26 26
 				<?php print_unescaped($_['inline_ocjs']); ?>
27 27
 			</script>
28 28
 		<?php endif; ?>
29
-		<?php foreach($_['cssfiles'] as $cssfile): ?>
29
+		<?php foreach ($_['cssfiles'] as $cssfile): ?>
30 30
 			<link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>">
31 31
 		<?php endforeach; ?>
32
-		<?php foreach($_['printcssfiles'] as $cssfile): ?>
32
+		<?php foreach ($_['printcssfiles'] as $cssfile): ?>
33 33
 			<link rel="stylesheet" href="<?php print_unescaped($cssfile); ?>" media="print">
34 34
 		<?php endforeach; ?>
35
-		<?php foreach($_['jsfiles'] as $jsfile): ?>
35
+		<?php foreach ($_['jsfiles'] as $jsfile): ?>
36 36
 			<script nonce="<?php p(\OC::$server->getContentSecurityPolicyNonceManager()->getNonce()) ?>" src="<?php print_unescaped($jsfile); ?>"></script>
37 37
 		<?php endforeach; ?>
38 38
 		<?php print_unescaped($_['headers']); ?>
39 39
 	</head>
40
-	<body id="<?php p($_['bodyid']);?>">
40
+	<body id="<?php p($_['bodyid']); ?>">
41 41
 	<?php include('layout.noscript.warning.php'); ?>
42 42
 	<div id="notification-container">
43 43
 		<div id="notification"></div>
@@ -55,7 +55,7 @@  discard block
 block discarded – undo
55 55
 
56 56
 				<a href="#" class="header-appname-container menutoggle" tabindex="2">
57 57
 					<h1 class="header-appname">
58
-						<?php p(!empty($_['application'])?$_['application']: $l->t('Apps')); ?>
58
+						<?php p(!empty($_['application']) ? $_['application'] : $l->t('Apps')); ?>
59 59
 					</h1>
60 60
 					<div class="icon-caret"></div>
61 61
 				</a>
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 							<a href="<?php print_unescaped($entry['href']); ?>"
67 67
 							   tabindex="3"
68 68
 								<?php if ($entry['active']): ?> class="active"<?php endif; ?>>
69
-								<img src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>"
69
+								<img src="<?php print_unescaped($entry['icon'].'?v='.$_['versionHash']); ?>"
70 70
 									 class="app-icon"/>
71 71
 								<div class="icon-loading-small-dark"
72 72
 									 style="display:none;"></div>
@@ -88,13 +88,13 @@  discard block
 block discarded – undo
88 88
 					<div id="navigation">
89 89
 						<div id="apps">
90 90
 							<ul>
91
-								<?php foreach($_['navigation'] as $entry): ?>
91
+								<?php foreach ($_['navigation'] as $entry): ?>
92 92
 									<li data-id="<?php p($entry['id']); ?>">
93 93
 									<a href="<?php print_unescaped($entry['href']); ?>" tabindex="3"
94
-										<?php if( $entry['active'] ): ?> class="active"<?php endif; ?>>
94
+										<?php if ($entry['active']): ?> class="active"<?php endif; ?>>
95 95
 										<svg width="16" height="16" viewBox="0 0 16 16">
96 96
 											<defs><filter id="invert-<?php p($entry['id']); ?>"><feColorMatrix in="SourceGraphic" type="matrix" values="-1 0 0 0 1 0 -1 0 0 1 0 0 -1 0 1 0 0 0 1 0"></feColorMatrix></filter></defs>
97
-											<image x="0" y="0" width="16" height="16" preserveAspectRatio="xMinYMin meet" filter="url(#invert-<?php p($entry['id']); ?>)" xlink:href="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>"  class="app-icon"></image>
97
+											<image x="0" y="0" width="16" height="16" preserveAspectRatio="xMinYMin meet" filter="url(#invert-<?php p($entry['id']); ?>)" xlink:href="<?php print_unescaped($entry['icon'].'?v='.$_['versionHash']); ?>"  class="app-icon"></image>
98 98
 										</svg>
99 99
 										<div class="icon-loading-small-dark" style="display:none;"></div>
100 100
 										<span><?php p($entry['name']); ?></span>
@@ -111,7 +111,7 @@  discard block
 block discarded – undo
111 111
 			<div id="header-right">
112 112
 				<form class="searchbox" action="#" method="post" role="search" novalidate>
113 113
 					<label for="searchbox" class="hidden-visually">
114
-						<?php p($l->t('Search'));?>
114
+						<?php p($l->t('Search')); ?>
115 115
 					</label>
116 116
 					<input id="searchbox" type="search" name="query"
117 117
 						value="" required
@@ -123,8 +123,8 @@  discard block
 block discarded – undo
123 123
 						<div class="avatardiv<?php if ($_['userAvatarSet']) { print_unescaped(' avatardiv-shown'); } else { print_unescaped('" style="display: none'); } ?>">
124 124
 							<?php if ($_['userAvatarSet']): ?>
125 125
 								<img alt="" width="32" height="32"
126
-								src="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 32, 'v' => $_['userAvatarVersion']]));?>"
127
-								srcset="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 64, 'v' => $_['userAvatarVersion']]));?> 2x, <?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 128, 'v' => $_['userAvatarVersion']]));?> 4x"
126
+								src="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 32, 'v' => $_['userAvatarVersion']])); ?>"
127
+								srcset="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 64, 'v' => $_['userAvatarVersion']])); ?> 2x, <?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 128, 'v' => $_['userAvatarVersion']])); ?> 4x"
128 128
 								>
129 129
 							<?php endif; ?>
130 130
 						</div>
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
 					</div>
133 133
 					<div id="expanddiv">
134 134
 					<ul>
135
-					<?php foreach($_['settingsnavigation'] as $entry):?>
135
+					<?php foreach ($_['settingsnavigation'] as $entry):?>
136 136
 						<li>
137 137
 							<a href="<?php print_unescaped($entry['href']); ?>"
138
-								<?php if( $entry["active"] ): ?> class="active"<?php endif; ?>>
139
-								<img alt="" src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>">
138
+								<?php if ($entry["active"]): ?> class="active"<?php endif; ?>>
139
+								<img alt="" src="<?php print_unescaped($entry['icon'].'?v='.$_['versionHash']); ?>">
140 140
 								<?php p($entry['name']) ?>
141 141
 							</a>
142 142
 						</li>
Please login to merge, or discard this patch.
lib/private/legacy/app.php 1 patch
Spacing   +58 added lines, -58 removed lines patch added patch discarded remove patch
@@ -111,9 +111,9 @@  discard block
 block discarded – undo
111 111
 		$apps = self::getEnabledApps();
112 112
 
113 113
 		// Add each apps' folder as allowed class path
114
-		foreach($apps as $app) {
114
+		foreach ($apps as $app) {
115 115
 			$path = self::getAppPath($app);
116
-			if($path !== false) {
116
+			if ($path !== false) {
117 117
 				self::registerAutoloading($app, $path);
118 118
 			}
119 119
 		}
@@ -138,15 +138,15 @@  discard block
 block discarded – undo
138 138
 	public static function loadApp($app) {
139 139
 		self::$loadedApps[] = $app;
140 140
 		$appPath = self::getAppPath($app);
141
-		if($appPath === false) {
141
+		if ($appPath === false) {
142 142
 			return;
143 143
 		}
144 144
 
145 145
 		// in case someone calls loadApp() directly
146 146
 		self::registerAutoloading($app, $appPath);
147 147
 
148
-		if (is_file($appPath . '/appinfo/app.php')) {
149
-			\OC::$server->getEventLogger()->start('load_app_' . $app, 'Load app: ' . $app);
148
+		if (is_file($appPath.'/appinfo/app.php')) {
149
+			\OC::$server->getEventLogger()->start('load_app_'.$app, 'Load app: '.$app);
150 150
 			self::requireAppFile($app);
151 151
 			if (self::isType($app, array('authentication'))) {
152 152
 				// since authentication apps affect the "is app enabled for group" check,
@@ -155,7 +155,7 @@  discard block
 block discarded – undo
155 155
 				// enabled for groups
156 156
 				self::$enabledAppsCache = array();
157 157
 			}
158
-			\OC::$server->getEventLogger()->end('load_app_' . $app);
158
+			\OC::$server->getEventLogger()->end('load_app_'.$app);
159 159
 		}
160 160
 
161 161
 		$info = self::getAppInfo($app);
@@ -182,17 +182,17 @@  discard block
 block discarded – undo
182 182
 	 * @param string $path
183 183
 	 */
184 184
 	public static function registerAutoloading($app, $path) {
185
-		$key = $app . '-' . $path;
186
-		if(isset(self::$alreadyRegistered[$key])) {
185
+		$key = $app.'-'.$path;
186
+		if (isset(self::$alreadyRegistered[$key])) {
187 187
 			return;
188 188
 		}
189 189
 		self::$alreadyRegistered[$key] = true;
190 190
 		// Register on PSR-4 composer autoloader
191 191
 		$appNamespace = \OC\AppFramework\App::buildAppNamespace($app);
192 192
 		\OC::$server->registerNamespace($app, $appNamespace);
193
-		\OC::$composerAutoloader->addPsr4($appNamespace . '\\', $path . '/lib/', true);
193
+		\OC::$composerAutoloader->addPsr4($appNamespace.'\\', $path.'/lib/', true);
194 194
 		if (defined('PHPUNIT_RUN') || defined('CLI_TEST_RUN')) {
195
-			\OC::$composerAutoloader->addPsr4($appNamespace . '\\Tests\\', $path . '/tests/', true);
195
+			\OC::$composerAutoloader->addPsr4($appNamespace.'\\Tests\\', $path.'/tests/', true);
196 196
 		}
197 197
 
198 198
 		// Register on legacy autoloader
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
 	private static function requireAppFile($app) {
208 208
 		try {
209 209
 			// encapsulated here to avoid variable scope conflicts
210
-			require_once $app . '/appinfo/app.php';
210
+			require_once $app.'/appinfo/app.php';
211 211
 		} catch (Error $ex) {
212 212
 			\OC::$server->getLogger()->logException($ex);
213 213
 			$blacklist = \OC::$server->getAppManager()->getAlwaysEnabledApps();
@@ -261,7 +261,7 @@  discard block
 block discarded – undo
261 261
 	 */
262 262
 	public static function setAppTypes($app) {
263 263
 		$appData = self::getAppInfo($app);
264
-		if(!is_array($appData)) {
264
+		if (!is_array($appData)) {
265 265
 			return;
266 266
 		}
267 267
 
@@ -325,8 +325,8 @@  discard block
 block discarded – undo
325 325
 		} else {
326 326
 			$apps = $appManager->getEnabledAppsForUser($user);
327 327
 		}
328
-		$apps = array_filter($apps, function ($app) {
329
-			return $app !== 'files';//we add this manually
328
+		$apps = array_filter($apps, function($app) {
329
+			return $app !== 'files'; //we add this manually
330 330
 		});
331 331
 		sort($apps);
332 332
 		array_unshift($apps, 'files');
@@ -370,7 +370,7 @@  discard block
 block discarded – undo
370 370
 		);
371 371
 		$isDownloaded = $installer->isDownloaded($appId);
372 372
 
373
-		if(!$isDownloaded) {
373
+		if (!$isDownloaded) {
374 374
 			$installer->downloadApp($appId);
375 375
 		}
376 376
 
@@ -408,7 +408,7 @@  discard block
 block discarded – undo
408 408
 		}
409 409
 
410 410
 		$info = self::getAppInfo($appId);
411
-		if(isset($info['settings']) && is_array($info['settings'])) {
411
+		if (isset($info['settings']) && is_array($info['settings'])) {
412 412
 			$appPath = self::getAppPath($appId);
413 413
 			self::registerAutoloading($appId, $appPath);
414 414
 			\OC::$server->getSettingsManager()->setupSettings($info['settings']);
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
 	 */
512 512
 	public static function findAppInDirectories($appId) {
513 513
 		$sanitizedAppId = self::cleanAppId($appId);
514
-		if($sanitizedAppId !== $appId) {
514
+		if ($sanitizedAppId !== $appId) {
515 515
 			return false;
516 516
 		}
517 517
 		static $app_dir = array();
@@ -522,7 +522,7 @@  discard block
 block discarded – undo
522 522
 
523 523
 		$possibleApps = array();
524 524
 		foreach (OC::$APPSROOTS as $dir) {
525
-			if (file_exists($dir['path'] . '/' . $appId)) {
525
+			if (file_exists($dir['path'].'/'.$appId)) {
526 526
 				$possibleApps[] = $dir;
527 527
 			}
528 528
 		}
@@ -563,7 +563,7 @@  discard block
 block discarded – undo
563 563
 		}
564 564
 
565 565
 		if (($dir = self::findAppInDirectories($appId)) != false) {
566
-			return $dir['path'] . '/' . $appId;
566
+			return $dir['path'].'/'.$appId;
567 567
 		}
568 568
 		return false;
569 569
 	}
@@ -577,7 +577,7 @@  discard block
 block discarded – undo
577 577
 	 */
578 578
 	public static function getAppWebPath($appId) {
579 579
 		if (($dir = self::findAppInDirectories($appId)) != false) {
580
-			return OC::$WEBROOT . $dir['url'] . '/' . $appId;
580
+			return OC::$WEBROOT.$dir['url'].'/'.$appId;
581 581
 		}
582 582
 		return false;
583 583
 	}
@@ -590,7 +590,7 @@  discard block
 block discarded – undo
590 590
 	 * @return string
591 591
 	 */
592 592
 	public static function getAppVersion($appId, $useCache = true) {
593
-		if($useCache && isset(self::$appVersion[$appId])) {
593
+		if ($useCache && isset(self::$appVersion[$appId])) {
594 594
 			return self::$appVersion[$appId];
595 595
 		}
596 596
 
@@ -606,7 +606,7 @@  discard block
 block discarded – undo
606 606
 	 * @return string
607 607
 	 */
608 608
 	public static function getAppVersionByPath($path) {
609
-		$infoFile = $path . '/appinfo/info.xml';
609
+		$infoFile = $path.'/appinfo/info.xml';
610 610
 		$appData = self::getAppInfo($infoFile, true);
611 611
 		return isset($appData['version']) ? $appData['version'] : '';
612 612
 	}
@@ -629,10 +629,10 @@  discard block
 block discarded – undo
629 629
 				return self::$appInfo[$appId];
630 630
 			}
631 631
 			$appPath = self::getAppPath($appId);
632
-			if($appPath === false) {
632
+			if ($appPath === false) {
633 633
 				return null;
634 634
 			}
635
-			$file = $appPath . '/appinfo/info.xml';
635
+			$file = $appPath.'/appinfo/info.xml';
636 636
 		}
637 637
 
638 638
 		$parser = new InfoParser(\OC::$server->getMemCacheFactory()->create('core.appinfo'));
@@ -641,9 +641,9 @@  discard block
 block discarded – undo
641 641
 		if (is_array($data)) {
642 642
 			$data = OC_App::parseAppInfo($data, $lang);
643 643
 		}
644
-		if(isset($data['ocsid'])) {
644
+		if (isset($data['ocsid'])) {
645 645
 			$storedId = \OC::$server->getConfig()->getAppValue($appId, 'ocsid');
646
-			if($storedId !== '' && $storedId !== $data['ocsid']) {
646
+			if ($storedId !== '' && $storedId !== $data['ocsid']) {
647 647
 				$data['ocsid'] = $storedId;
648 648
 			}
649 649
 		}
@@ -735,7 +735,7 @@  discard block
 block discarded – undo
735 735
 	 * @param string $page
736 736
 	 */
737 737
 	public static function registerAdmin($app, $page) {
738
-		self::$adminForms[] = $app . '/' . $page . '.php';
738
+		self::$adminForms[] = $app.'/'.$page.'.php';
739 739
 	}
740 740
 
741 741
 	/**
@@ -744,7 +744,7 @@  discard block
 block discarded – undo
744 744
 	 * @param string $page
745 745
 	 */
746 746
 	public static function registerPersonal($app, $page) {
747
-		self::$personalForms[] = $app . '/' . $page . '.php';
747
+		self::$personalForms[] = $app.'/'.$page.'.php';
748 748
 	}
749 749
 
750 750
 	/**
@@ -773,7 +773,7 @@  discard block
 block discarded – undo
773 773
 
774 774
 		foreach (OC::$APPSROOTS as $apps_dir) {
775 775
 			if (!is_readable($apps_dir['path'])) {
776
-				\OCP\Util::writeLog('core', 'unable to read app folder : ' . $apps_dir['path'], \OCP\Util::WARN);
776
+				\OCP\Util::writeLog('core', 'unable to read app folder : '.$apps_dir['path'], \OCP\Util::WARN);
777 777
 				continue;
778 778
 			}
779 779
 			$dh = opendir($apps_dir['path']);
@@ -781,7 +781,7 @@  discard block
 block discarded – undo
781 781
 			if (is_resource($dh)) {
782 782
 				while (($file = readdir($dh)) !== false) {
783 783
 
784
-					if ($file[0] != '.' and is_dir($apps_dir['path'] . '/' . $file) and is_file($apps_dir['path'] . '/' . $file . '/appinfo/info.xml')) {
784
+					if ($file[0] != '.' and is_dir($apps_dir['path'].'/'.$file) and is_file($apps_dir['path'].'/'.$file.'/appinfo/info.xml')) {
785 785
 
786 786
 						$apps[] = $file;
787 787
 					}
@@ -811,12 +811,12 @@  discard block
 block discarded – undo
811 811
 
812 812
 				$info = OC_App::getAppInfo($app, false, $langCode);
813 813
 				if (!is_array($info)) {
814
-					\OCP\Util::writeLog('core', 'Could not read app info file for app "' . $app . '"', \OCP\Util::ERROR);
814
+					\OCP\Util::writeLog('core', 'Could not read app info file for app "'.$app.'"', \OCP\Util::ERROR);
815 815
 					continue;
816 816
 				}
817 817
 
818 818
 				if (!isset($info['name'])) {
819
-					\OCP\Util::writeLog('core', 'App id "' . $app . '" has no name in appinfo', \OCP\Util::ERROR);
819
+					\OCP\Util::writeLog('core', 'App id "'.$app.'" has no name in appinfo', \OCP\Util::ERROR);
820 820
 					continue;
821 821
 				}
822 822
 
@@ -843,13 +843,13 @@  discard block
 block discarded – undo
843 843
 				}
844 844
 
845 845
 				$appPath = self::getAppPath($app);
846
-				if($appPath !== false) {
847
-					$appIcon = $appPath . '/img/' . $app . '.svg';
846
+				if ($appPath !== false) {
847
+					$appIcon = $appPath.'/img/'.$app.'.svg';
848 848
 					if (file_exists($appIcon)) {
849
-						$info['preview'] = \OC::$server->getURLGenerator()->imagePath($app, $app . '.svg');
849
+						$info['preview'] = \OC::$server->getURLGenerator()->imagePath($app, $app.'.svg');
850 850
 						$info['previewAsIcon'] = true;
851 851
 					} else {
852
-						$appIcon = $appPath . '/img/app.svg';
852
+						$appIcon = $appPath.'/img/app.svg';
853 853
 						if (file_exists($appIcon)) {
854 854
 							$info['preview'] = \OC::$server->getURLGenerator()->imagePath($app, 'app.svg');
855 855
 							$info['previewAsIcon'] = true;
@@ -883,9 +883,9 @@  discard block
 block discarded – undo
883 883
 	 * @return string|false
884 884
 	 */
885 885
 	public static function getInternalAppIdByOcs($ocsID) {
886
-		if(is_numeric($ocsID)) {
886
+		if (is_numeric($ocsID)) {
887 887
 			$idArray = \OC::$server->getAppConfig()->getValues(false, 'ocsid');
888
-			if(array_search($ocsID, $idArray)) {
888
+			if (array_search($ocsID, $idArray)) {
889 889
 				return array_search($ocsID, $idArray);
890 890
 			}
891 891
 		}
@@ -989,7 +989,7 @@  discard block
 block discarded – undo
989 989
 	public static function getAppVersions() {
990 990
 		static $versions;
991 991
 
992
-		if(!$versions) {
992
+		if (!$versions) {
993 993
 			$appConfig = \OC::$server->getAppConfig();
994 994
 			$versions = $appConfig->getValues(false, 'installed_version');
995 995
 		}
@@ -1011,7 +1011,7 @@  discard block
 block discarded – undo
1011 1011
 		if ($app !== false) {
1012 1012
 			// check if the app is compatible with this version of ownCloud
1013 1013
 			$info = self::getAppInfo($app);
1014
-			if(!is_array($info)) {
1014
+			if (!is_array($info)) {
1015 1015
 				throw new \Exception(
1016 1016
 					$l->t('App "%s" cannot be installed because appinfo file cannot be read.',
1017 1017
 						[$info['name']]
@@ -1036,7 +1036,7 @@  discard block
 block discarded – undo
1036 1036
 				$config->setAppValue($app, 'ocsid', $appData['id']);
1037 1037
 			}
1038 1038
 
1039
-			if(isset($info['settings']) && is_array($info['settings'])) {
1039
+			if (isset($info['settings']) && is_array($info['settings'])) {
1040 1040
 				$appPath = self::getAppPath($app);
1041 1041
 				self::registerAutoloading($app, $appPath);
1042 1042
 				\OC::$server->getSettingsManager()->setupSettings($info['settings']);
@@ -1044,7 +1044,7 @@  discard block
 block discarded – undo
1044 1044
 
1045 1045
 			\OC_Hook::emit('OC_App', 'post_enable', array('app' => $app));
1046 1046
 		} else {
1047
-			if(empty($appName) ) {
1047
+			if (empty($appName)) {
1048 1048
 				throw new \Exception($l->t("No app name specified"));
1049 1049
 			} else {
1050 1050
 				throw new \Exception($l->t("App '%s' could not be installed!", $appName));
@@ -1062,24 +1062,24 @@  discard block
 block discarded – undo
1062 1062
 	 */
1063 1063
 	public static function updateApp($appId) {
1064 1064
 		$appPath = self::getAppPath($appId);
1065
-		if($appPath === false) {
1065
+		if ($appPath === false) {
1066 1066
 			return false;
1067 1067
 		}
1068 1068
 		$appData = self::getAppInfo($appId);
1069 1069
 		self::executeRepairSteps($appId, $appData['repair-steps']['pre-migration']);
1070
-		if (file_exists($appPath . '/appinfo/database.xml')) {
1071
-			OC_DB::updateDbFromStructure($appPath . '/appinfo/database.xml');
1070
+		if (file_exists($appPath.'/appinfo/database.xml')) {
1071
+			OC_DB::updateDbFromStructure($appPath.'/appinfo/database.xml');
1072 1072
 		}
1073 1073
 		self::executeRepairSteps($appId, $appData['repair-steps']['post-migration']);
1074 1074
 		self::setupLiveMigrations($appId, $appData['repair-steps']['live-migration']);
1075 1075
 		unset(self::$appVersion[$appId]);
1076 1076
 		// run upgrade code
1077
-		if (file_exists($appPath . '/appinfo/update.php')) {
1077
+		if (file_exists($appPath.'/appinfo/update.php')) {
1078 1078
 			self::loadApp($appId);
1079
-			include $appPath . '/appinfo/update.php';
1079
+			include $appPath.'/appinfo/update.php';
1080 1080
 		}
1081 1081
 		self::setupBackgroundJobs($appData['background-jobs']);
1082
-		if(isset($appData['settings']) && is_array($appData['settings'])) {
1082
+		if (isset($appData['settings']) && is_array($appData['settings'])) {
1083 1083
 			$appPath = self::getAppPath($appId);
1084 1084
 			self::registerAutoloading($appId, $appPath);
1085 1085
 			\OC::$server->getSettingsManager()->setupSettings($appData['settings']);
@@ -1088,14 +1088,14 @@  discard block
 block discarded – undo
1088 1088
 		//set remote/public handlers
1089 1089
 		if (array_key_exists('ocsid', $appData)) {
1090 1090
 			\OC::$server->getConfig()->setAppValue($appId, 'ocsid', $appData['ocsid']);
1091
-		} elseif(\OC::$server->getConfig()->getAppValue($appId, 'ocsid', null) !== null) {
1091
+		} elseif (\OC::$server->getConfig()->getAppValue($appId, 'ocsid', null) !== null) {
1092 1092
 			\OC::$server->getConfig()->deleteAppValue($appId, 'ocsid');
1093 1093
 		}
1094 1094
 		foreach ($appData['remote'] as $name => $path) {
1095
-			\OC::$server->getConfig()->setAppValue('core', 'remote_' . $name, $appId . '/' . $path);
1095
+			\OC::$server->getConfig()->setAppValue('core', 'remote_'.$name, $appId.'/'.$path);
1096 1096
 		}
1097 1097
 		foreach ($appData['public'] as $name => $path) {
1098
-			\OC::$server->getConfig()->setAppValue('core', 'public_' . $name, $appId . '/' . $path);
1098
+			\OC::$server->getConfig()->setAppValue('core', 'public_'.$name, $appId.'/'.$path);
1099 1099
 		}
1100 1100
 
1101 1101
 		self::setAppTypes($appId);
@@ -1165,17 +1165,17 @@  discard block
 block discarded – undo
1165 1165
 	public static function getStorage($appId) {
1166 1166
 		if (OC_App::isEnabled($appId)) { //sanity check
1167 1167
 			if (\OC::$server->getUserSession()->isLoggedIn()) {
1168
-				$view = new \OC\Files\View('/' . OC_User::getUser());
1168
+				$view = new \OC\Files\View('/'.OC_User::getUser());
1169 1169
 				if (!$view->file_exists($appId)) {
1170 1170
 					$view->mkdir($appId);
1171 1171
 				}
1172
-				return new \OC\Files\View('/' . OC_User::getUser() . '/' . $appId);
1172
+				return new \OC\Files\View('/'.OC_User::getUser().'/'.$appId);
1173 1173
 			} else {
1174
-				\OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ', user not logged in', \OCP\Util::ERROR);
1174
+				\OCP\Util::writeLog('core', 'Can\'t get app storage, app '.$appId.', user not logged in', \OCP\Util::ERROR);
1175 1175
 				return false;
1176 1176
 			}
1177 1177
 		} else {
1178
-			\OCP\Util::writeLog('core', 'Can\'t get app storage, app ' . $appId . ' not enabled', \OCP\Util::ERROR);
1178
+			\OCP\Util::writeLog('core', 'Can\'t get app storage, app '.$appId.' not enabled', \OCP\Util::ERROR);
1179 1179
 			return false;
1180 1180
 		}
1181 1181
 	}
@@ -1207,9 +1207,9 @@  discard block
 block discarded – undo
1207 1207
 
1208 1208
 				if ($attributeLang === $similarLang) {
1209 1209
 					$similarLangFallback = $option['@value'];
1210
-				} else if (strpos($attributeLang, $similarLang . '_') === 0) {
1210
+				} else if (strpos($attributeLang, $similarLang.'_') === 0) {
1211 1211
 					if ($similarLangFallback === false) {
1212
-						$similarLangFallback =  $option['@value'];
1212
+						$similarLangFallback = $option['@value'];
1213 1213
 					}
1214 1214
 				}
1215 1215
 			} else {
@@ -1244,7 +1244,7 @@  discard block
 block discarded – undo
1244 1244
 			$data['description'] = trim(self::findBestL10NOption($data['description'], $lang));
1245 1245
 		} else if (isset($data['description']) && is_string($data['description'])) {
1246 1246
 			$data['description'] = trim($data['description']);
1247
-		} else  {
1247
+		} else {
1248 1248
 			$data['description'] = '';
1249 1249
 		}
1250 1250
 
Please login to merge, or discard this patch.
lib/private/TemplateLayout.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -53,43 +53,43 @@  discard block
 block discarded – undo
53 53
 	 * @param string $renderAs
54 54
 	 * @param string $appId application id
55 55
 	 */
56
-	public function __construct( $renderAs, $appId = '' ) {
56
+	public function __construct($renderAs, $appId = '') {
57 57
 
58 58
 		// yes - should be injected ....
59 59
 		$this->config = \OC::$server->getConfig();
60 60
 
61 61
 		// Decide which page we show
62
-		if($renderAs == 'user') {
63
-			parent::__construct( 'core', 'layout.user' );
64
-			if(in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) {
62
+		if ($renderAs == 'user') {
63
+			parent::__construct('core', 'layout.user');
64
+			if (in_array(\OC_App::getCurrentApp(), ['settings', 'admin', 'help']) !== false) {
65 65
 				$this->assign('bodyid', 'body-settings');
66
-			}else{
66
+			} else {
67 67
 				$this->assign('bodyid', 'body-user');
68 68
 			}
69 69
 
70 70
 			// Code integrity notification
71 71
 			$integrityChecker = \OC::$server->getIntegrityCodeChecker();
72
-			if(\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) {
72
+			if (\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) {
73 73
 				\OCP\Util::addScript('core', 'integritycheck-failed-notification');
74 74
 			}
75 75
 
76 76
 			// Add navigation entry
77
-			$this->assign( 'application', '');
78
-			$this->assign( 'appid', $appId );
77
+			$this->assign('application', '');
78
+			$this->assign('appid', $appId);
79 79
 			$navigation = \OC_App::getNavigation();
80
-			$this->assign( 'navigation', $navigation);
80
+			$this->assign('navigation', $navigation);
81 81
 			$settingsNavigation = \OC_App::getSettingsNavigation();
82
-			$this->assign( 'settingsnavigation', $settingsNavigation);
83
-			foreach($navigation as $entry) {
82
+			$this->assign('settingsnavigation', $settingsNavigation);
83
+			foreach ($navigation as $entry) {
84 84
 				if ($entry['active']) {
85
-					$this->assign( 'application', $entry['name'] );
85
+					$this->assign('application', $entry['name']);
86 86
 					break;
87 87
 				}
88 88
 			}
89 89
 			
90
-			foreach($settingsNavigation as $entry) {
90
+			foreach ($settingsNavigation as $entry) {
91 91
 				if ($entry['active']) {
92
-					$this->assign( 'application', $entry['name'] );
92
+					$this->assign('application', $entry['name']);
93 93
 					break;
94 94
 				}
95 95
 			}
@@ -117,7 +117,7 @@  discard block
 block discarded – undo
117 117
 		// Send the language to our layouts
118 118
 		$this->assign('language', \OC::$server->getL10NFactory()->findLanguage());
119 119
 
120
-		if(\OC::$server->getSystemConfig()->getValue('installed', false)) {
120
+		if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
121 121
 			if (empty(self::$versionHash)) {
122 122
 				$v = \OC_App::getAppVersions();
123 123
 				$v['core'] = implode('.', \OCP\Util::getVersion());
@@ -148,10 +148,10 @@  discard block
 block discarded – undo
148 148
 				$this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('core.OCJS.getConfig', ['v' => self::$versionHash]));
149 149
 			}
150 150
 		}
151
-		foreach($jsFiles as $info) {
151
+		foreach ($jsFiles as $info) {
152 152
 			$web = $info[1];
153 153
 			$file = $info[2];
154
-			$this->append( 'jsfiles', $web.'/'.$file . $this->getVersionHashSuffix() );
154
+			$this->append('jsfiles', $web.'/'.$file.$this->getVersionHashSuffix());
155 155
 		}
156 156
 
157 157
 		try {
@@ -162,7 +162,7 @@  discard block
 block discarded – undo
162 162
 
163 163
 		// Do not initialise scss appdata until we have a fully installed instance
164 164
 		// Do not load scss for update, errors, installation or login page
165
-		if(\OC::$server->getSystemConfig()->getValue('installed', false)
165
+		if (\OC::$server->getSystemConfig()->getValue('installed', false)
166 166
 			&& !\OCP\Util::needUpgrade()
167 167
 			&& $pathInfo !== ''
168 168
 			&& !preg_match('/^\/login/', $pathInfo)) {
@@ -177,25 +177,25 @@  discard block
 block discarded – undo
177 177
 		$this->assign('cssfiles', array());
178 178
 		$this->assign('printcssfiles', []);
179 179
 		$this->assign('versionHash', self::$versionHash);
180
-		foreach($cssFiles as $info) {
180
+		foreach ($cssFiles as $info) {
181 181
 			$web = $info[1];
182 182
 			$file = $info[2];
183 183
 
184 184
 			if (substr($file, -strlen('print.css')) === 'print.css') {
185
-				$this->append( 'printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix() );
185
+				$this->append('printcssfiles', $web.'/'.$file.$this->getVersionHashSuffix());
186 186
 			} else {
187
-				$this->append( 'cssfiles', $web.'/'.$file . $this->getVersionHashSuffix()  );
187
+				$this->append('cssfiles', $web.'/'.$file.$this->getVersionHashSuffix());
188 188
 			}
189 189
 		}
190 190
 	}
191 191
 
192 192
 	protected function getVersionHashSuffix() {
193
-		if(\OC::$server->getConfig()->getSystemValue('debug', false)) {
193
+		if (\OC::$server->getConfig()->getSystemValue('debug', false)) {
194 194
 			// allows chrome workspace mapping in debug mode
195 195
 			return "";
196 196
 		}
197 197
 
198
-		return '?v=' . self::$versionHash;
198
+		return '?v='.self::$versionHash;
199 199
 	}
200 200
 
201 201
 	/**
@@ -206,7 +206,7 @@  discard block
 block discarded – undo
206 206
 		// Read the selected theme from the config file
207 207
 		$theme = \OC_Util::getTheme();
208 208
 
209
-		if($compileScss) {
209
+		if ($compileScss) {
210 210
 			/** @var \OC\Memcache\Factory $cache */
211 211
 			$cache = \OC::$server->query('MemCacheFactory');
212 212
 			$SCSSCacher = new SCSSCacher(
@@ -224,8 +224,8 @@  discard block
 block discarded – undo
224 224
 		$locator = new \OC\Template\CSSResourceLocator(
225 225
 			\OC::$server->getLogger(),
226 226
 			$theme,
227
-			array( \OC::$SERVERROOT => \OC::$WEBROOT ),
228
-			array( \OC::$SERVERROOT => \OC::$WEBROOT ),
227
+			array(\OC::$SERVERROOT => \OC::$WEBROOT),
228
+			array(\OC::$SERVERROOT => \OC::$WEBROOT),
229 229
 			$SCSSCacher);
230 230
 		$locator->find($styles);
231 231
 		return $locator->getResources();
@@ -242,8 +242,8 @@  discard block
 block discarded – undo
242 242
 		$locator = new \OC\Template\JSResourceLocator(
243 243
 			\OC::$server->getLogger(),
244 244
 			$theme,
245
-			array( \OC::$SERVERROOT => \OC::$WEBROOT ),
246
-			array( \OC::$SERVERROOT => \OC::$WEBROOT ),
245
+			array(\OC::$SERVERROOT => \OC::$WEBROOT),
246
+			array(\OC::$SERVERROOT => \OC::$WEBROOT),
247 247
 			new JSCombiner(
248 248
 				\OC::$server->getAppDataDir('js'),
249 249
 				\OC::$server->getURLGenerator(),
@@ -263,7 +263,7 @@  discard block
 block discarded – undo
263 263
 	 */
264 264
 	public static function convertToRelativePath($filePath) {
265 265
 		$relativePath = explode(\OC::$SERVERROOT, $filePath);
266
-		if(count($relativePath) !== 2) {
266
+		if (count($relativePath) !== 2) {
267 267
 			throw new \Exception('$filePath is not under the \OC::$SERVERROOT');
268 268
 		}
269 269
 
Please login to merge, or discard this patch.