Completed
Push — master ( 2219d3...162b16 )
by Morris
69:30 queued 46:16
created
core/templates/layout.public.php 1 patch
Spacing   +9 added lines, -9 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 */ ?>">
@@ -25,7 +25,7 @@  discard block
 block discarded – undo
25 25
 	<?php emit_script_loading_tags($_); ?>
26 26
 	<?php print_unescaped($_['headers']); ?>
27 27
 </head>
28
-<body id="<?php p($_['bodyid']);?>">
28
+<body id="<?php p($_['bodyid']); ?>">
29 29
 <?php include('layout.noscript.warning.php'); ?>
30 30
 	<div id="notification-container">
31 31
 		<div id="notification"></div>
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
 			<span id="nextcloud">
36 36
 				<div class="logo logo-icon svg"></div>
37 37
 				<h1 class="header-appname">
38
-					<?php if (isset($template)) { p($template->getHeaderTitle()); } else { p($theme->getName());} ?>
38
+					<?php if (isset($template)) { p($template->getHeaderTitle()); } else { p($theme->getName()); } ?>
39 39
 				</h1>
40 40
 				<div class="header-shared-by">
41 41
 					<?php if (isset($template)) { p($template->getHeaderDetails()); } ?>
@@ -45,24 +45,24 @@  discard block
 block discarded – undo
45 45
 
46 46
 		<?php
47 47
 		/** @var \OCP\AppFramework\Http\Template\PublicTemplateResponse $template */
48
-		if(isset($template) && $template->getActionCount() !== 0) {
48
+		if (isset($template) && $template->getActionCount() !== 0) {
49 49
 			$primary = $template->getPrimaryAction();
50 50
 			$others = $template->getOtherActions();
51 51
 			?>
52 52
 		<div class="header-right">
53
-			<span id="header-primary-action" class="<?php if($template->getActionCount() === 1) {  p($primary->getIcon()); } ?>">
53
+			<span id="header-primary-action" class="<?php if ($template->getActionCount() === 1) {  p($primary->getIcon()); } ?>">
54 54
 				<a href="<?php p($primary->getLink()); ?>">
55 55
 					<span><?php p($primary->getLabel()) ?></span>
56 56
 				</a>
57 57
 			</span>
58
-			<?php if($template->getActionCount()>1) { ?>
58
+			<?php if ($template->getActionCount() > 1) { ?>
59 59
 			<div id="header-secondary-action">
60 60
 				<span id="header-actions-toggle" class="menutoggle icon-more-white"></span>
61 61
 				<div id="header-actions-menu" class="popovermenu menu">
62 62
 					<ul>
63 63
 						<?php
64 64
 							/** @var \OCP\AppFramework\Http\Template\IMenuAction $action */
65
-							foreach($template->getOtherActions() as $action) {
65
+							foreach ($template->getOtherActions() as $action) {
66 66
 								print_unescaped($action->render());
67 67
 							}
68 68
 						?>
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	<div id="content" class="app-<?php p($_['appid']) ?>" role="main">
77 77
 		<?php print_unescaped($_['content']); ?>
78 78
 	</div>
79
-	<?php if(isset($template) && $template->getFooterVisible()) { ?>
79
+	<?php if (isset($template) && $template->getFooterVisible()) { ?>
80 80
 	<footer>
81 81
 		<p><?php print_unescaped($theme->getLongFooter()); ?></p>
82 82
 		<?php
Please login to merge, or discard this patch.
lib/private/TemplateLayout.php 1 patch
Spacing   +35 added lines, -35 removed lines patch added patch discarded remove patch
@@ -57,47 +57,47 @@  discard block
 block discarded – undo
57 57
 	 * @param string $renderAs
58 58
 	 * @param string $appId application id
59 59
 	 */
60
-	public function __construct( $renderAs, $appId = '' ) {
60
+	public function __construct($renderAs, $appId = '') {
61 61
 
62 62
 		// yes - should be injected ....
63 63
 		$this->config = \OC::$server->getConfig();
64 64
 
65
-		if(\OCP\Util::isIE()) {
65
+		if (\OCP\Util::isIE()) {
66 66
 			\OC_Util::addStyle('ie');
67 67
 		}
68 68
 
69 69
 		// Decide which page we show
70
-		if($renderAs == 'user') {
71
-			parent::__construct( 'core', 'layout.user' );
72
-			if(in_array(\OC_App::getCurrentApp(), ['settings','admin', 'help']) !== false) {
70
+		if ($renderAs == 'user') {
71
+			parent::__construct('core', 'layout.user');
72
+			if (in_array(\OC_App::getCurrentApp(), ['settings', 'admin', 'help']) !== false) {
73 73
 				$this->assign('bodyid', 'body-settings');
74
-			}else{
74
+			} else {
75 75
 				$this->assign('bodyid', 'body-user');
76 76
 			}
77 77
 
78 78
 			// Code integrity notification
79 79
 			$integrityChecker = \OC::$server->getIntegrityCodeChecker();
80
-			if(\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) {
80
+			if (\OC_User::isAdminUser(\OC_User::getUser()) && $integrityChecker->isCodeCheckEnforced() && !$integrityChecker->hasPassedCheck()) {
81 81
 				\OCP\Util::addScript('core', 'integritycheck-failed-notification');
82 82
 			}
83 83
 
84 84
 			// Add navigation entry
85
-			$this->assign( 'application', '');
86
-			$this->assign( 'appid', $appId );
85
+			$this->assign('application', '');
86
+			$this->assign('appid', $appId);
87 87
 			$navigation = \OC::$server->getNavigationManager()->getAll();
88
-			$this->assign( 'navigation', $navigation);
88
+			$this->assign('navigation', $navigation);
89 89
 			$settingsNavigation = \OC::$server->getNavigationManager()->getAll('settings');
90
-			$this->assign( 'settingsnavigation', $settingsNavigation);
91
-			foreach($navigation as $entry) {
90
+			$this->assign('settingsnavigation', $settingsNavigation);
91
+			foreach ($navigation as $entry) {
92 92
 				if ($entry['active']) {
93
-					$this->assign( 'application', $entry['name'] );
93
+					$this->assign('application', $entry['name']);
94 94
 					break;
95 95
 				}
96 96
 			}
97 97
 
98
-			foreach($settingsNavigation as $entry) {
98
+			foreach ($settingsNavigation as $entry) {
99 99
 				if ($entry['active']) {
100
-					$this->assign( 'application', $entry['name'] );
100
+					$this->assign('application', $entry['name']);
101 101
 					break;
102 102
 				}
103 103
 			}
@@ -130,7 +130,7 @@  discard block
 block discarded – undo
130 130
 			$this->assign('bodyid', 'body-login');
131 131
 		} else if ($renderAs == 'public') {
132 132
 			parent::__construct('core', 'layout.public');
133
-			$this->assign( 'appid', $appId );
133
+			$this->assign('appid', $appId);
134 134
 			$this->assign('bodyid', 'body-public');
135 135
 			$this->assign('showSimpleSignUpLink', $this->config->getSystemValue('simpleSignUpLink.shown', true) !== false);
136 136
 		} else {
@@ -143,7 +143,7 @@  discard block
 block discarded – undo
143 143
 		$this->assign('language', $lang);
144 144
 		$this->assign('locale', \OC::$server->getL10NFactory()->findLocale($lang));
145 145
 
146
-		if(\OC::$server->getSystemConfig()->getValue('installed', false)) {
146
+		if (\OC::$server->getSystemConfig()->getValue('installed', false)) {
147 147
 			if (empty(self::$versionHash)) {
148 148
 				$v = \OC_App::getAppVersions();
149 149
 				$v['core'] = implode('.', \OCP\Util::getVersion());
@@ -175,10 +175,10 @@  discard block
 block discarded – undo
175 175
 				$this->append('jsfiles', \OC::$server->getURLGenerator()->linkToRoute('core.OCJS.getConfig', ['v' => self::$versionHash]));
176 176
 			}
177 177
 		}
178
-		foreach($jsFiles as $info) {
178
+		foreach ($jsFiles as $info) {
179 179
 			$web = $info[1];
180 180
 			$file = $info[2];
181
-			$this->append( 'jsfiles', $web.'/'.$file . $this->getVersionHashSuffix() );
181
+			$this->append('jsfiles', $web.'/'.$file.$this->getVersionHashSuffix());
182 182
 		}
183 183
 
184 184
 		try {
@@ -189,7 +189,7 @@  discard block
 block discarded – undo
189 189
 
190 190
 		// Do not initialise scss appdata until we have a fully installed instance
191 191
 		// Do not load scss for update, errors, installation or login page
192
-		if(\OC::$server->getSystemConfig()->getValue('installed', false)
192
+		if (\OC::$server->getSystemConfig()->getValue('installed', false)
193 193
 			&& !\OCP\Util::needUpgrade()
194 194
 			&& $pathInfo !== ''
195 195
 			&& !preg_match('/^\/login/', $pathInfo)
@@ -206,14 +206,14 @@  discard block
 block discarded – undo
206 206
 		$this->assign('cssfiles', array());
207 207
 		$this->assign('printcssfiles', []);
208 208
 		$this->assign('versionHash', self::$versionHash);
209
-		foreach($cssFiles as $info) {
209
+		foreach ($cssFiles as $info) {
210 210
 			$web = $info[1];
211 211
 			$file = $info[2];
212 212
 
213 213
 			if (substr($file, -strlen('print.css')) === 'print.css') {
214
-				$this->append( 'printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix() );
214
+				$this->append('printcssfiles', $web.'/'.$file.$this->getVersionHashSuffix());
215 215
 			} else {
216
-				$this->append( 'cssfiles', $web.'/'.$file . $this->getVersionHashSuffix($web, $file)  );
216
+				$this->append('cssfiles', $web.'/'.$file.$this->getVersionHashSuffix($web, $file));
217 217
 			}
218 218
 		}
219 219
 	}
@@ -233,7 +233,7 @@  discard block
 block discarded – undo
233 233
 
234 234
 		if ($this->config->getSystemValue('installed', false)) {
235 235
 			if (\OC::$server->getAppManager()->isInstalled('theming')) {
236
-				$themingSuffix = '-' . $this->config->getAppValue('theming', 'cachebuster', '0');
236
+				$themingSuffix = '-'.$this->config->getAppValue('theming', 'cachebuster', '0');
237 237
 			}
238 238
 			$v = \OC_App::getAppVersions();
239 239
 		}
@@ -241,21 +241,21 @@  discard block
 block discarded – undo
241 241
 		// Try the webroot path for a match
242 242
 		if ($path !== false && $path !== '') {
243 243
 			$appName = $this->getAppNamefromPath($path);
244
-			if(array_key_exists($appName, $v)) {
244
+			if (array_key_exists($appName, $v)) {
245 245
 				$appVersion = $v[$appName];
246
-				return '?v=' . substr(md5($appVersion), 0, 8) . $themingSuffix;
246
+				return '?v='.substr(md5($appVersion), 0, 8).$themingSuffix;
247 247
 			}
248 248
 		}
249 249
 		// fallback to the file path instead
250 250
 		if ($file !== false && $file !== '') {
251 251
 			$appName = $this->getAppNamefromPath($file);
252
-			if(array_key_exists($appName, $v)) {
252
+			if (array_key_exists($appName, $v)) {
253 253
 				$appVersion = $v[$appName];
254
-				return '?v=' . substr(md5($appVersion), 0, 8) . $themingSuffix;
254
+				return '?v='.substr(md5($appVersion), 0, 8).$themingSuffix;
255 255
 			}
256 256
 		}
257 257
 
258
-		return '?v=' . self::$versionHash . $themingSuffix;
258
+		return '?v='.self::$versionHash.$themingSuffix;
259 259
 	}
260 260
 
261 261
 	/**
@@ -266,7 +266,7 @@  discard block
 block discarded – undo
266 266
 		// Read the selected theme from the config file
267 267
 		$theme = \OC_Util::getTheme();
268 268
 
269
-		if($compileScss) {
269
+		if ($compileScss) {
270 270
 			$SCSSCacher = \OC::$server->query(SCSSCacher::class);
271 271
 		} else {
272 272
 			$SCSSCacher = null;
@@ -275,8 +275,8 @@  discard block
 block discarded – undo
275 275
 		$locator = new \OC\Template\CSSResourceLocator(
276 276
 			\OC::$server->getLogger(),
277 277
 			$theme,
278
-			array( \OC::$SERVERROOT => \OC::$WEBROOT ),
279
-			array( \OC::$SERVERROOT => \OC::$WEBROOT ),
278
+			array(\OC::$SERVERROOT => \OC::$WEBROOT),
279
+			array(\OC::$SERVERROOT => \OC::$WEBROOT),
280 280
 			$SCSSCacher
281 281
 		);
282 282
 		$locator->find($styles);
@@ -311,8 +311,8 @@  discard block
 block discarded – undo
311 311
 		$locator = new \OC\Template\JSResourceLocator(
312 312
 			\OC::$server->getLogger(),
313 313
 			$theme,
314
-			array( \OC::$SERVERROOT => \OC::$WEBROOT ),
315
-			array( \OC::$SERVERROOT => \OC::$WEBROOT ),
314
+			array(\OC::$SERVERROOT => \OC::$WEBROOT),
315
+			array(\OC::$SERVERROOT => \OC::$WEBROOT),
316 316
 			\OC::$server->query(JSCombiner::class)
317 317
 			);
318 318
 		$locator->find($scripts);
@@ -327,7 +327,7 @@  discard block
 block discarded – undo
327 327
 	 */
328 328
 	public static function convertToRelativePath($filePath) {
329 329
 		$relativePath = explode(\OC::$SERVERROOT, $filePath);
330
-		if(count($relativePath) !== 2) {
330
+		if (count($relativePath) !== 2) {
331 331
 			throw new \Exception('$filePath is not under the \OC::$SERVERROOT');
332 332
 		}
333 333
 
Please login to merge, or discard this patch.