Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 15:19:56 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-04-10 15:19:56 +0300
commitcaff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch)
tree186d494c2aea5dea7255d3584ef5d595fc6e6194 /core/templates
parentedf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff)
Format control structures, classes, methods and function
To continue this formatting madness, here's a tiny patch that adds unified formatting for control structures like if and loops as well as classes, their methods and anonymous functions. This basically forces the constructs to start on the same line. This is not exactly what PSR2 wants, but I think we can have a few exceptions with "our" style. The starting of braces on the same line is pracrically standard for our code. This also removes and empty lines from method/function bodies at the beginning and end. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'core/templates')
-rw-r--r--core/templates/403.php6
-rw-r--r--core/templates/404.php2
-rw-r--r--core/templates/error.php4
-rw-r--r--core/templates/exception.php4
-rw-r--r--core/templates/installation.php31
-rw-r--r--core/templates/layout.guest.php2
-rw-r--r--core/templates/layout.public.php28
-rw-r--r--core/templates/layout.user.php14
-rw-r--r--core/templates/login.php2
-rw-r--r--core/templates/loginflow/authpicker.php2
-rw-r--r--core/templates/twofactorselectchallenge.php2
-rw-r--r--core/templates/twofactorshowchallenge.php2
-rw-r--r--core/templates/update.use-cli.php8
13 files changed, 62 insertions, 45 deletions
diff --git a/core/templates/403.php b/core/templates/403.php
index d56a63bfe53..1ee3569ed03 100644
--- a/core/templates/403.php
+++ b/core/templates/403.php
@@ -1,6 +1,6 @@
<?php
// @codeCoverageIgnoreStart
-if(!isset($_)) {//standalone page is not supported anymore - redirect to /
+if (!isset($_)) {//standalone page is not supported anymore - redirect to /
require_once '../../lib/base.php';
$urlGenerator = \OC::$server->getURLGenerator();
@@ -12,6 +12,8 @@ if(!isset($_)) {//standalone page is not supported anymore - redirect to /
<ul>
<li class='error'>
<?php p($l->t('Access forbidden')); ?><br>
- <p class='hint'><?php if(isset($_['message'])) p($_['message'])?></p>
+ <p class='hint'><?php if (isset($_['message'])) {
+ p($_['message']);
+}?></p>
</li>
</ul>
diff --git a/core/templates/404.php b/core/templates/404.php
index 925059d4750..85ddb4c4b17 100644
--- a/core/templates/404.php
+++ b/core/templates/404.php
@@ -3,7 +3,7 @@
/** @var $l \OCP\IL10N */
/** @var $theme OCP\Defaults */
// @codeCoverageIgnoreStart
-if(!isset($_)) {//standalone page is not supported anymore - redirect to /
+if (!isset($_)) {//standalone page is not supported anymore - redirect to /
require_once '../../lib/base.php';
$urlGenerator = \OC::$server->getURLGenerator();
diff --git a/core/templates/error.php b/core/templates/error.php
index 929e8dd3984..c6f7706edc1 100644
--- a/core/templates/error.php
+++ b/core/templates/error.php
@@ -1,10 +1,10 @@
<div class="error">
<h2><?php p($l->t('Error')) ?></h2>
<ul>
- <?php foreach($_["errors"] as $error):?>
+ <?php foreach ($_["errors"] as $error):?>
<li>
<p><?php p($error['error']) ?></p>
- <?php if(isset($error['hint']) && $error['hint']): ?>
+ <?php if (isset($error['hint']) && $error['hint']): ?>
<p class='hint'><?php p($error['hint']) ?></p>
<?php endif;?>
</li>
diff --git a/core/templates/exception.php b/core/templates/exception.php
index fcfa8687710..a2b019b3289 100644
--- a/core/templates/exception.php
+++ b/core/templates/exception.php
@@ -14,7 +14,7 @@ style('core', ['styles', 'header']);
<ul>
<li><?php p($l->t('Remote Address: %s', [$_['remoteAddr']])) ?></li>
<li><?php p($l->t('Request ID: %s', [$_['requestID']])) ?></li>
- <?php if($_['debugMode']): ?>
+ <?php if ($_['debugMode']): ?>
<li><?php p($l->t('Type: %s', [$_['errorClass']])) ?></li>
<li><?php p($l->t('Code: %s', [$_['errorCode']])) ?></li>
<li><?php p($l->t('Message: %s', [$_['errorMsg']])) ?></li>
@@ -23,7 +23,7 @@ style('core', ['styles', 'header']);
<?php endif; ?>
</ul>
- <?php if($_['debugMode']): ?>
+ <?php if ($_['debugMode']): ?>
<br />
<h3><?php p($l->t('Trace')) ?></h3>
<pre><?php p($_['trace']) ?></pre>
diff --git a/core/templates/installation.php b/core/templates/installation.php
index d65d0adb1cb..a7808a0103c 100644
--- a/core/templates/installation.php
+++ b/core/templates/installation.php
@@ -9,12 +9,12 @@ script('core', [
<input type='hidden' id='hasOracle' value='<?php p($_['hasOracle']) ?>'>
<form action="index.php" method="post">
<input type="hidden" name="install" value="true">
- <?php if(count($_['errors']) > 0): ?>
+ <?php if (count($_['errors']) > 0): ?>
<fieldset class="warning">
<legend><strong><?php p($l->t('Error'));?></strong></legend>
- <?php foreach($_['errors'] as $err): ?>
+ <?php foreach ($_['errors'] as $err): ?>
<p>
- <?php if(is_array($err)):?>
+ <?php if (is_array($err)):?>
<?php p($err['error']); ?>
<span class='hint'><?php p($err['hint']); ?></span>
<?php else: ?>
@@ -24,7 +24,7 @@ script('core', [
<?php endforeach; ?>
</fieldset>
<?php endif; ?>
- <?php if(!$_['htaccessWorking']): ?>
+ <?php if (!$_['htaccessWorking']): ?>
<fieldset class="warning">
<legend><strong><?php p($l->t('Security warning'));?></strong></legend>
<p><?php p($l->t('Your data directory and files are probably accessible from the internet because the .htaccess file does not work.'));?><br>
@@ -54,13 +54,13 @@ script('core', [
</p>
</fieldset>
- <?php if(!$_['directoryIsSet'] or !$_['dbIsSet'] or count($_['errors']) > 0): ?>
+ <?php if (!$_['directoryIsSet'] or !$_['dbIsSet'] or count($_['errors']) > 0): ?>
<fieldset id="advancedHeader">
<legend><a id="showAdvanced" tabindex="0" href="#"><?php p($l->t('Storage & database')); ?><img src="<?php print_unescaped(image_path('', 'actions/caret-white.svg')); ?>" /></a></legend>
</fieldset>
<?php endif; ?>
- <?php if(!$_['directoryIsSet'] or count($_['errors']) > 0): ?>
+ <?php if (!$_['directoryIsSet'] or count($_['errors']) > 0): ?>
<fieldset id="datadirField">
<div id="datadirContent">
<label for="directory"><?php p($l->t('Data folder')); ?></label>
@@ -72,14 +72,17 @@ script('core', [
</fieldset>
<?php endif; ?>
- <?php if(!$_['dbIsSet'] or count($_['errors']) > 0): ?>
+ <?php if (!$_['dbIsSet'] or count($_['errors']) > 0): ?>
<fieldset id='databaseBackend'>
- <?php if($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle'])
- $hasOtherDB = true; else $hasOtherDB =false; //other than SQLite?>
+ <?php if ($_['hasMySQL'] or $_['hasPostgreSQL'] or $_['hasOracle']) {
+ $hasOtherDB = true;
+ } else {
+ $hasOtherDB =false;
+ } //other than SQLite?>
<legend><?php p($l->t('Configure the database')); ?></legend>
<div id="selectDbType">
- <?php foreach($_['databases'] as $type => $label): ?>
- <?php if(count($_['databases']) === 1): ?>
+ <?php foreach ($_['databases'] as $type => $label): ?>
+ <?php if (count($_['databases']) === 1): ?>
<p class="info">
<?php p($l->t('Only %s is available.', [$label])); ?>
<?php p($l->t('Install and activate additional PHP modules to choose other database types.')); ?><br>
@@ -96,7 +99,7 @@ script('core', [
</div>
</fieldset>
- <?php if($hasOtherDB): ?>
+ <?php if ($hasOtherDB): ?>
<fieldset id='databaseField'>
<div id="use_other_db">
<p class="grouptop">
@@ -123,7 +126,7 @@ script('core', [
autocomplete="off" autocapitalize="none" autocorrect="off"
pattern="[0-9a-zA-Z$_-]+">
</p>
- <?php if($_['hasOracle']): ?>
+ <?php if ($_['hasOracle']): ?>
<div id="use_oracle_db">
<p class="groupmiddle">
<label for="dbtablespace" class="infield"><?php p($l->t('Database tablespace')); ?></label>
@@ -149,7 +152,7 @@ script('core', [
<?php endif; ?>
<?php endif; ?>
- <?php if(!$_['dbIsSet'] or count($_['errors']) > 0): ?>
+ <?php if (!$_['dbIsSet'] or count($_['errors']) > 0): ?>
<fieldset id="sqliteInformation" class="warning">
<legend><?php p($l->t('Performance warning'));?></legend>
<p><?php p($l->t('You chose SQLite as database.'));?></p>
diff --git a/core/templates/layout.guest.php b/core/templates/layout.guest.php
index 6bb6e1c74bd..e74f2d8ebbf 100644
--- a/core/templates/layout.guest.php
+++ b/core/templates/layout.guest.php
@@ -37,7 +37,7 @@
<h1 class="hidden-visually">
<?php p($theme->getName()); ?>
</h1>
- <?php if(\OC::$server->getConfig()->getSystemValue('installed', false)
+ <?php if (\OC::$server->getConfig()->getSystemValue('installed', false)
&& \OC::$server->getConfig()->getAppValue('theming', 'logoMime', false)): ?>
<img src="<?php p($theme->getLogo()); ?>"/>
<?php endif; ?>
diff --git a/core/templates/layout.public.php b/core/templates/layout.public.php
index 996b78a922b..73e3e0f0b46 100644
--- a/core/templates/layout.public.php
+++ b/core/templates/layout.public.php
@@ -39,34 +39,41 @@
<span id="nextcloud">
<div class="logo logo-icon svg"></div>
<h1 class="header-appname">
- <?php if (isset($template)) { p($template->getHeaderTitle()); } else { p($theme->getName());} ?>
+ <?php if (isset($template)) {
+ p($template->getHeaderTitle());
+ } else {
+ p($theme->getName());
+ } ?>
</h1>
<div class="header-shared-by">
- <?php if (isset($template)) { p($template->getHeaderDetails()); } ?>
+ <?php if (isset($template)) {
+ p($template->getHeaderDetails());
+ } ?>
</div>
</span>
</div>
<?php
/** @var \OCP\AppFramework\Http\Template\PublicTemplateResponse $template */
- if(isset($template) && $template->getActionCount() !== 0) {
+ if (isset($template) && $template->getActionCount() !== 0) {
$primary = $template->getPrimaryAction();
- $others = $template->getOtherActions();
- ?>
+ $others = $template->getOtherActions(); ?>
<div class="header-right">
- <span id="header-primary-action" class="<?php if($template->getActionCount() === 1) { p($primary->getIcon()); } ?>">
+ <span id="header-primary-action" class="<?php if ($template->getActionCount() === 1) {
+ p($primary->getIcon());
+ } ?>">
<a href="<?php p($primary->getLink()); ?>" class="primary button">
<span><?php p($primary->getLabel()) ?></span>
</a>
</span>
- <?php if($template->getActionCount() > 1) { ?>
+ <?php if ($template->getActionCount() > 1) { ?>
<div id="header-secondary-action">
<button id="header-actions-toggle" class="menutoggle icon-more-white"></button>
<div id="header-actions-menu" class="popovermenu menu">
<ul>
<?php
/** @var \OCP\AppFramework\Http\Template\IMenuAction $action */
- foreach($others as $action) {
+ foreach ($others as $action) {
print_unescaped($action->render());
}
?>
@@ -75,12 +82,13 @@
</div>
<?php } ?>
</div>
- <?php } ?>
+ <?php
+ } ?>
</header>
<div id="content" class="app-<?php p($_['appid']) ?>" role="main">
<?php print_unescaped($_['content']); ?>
</div>
- <?php if(isset($template) && $template->getFooterVisible()) { ?>
+ <?php if (isset($template) && $template->getFooterVisible()) { ?>
<footer>
<p><?php print_unescaped($theme->getLongFooter()); ?></p>
<?php
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 5dbc95e1179..318b1d5f34b 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -81,10 +81,10 @@
<div id="navigation" style="display: none;" aria-label="<?php p($l->t('More apps menu')); ?>">
<div id="apps">
<ul>
- <?php foreach($_['navigation'] as $entry): ?>
+ <?php foreach ($_['navigation'] as $entry): ?>
<li data-id="<?php p($entry['id']); ?>">
<a href="<?php print_unescaped($entry['href']); ?>"
- <?php if($entry['active']): ?> class="active"<?php endif; ?>
+ <?php if ($entry['active']): ?> class="active"<?php endif; ?>
aria-label="<?php p($entry['name']); ?>">
<svg width="16" height="16" viewBox="0 0 16 16" alt="">
<defs><filter id="invertMenuMore-<?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>
@@ -123,7 +123,11 @@
<div id="expand" tabindex="0" role="button" class="menutoggle"
aria-label="<?php p($l->t('Settings'));?>"
aria-haspopup="true" aria-controls="expanddiv" aria-expanded="false">
- <div class="avatardiv<?php if ($_['userAvatarSet']) { print_unescaped(' avatardiv-shown'); } else { print_unescaped('" style="display: none'); } ?>">
+ <div class="avatardiv<?php if ($_['userAvatarSet']) {
+ print_unescaped(' avatardiv-shown');
+ } else {
+ print_unescaped('" style="display: none');
+ } ?>">
<?php if ($_['userAvatarSet']): ?>
<img alt="" width="32" height="32"
src="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.avatar.getAvatar', ['userId' => $_['user_uid'], 'size' => 32, 'v' => $_['userAvatarVersion']]));?>"
@@ -136,10 +140,10 @@
<nav class="settings-menu" id="expanddiv" style="display:none;"
aria-label="<?php p($l->t('Settings menu'));?>">
<ul>
- <?php foreach($_['settingsnavigation'] as $entry):?>
+ <?php foreach ($_['settingsnavigation'] as $entry):?>
<li data-id="<?php p($entry['id']); ?>">
<a href="<?php print_unescaped($entry['href']); ?>"
- <?php if($entry["active"]): ?> class="active"<?php endif; ?>>
+ <?php if ($entry["active"]): ?> class="active"<?php endif; ?>>
<img alt="" src="<?php print_unescaped($entry['icon'] . '?v=' . $_['versionHash']); ?>">
<?php p($entry['name']) ?>
</a>
diff --git a/core/templates/login.php b/core/templates/login.php
index 9c6a81fe1ea..124a62f0646 100644
--- a/core/templates/login.php
+++ b/core/templates/login.php
@@ -7,7 +7,7 @@ script('core', 'dist/login');
<?php if (!empty($_['alt_login'])) { ?>
<div id="alternative-logins">
- <?php foreach($_['alt_login'] as $login): ?>
+ <?php foreach ($_['alt_login'] as $login): ?>
<a class="button <?php p($login['style'] ?? ''); ?>" href="<?php print_unescaped($login['href']); ?>" >
<?php p($login['name']); ?>
</a>
diff --git a/core/templates/loginflow/authpicker.php b/core/templates/loginflow/authpicker.php
index 5946eb78400..3a471525d80 100644
--- a/core/templates/loginflow/authpicker.php
+++ b/core/templates/loginflow/authpicker.php
@@ -59,6 +59,6 @@ $urlGenerator = $_['urlGenerator'];
</form>
</div>
-<?php if(empty($_['oauthState'])): ?>
+<?php if (empty($_['oauthState'])): ?>
<a id="app-token-login" class="warning" href="#"><?php p($l->t('Alternative log in using app token')) ?></a>
<?php endif; ?>
diff --git a/core/templates/twofactorselectchallenge.php b/core/templates/twofactorselectchallenge.php
index 830b82b0415..e815fa16631 100644
--- a/core/templates/twofactorselectchallenge.php
+++ b/core/templates/twofactorselectchallenge.php
@@ -61,7 +61,7 @@ $noProviders = empty($_['providers']);
<?php endif ?>
<?php if (!is_null($_['backupProvider'])): ?>
<p>
- <a class="<?php if($noProviders): ?>button primary two-factor-primary<?php else: ?>two-factor-secondary<?php endif ?>" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
+ <a class="<?php if ($noProviders): ?>button primary two-factor-primary<?php else: ?>two-factor-secondary<?php endif ?>" href="<?php p(\OC::$server->getURLGenerator()->linkToRoute('core.TwoFactorChallenge.showChallenge',
[
'challengeProviderId' => $_['backupProvider']->getId(),
'redirect_url' => $_['redirect_url'],
diff --git a/core/templates/twofactorshowchallenge.php b/core/templates/twofactorshowchallenge.php
index 3e789c7490d..481cea06eb0 100644
--- a/core/templates/twofactorshowchallenge.php
+++ b/core/templates/twofactorshowchallenge.php
@@ -14,7 +14,7 @@ $template = $_['template'];
<div class="body-login-container update two-factor">
<h2 class="two-factor-header"><?php p($provider->getDisplayName()); ?></h2>
<?php if ($error): ?>
- <?php if($error_message): ?>
+ <?php if ($error_message): ?>
<p><strong><?php p($error_message); ?></strong></p>
<?php else: ?>
<p><strong><?php p($l->t('Error while validating your second factor')); ?></strong></p>
diff --git a/core/templates/update.use-cli.php b/core/templates/update.use-cli.php
index 8cd7e37ffce..6e6d19483db 100644
--- a/core/templates/update.use-cli.php
+++ b/core/templates/update.use-cli.php
@@ -3,10 +3,10 @@
<h2 class="title"><?php p($l->t('Update needed')) ?></h2>
<div class="infogroup">
<?php if ($_['tooBig']) {
- p($l->t('Please use the command line updater because you have a big instance with more than 50 users.'));
- } else {
- p($l->t('Please use the command line updater because automatic updating is disabled in the config.php.'));
- } ?><br><br>
+ p($l->t('Please use the command line updater because you have a big instance with more than 50 users.'));
+} else {
+ p($l->t('Please use the command line updater because automatic updating is disabled in the config.php.'));
+} ?><br><br>
<?php
print_unescaped($l->t('For help, see the <a target="_blank" rel="noreferrer noopener" href="%s">documentation</a>.', [link_to_docs('admin-cli-upgrade')])); ?><br><br>
</div>