diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
---|---|---|
committer | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-04-10 14:19:56 +0200 |
commit | caff1023ea72bb2ea94130e18a2a6e2ccf819e5f (patch) | |
tree | 186d494c2aea5dea7255d3584ef5d595fc6e6194 /apps/files/templates | |
parent | edf8ce32cffdb920e8171207b342abbd7f1fbe73 (diff) | |
download | nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.tar.gz nextcloud-server-caff1023ea72bb2ea94130e18a2a6e2ccf819e5f.zip |
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 'apps/files/templates')
-rw-r--r-- | apps/files/templates/appnavigation.php | 22 | ||||
-rw-r--r-- | apps/files/templates/index.php | 2 | ||||
-rw-r--r-- | apps/files/templates/list.php | 2 |
3 files changed, 14 insertions, 12 deletions
diff --git a/apps/files/templates/appnavigation.php b/apps/files/templates/appnavigation.php index 8992d266e49..f57295e8887 100644 --- a/apps/files/templates/appnavigation.php +++ b/apps/files/templates/appnavigation.php @@ -12,7 +12,7 @@ script(\OCA\Files\AppInfo\Application::APP_ID, 'dist/files-app-settings'); } ?> - <?php if($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?> + <?php if ($_['quota'] === \OCP\Files\FileInfo::SPACE_UNLIMITED): ?> <li id="quota" class="pinned <?php p($pinned === 0 ? 'first-pinned ' : '') ?>"> <a href="#" class="icon-quota svg"> <p><?php p($l->t('%s used', [$_['usage']])); ?></p> @@ -66,15 +66,16 @@ script(\OCA\Files\AppInfo\Application::APP_ID, 'dist/files-app-settings'); * @return int Returns the pinned value */ function NavigationListElements($item, $l, $pinned) { - strpos($item['classes'] ?? '', 'pinned') !== false ? $pinned++ : ''; - ?> + strpos($item['classes'] ?? '', 'pinned') !== false ? $pinned++ : ''; ?> <li data-id="<?php p($item['id']) ?>" <?php if (isset($item['dir'])) { ?> data-dir="<?php p($item['dir']); ?>" <?php } ?> <?php if (isset($item['view'])) { ?> data-view="<?php p($item['view']); ?>" <?php } ?> <?php if (isset($item['expandedState'])) { ?> data-expandedstate="<?php p($item['expandedState']); ?>" <?php } ?> class="nav-<?php p($item['id']) ?> - <?php if (isset($item['classes'])) { p($item['classes']); } ?> + <?php if (isset($item['classes'])) { + p($item['classes']); + } ?> <?php p($pinned === 1 ? 'first-pinned' : '') ?> <?php if (isset($item['defaultExpandedState']) && $item['defaultExpandedState']) { ?> open<?php } ?>" <?php if (isset($item['folderPosition'])) { ?> folderposition="<?php p($item['folderPosition']); ?>" <?php } ?>> @@ -85,17 +86,17 @@ function NavigationListElements($item, $l, $pinned) { <?php NavigationElementMenu($item); - if (isset($item['sublist'])) { - ?> + if (isset($item['sublist'])) { + ?> <button class="collapse app-navigation-noclose" <?php if (sizeof($item['sublist']) == 0) { ?> style="display: none" <?php } ?>></button> <ul id="sublist-<?php p($item['id']); ?>"> <?php foreach ($item['sublist'] as $item) { $pinned = NavigationListElements($item, $l, $pinned); - } - ?> + } ?> </ul> - <?php } ?> + <?php + } ?> </li> @@ -127,5 +128,6 @@ function NavigationElementMenu($item) { </ul> </div> - <?php } + <?php + } } diff --git a/apps/files/templates/index.php b/apps/files/templates/index.php index 69ad73f1081..2bac8410f91 100644 --- a/apps/files/templates/index.php +++ b/apps/files/templates/index.php @@ -4,7 +4,7 @@ <?php if (!$_['isIE']) { ?> <input type="checkbox" class="hidden-visually" id="showgridview" - <?php if($_['showgridview']) { ?>checked="checked" <?php } ?>/> + <?php if ($_['showgridview']) { ?>checked="checked" <?php } ?>/> <label id="view-toggle" for="showgridview" class="button <?php p($_['showgridview'] ? 'icon-toggle-filelist' : 'icon-toggle-pictures') ?>" title="<?php p($l->t('Toggle grid view'))?>"></label> <?php } ?> diff --git a/apps/files/templates/list.php b/apps/files/templates/list.php index ff23c1aee95..ff79c771c0a 100644 --- a/apps/files/templates/list.php +++ b/apps/files/templates/list.php @@ -12,7 +12,7 @@ */ ?> <input type="hidden" name="permissions" value="" id="permissions"> <input type="hidden" id="free_space" value="<?php isset($_['freeSpace']) ? p($_['freeSpace']) : '' ?>"> - <?php if(isset($_['dirToken'])):?> + <?php if (isset($_['dirToken'])):?> <input type="hidden" id="publicUploadRequestToken" name="requesttoken" value="<?php p($_['requesttoken']) ?>" /> <input type="hidden" id="dirToken" name="dirToken" value="<?php p($_['dirToken']) ?>" /> <?php endif;?> |