summaryrefslogtreecommitdiffstats
path: root/apps/files/templates
diff options
context:
space:
mode:
authorfnuesse <felix.nuesse@t-online.de>2018-06-20 22:40:10 +0200
committerJohn Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>2018-07-12 16:49:38 +0200
commitdf9bae41bbae73220df134e8fc92d084ed03fa64 (patch)
tree05bf46b71e0bc08fb821d30599250384de92a43d /apps/files/templates
parentedd2ab219416f2a0dd9c5afd15fac9bb973370d7 (diff)
downloadnextcloud-server-df9bae41bbae73220df134e8fc92d084ed03fa64.tar.gz
nextcloud-server-df9bae41bbae73220df134e8fc92d084ed03fa64.zip
Removed old code
Signed-off-by: fnuesse <felix.nuesse@t-online.de> Removed duplicate collapse-button and changed api-endpoints Signed-off-by: fnuesse <felix.nuesse@t-online.de> Removed app-navigation-caption from apps.scss Signed-off-by: fnuesse <felix.nuesse@t-online.de> Changed api-endpoints Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed Codestyle (.js) Signed-off-by: fnuesse <felix.nuesse@t-online.de> Hid away extended Settings Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed reverse state Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed Missing reverse after changing sort-strategy Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed Copyright-Header Signed-off-by: fnuesse <felix.nuesse@t-online.de> Removed UI-Flickering Signed-off-by: fnuesse <felix.nuesse@t-online.de> hid dotmenu on toggle while favorites are empty Signed-off-by: fnuesse <felix.nuesse@t-online.de> Added Draggable to listelements (WIP) Signed-off-by: fnuesse <felix.nuesse@t-online.de> Rebuild appnavigation.php with recursive function to allow easy implementation of sublists Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed draggable Sublist-Elements Signed-off-by: fnuesse <felix.nuesse@t-online.de> Fixed draggable Sublist-Elements Signed-off-by: fnuesse <felix.nuesse@t-online.de> Added date-modified sorting option to quickaccess Signed-off-by: fnuesse <felix.nuesse@t-online.de> Added custom order sorting option to quickaccess Signed-off-by: fnuesse <felix.nuesse@t-online.de> Added custom order sorting option to quickaccess Signed-off-by: fnuesse <felix.nuesse@t-online.de> Added fallback for custom ordering Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Diffstat (limited to 'apps/files/templates')
-rw-r--r--apps/files/templates/appnavigation.php165
1 files changed, 94 insertions, 71 deletions
diff --git a/apps/files/templates/appnavigation.php b/apps/files/templates/appnavigation.php
index 7bf92995de6..56a84edf3b6 100644
--- a/apps/files/templates/appnavigation.php
+++ b/apps/files/templates/appnavigation.php
@@ -1,71 +1,18 @@
<div id="app-navigation">
<ul class="with-icon">
- <?php $pinned = 0 ?>
- <?php foreach ($_['navigationItems'] as $item) {
- strpos($item['classes'], 'pinned')!==false ? $pinned++ : '';
- ?>
-
- <li data-id="<?php p(isset($item['href']) ? $item['href'] : $item['id']) ?>"
- class="nav-<?php p($item['id']) ?> <?php p($item['classes']) ?> <?php p($pinned===1?'first-pinned':'') ?> <?php if ($item['enableQuickaccess'] === 'true') { ?> open<?php } ?>"
- <?php if (isset($item['folderPosition'])){ ?> folderPos="<?php p($item['folderPosition']);?>"<?php } ?>
- <?php if ($item['id'] === 'favorites'){?>id="favorites-toggle"<?php } ?>>
-
- <?php if ($item['id'] === 'favorites'){?>
- <button id="button-collapseQuickAccess" class="collapse" <?php if ($item['favoritescount'] === 0){ ?> style="display: none"<?php } ?>></button><?php } ?>
+ <?php
- <a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>"
- class="nav-icon-<?php p($item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg"><?php p($item['name']);?></a>
- <?php if ($item['id'] === 'favorites') {?>
- <div id="quickaccessbutton" class="app-navigation-entry-utils" <?php if ($item['favoritescount'] === 0) { ?> style="display: none"<?php } ?>>
- <ul>
- <li class="app-navigation-entry-utils-menu-button svg">
- <button id="button-<?php p($item['id']) ?>"></button>
- </li>
- </ul>
- </div>
- <div class="app-navigation-entry-menu" id="menu-<?php p($item['id']) ?>">
- <ul>
- <li>
- <span class="menuitem">
- <input id="enableQuickAccess" type="checkbox" class="checkbox" <?php if($item['enableQuickaccess']=='true'){ ?> checked<?php } ?>/>
- <label for="enableQuickAccess"><?php p($l->t('Enable Quickaccess')); ?></label>
- </span>
- </li>
- <li>
- <span class="menuitem">
- <input id="sortByAlphabet" type="checkbox" class="checkbox" data-group='SortingStrategy'<?php if($item['quickaccessSortingStrategy']=='alphabet'){ ?> checked<?php } ?>/>
- <label for="sortByAlphabet"><?php p($l->t('Sort by Alphabet')); ?></label>
- </span>
- </li>
- <li>
- <span class="menuitem">
- <input id="sortByDate" type="checkbox" class="checkbox" data-group='SortingStrategy'<?php if($item['quickaccessSortingStrategy']=='date'){ ?> checked<?php } ?>/>
- <label for="sortByDate"><?php p($l->t('Sort by Date')); ?></label>
- </span>
- </li>
- <li>
- <span class="menuitem">
- <input id="enableReverse" type="checkbox" class="checkbox" <?php if($item['quickaccessSortingReverse']==true){ ?> checked<?php } ?>/>
- <label for="enableReverse"><?php p($l->t('Reverse List')); ?></label>
- </span>
- </li>
- </ul>
- </div>
- <ul id="quickaccess-list" >
- <?php /*This fixes the styleerrors if no favorites are set*/ if ($item['favoritescount'] === 0) {?></ul><?php } ?>
- <?php } ?>
-
- <?php if ($item['quickaccesselement'] === 'last') {?>
- </ul>
- <?php } ?>
- </li>
+ $pinned = 0;
+ foreach ($_['navigationItems'] as $item) {
+ $pinned = NavigationListElements($item, $pinned, $l);
+ }
+ ?>
- <?php } ?>
-
- <li id="quota" class="pinned <?php p($pinned===0?'first-pinned ':'') ?><?php
- if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
- ?>has-tooltip" title="<?php p($_['usage_relative'] . '%');
+ <li id="quota"
+ class="pinned <?php p($pinned === 0 ? 'first-pinned ' : '') ?><?php
+ if ($_['quota'] !== \OCP\Files\FileInfo::SPACE_UNLIMITED) {
+ ?>has-tooltip" title="<?php p($_['usage_relative'] . '%');
} ?>">
<a href="#" class="icon-quota svg">
<p id="quotatext"><?php
@@ -75,27 +22,103 @@
p($l->t('%s used', [$_['usage']]));
} ?></p>
<div class="quota-container">
- <progress value="<?php p($_['usage_relative']); ?>" max="100"
- <?php if($_['usage_relative'] > 80): ?> class="warn" <?php endif; ?>></progress>
+ <progress value="<?php p($_['usage_relative']); ?>"
+ max="100"
+ <?php if ($_['usage_relative'] > 80): ?> class="warn" <?php endif; ?>></progress>
</div>
</a>
</li>
</ul>
<div id="app-settings">
<div id="app-settings-header">
- <button class="settings-button" data-apps-slide-toggle="#app-settings-content">
- <?php p($l->t('Settings'));?>
+ <button class="settings-button"
+ data-apps-slide-toggle="#app-settings-content">
+ <?php p($l->t('Settings')); ?>
</button>
</div>
<div id="app-settings-content">
<div id="files-setting-showhidden">
- <input class="checkbox" id="showhiddenfilesToggle" checked="checked" type="checkbox">
+ <input class="checkbox" id="showhiddenfilesToggle"
+ checked="checked" type="checkbox">
<label for="showhiddenfilesToggle"><?php p($l->t('Show hidden files')); ?></label>
</div>
- <label for="webdavurl"><?php p($l->t('WebDAV'));?></label>
- <input id="webdavurl" type="text" readonly="readonly" value="<?php p(\OCP\Util::linkToRemote('webdav')); ?>" />
- <em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer noopener">access your Files via WebDAV</a>', array(link_to_docs('user-webdav'))));?></em>
+ <label for="webdavurl"><?php p($l->t('WebDAV')); ?></label>
+ <input id="webdavurl" type="text" readonly="readonly"
+ value="<?php p(\OCP\Util::linkToRemote('webdav')); ?>"/>
+ <em><?php print_unescaped($l->t('Use this address to <a href="%s" target="_blank" rel="noreferrer noopener">access your Files via WebDAV</a>', array(link_to_docs('user-webdav')))); ?></em>
</div>
</div>
</div>
+
+
+<?php
+
+/**
+ * Prints the HTML for a single Entry.
+ *
+ * @param $item The item to be added
+ * @param $pinned IntegerValue to count the pinned entries at the bottom
+ * @param $l Translator
+ *
+ * @return int Returns the pinned value
+ */
+function NavigationListElements($item, $pinned, $l) {
+ strpos($item['classes'], 'pinned') !== false ? $pinned++ : '';
+ ?>
+ <li <?php if (isset($item['sublist'])){ ?>id="button-collapse-parent-<?php p($item['id']); ?>"<?php } ?>
+ data-id="<?php p(isset($item['href']) ? $item['href'] : $item['id']) ?> "
+ class="nav-<?php p($item['id']) ?> <?php p($item['classes']) ?> <?php p($pinned === 1 ? 'first-pinned' : '') ?> <?php if ($item['defaultExpandedState'] === 'true') { ?> open<?php } ?>"
+ <?php if (isset($item['folderPosition'])) { ?> folderPos="<?php p($item['folderPosition']); ?>" <?php } ?>>
+
+ <a href="<?php p(isset($item['href']) ? $item['href'] : '#') ?>"
+ class="nav-icon-<?php p($item['icon'] !== '' ? $item['icon'] : $item['id']) ?> svg"><?php p($item['name']); ?></a>
+
+
+ <?php
+ NavigationElementMenu($item);
+ if (isset($item['sublist'])) {
+ ?>
+ <button id="button-collapse-<?php p($item['id']); ?>"
+ class="collapse"></button>
+ <ul id="sublist-<?php p($item['id']); ?>" <?php if ($item['draggableSublist'] === 'true') { ?> draggable="true"<?php } ?>>
+ <?php
+ foreach ($item['sublist'] as $item) {
+ $pinned = NavigationListElements($item, $pinned, $l);
+ }
+ ?>
+ </ul>
+ <?php } ?>
+ </li>
+
+
+ <?php
+ return $pinned;
+}
+
+/**
+ * Prints the HTML for a dotmenu.
+ *
+ * @param $item The item to be added
+ *
+ * @return void
+ */
+function NavigationElementMenu($item) {
+ if ($item['menubuttons'] === 'true') {
+ ?>
+ <div id="dotmenu-<?php p($item['id']); ?>"
+ class="app-navigation-entry-utils" <?php if ($item['enableMenuButton'] === 0) { ?> style="display: none"<?php } ?>>
+ <ul>
+ <li class="app-navigation-entry-utils-menu-button svg">
+ <button id="dotmenu-button-<?php p($item['id']) ?>"></button>
+ </li>
+ </ul>
+ </div>
+ <div id="dotmenu-content-<?php p($item['id']) ?>"
+ class="app-navigation-entry-menu">
+ <ul>
+
+ </ul>
+ </div>
+ <?php }
+} \ No newline at end of file