Skip to content
12 changes: 7 additions & 5 deletions apps/files/appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,12 @@
<command>OCA\Files\Command\ScanAppData</command>
</commands>

<navigation>
<name>Files</name>
<route>files.view.index</route>
<order>0</order>
</navigation>
<navigations>
<navigation>
<name>Files</name>
<route>files.view.index</route>
<order>0</order>
</navigation>
</navigations>

</info>
10 changes: 9 additions & 1 deletion apps/files/lib/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,15 @@ class App {
public static function getNavigationManager() {
// TODO: move this into a service in the Application class
if (self::$navigationManager === null) {
self::$navigationManager = new \OC\NavigationManager();
self::$navigationManager = new \OC\NavigationManager(
\OC::$server->getAppManager(),
\OC::$server->getURLGenerator(),
\OC::$server->getL10NFactory(),
\OC::$server->getUserSession(),
\OC::$server->getGroupManager(),
\OC::$server->getConfig()
);
self::$navigationManager->clear(false);
}
return self::$navigationManager;
}
Expand Down
10 changes: 9 additions & 1 deletion apps/files/tests/Controller/ViewControllerTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public function testIndexWithRegularBrowser() {
'name' => \OC::$server->getL10N('files')->t('All files'),
'active' => false,
'icon' => '',
'type' => 'link',
],
[
'id' => 'recent',
Expand All @@ -143,6 +144,7 @@ public function testIndexWithRegularBrowser() {
'name' => \OC::$server->getL10N('files')->t('Recent'),
'active' => false,
'icon' => '',
'type' => 'link',
],
[
'id' => 'favorites',
Expand All @@ -152,6 +154,7 @@ public function testIndexWithRegularBrowser() {
'name' => null,
'active' => false,
'icon' => '',
'type' => 'link',
],
[
'id' => 'sharingin',
Expand All @@ -161,6 +164,7 @@ public function testIndexWithRegularBrowser() {
'name' => \OC::$server->getL10N('files_sharing')->t('Shared with you'),
'active' => false,
'icon' => '',
'type' => 'link',
],
[
'id' => 'sharingout',
Expand All @@ -170,6 +174,7 @@ public function testIndexWithRegularBrowser() {
'name' => \OC::$server->getL10N('files_sharing')->t('Shared with others'),
'active' => false,
'icon' => '',
'type' => 'link',
],
[
'id' => 'sharinglinks',
Expand All @@ -179,6 +184,7 @@ public function testIndexWithRegularBrowser() {
'name' => \OC::$server->getL10N('files_sharing')->t('Shared by link', []),
'active' => false,
'icon' => '',
'type' => 'link',
],
[
'id' => 'systemtagsfilter',
Expand All @@ -188,6 +194,7 @@ public function testIndexWithRegularBrowser() {
'name' => \OC::$server->getL10N('systemtags')->t('Tags'),
'active' => false,
'icon' => '',
'type' => 'link',
],
[
'id' => 'trashbin',
Expand All @@ -197,7 +204,8 @@ public function testIndexWithRegularBrowser() {
'name' => \OC::$server->getL10N('files_trashbin')->t('Deleted files'),
'active' => false,
'icon' => '',
],
'type' => 'link',
],
]);

$expected = new Http\TemplateResponse(
Expand Down
24 changes: 1 addition & 23 deletions core/css/header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -322,28 +322,6 @@ nav {
}

/* Apps management */
.apps-management {
min-height: initial;
height: initial;
margin: 0;
a {
svg,
span {
-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=30)';
opacity: .3;
}
/* icon opacity and hover effect */
&:hover svg,
&:focus svg,
&.active svg,
&:hover span,
&:focus span,
&.active span {
-ms-filter: 'progid:DXImageTransform.Microsoft.Alpha(Opacity=100)';
opacity: 1;
}
}
}

#apps {
max-height: calc(100vh - 100px);
Expand Down Expand Up @@ -583,4 +561,4 @@ nav {
}
}

}
}
38 changes: 1 addition & 37 deletions core/templates/layout.user.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@

<div id="appmenu">
<ul>
<?php $headerIconCount = 8; ?>
<?php foreach($_['headernavigation'] as $entry): ?>
<li data-id="<?php p($entry['id']); ?>">
<a href="<?php print_unescaped($entry['href']); ?>" tabindex="3"
Expand All @@ -74,22 +73,12 @@
</a>
</li>
<?php endforeach; ?>
<li id="more-apps" class="menutoggle<?php if (!(count($_['navigation']) > $headerIconCount || (OC_User::isAdminUser(OC_User::getUser()) && count($_['navigation'])>=$headerIconCount))): ?> hidden<?php endif; ?>">
<li id="more-apps" class="menutoggle<?php if (count($_['navigation']) <= 8): ?> hidden<?php endif; ?>">
<a href="#">
<div class="icon-more-white"></div>
<span><?php p($l->t('More apps')); ?></span>
</a>
</li>
<?php if(OC_User::isAdminUser(OC_User::getUser())): ?>
<li <?php if(count($_['navigation'])>$headerIconCount-1): ?> class="hidden apps-management"<?php else: ?> class="apps-management" <?php endif; ?>>
<a href="<?php print_unescaped(\OC::$server->getURLGenerator()->linkToRoute('settings.AppSettings.viewApps')); ?>" tabindex="4"
<?php if( $_['appsmanagement_active'] ): ?> class="active"<?php endif; ?>>
<img src="<?php print_unescaped(image_path('settings', 'apps.svg') . '?v=' . $_['versionHash']); ?>" />
<div class="icon-loading-dark" style="display:none;"></div>
<span><?php p($l->t('Apps')); ?></span>
</a>
</li>
<?php endif; ?>
</ul>
</div>

Expand All @@ -115,25 +104,6 @@
</a>
</li>
<?php endforeach; ?>
<?php
/* show "More apps" link to app administration directly in app navigation, as last entry */
if(OC_User::isAdminUser(OC_User::getUser())):
?>
<li class="apps-management">
<a href="<?php print_unescaped(\OC::$server->getURLGenerator()->linkToRoute('settings.AppSettings.viewApps')); ?>" tabindex="4"
<?php if( $_['appsmanagement_active'] ): ?> class="active"<?php endif; ?>>
<svg width="32" height="32" viewBox="0 0 32 32" class="app-icon">
<defs><filter id="invert-appsmanagement"><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>
<image x="0" y="0" width="32" height="32" preserveAspectRatio="xMinYMin meet" filter="url(#invert-appsmanagement)" xlink:href="<?php print_unescaped(image_path('settings', 'apps.svg') . '?v=' . $_['versionHash']); ?>"></image>
</svg>
<div class="icon-loading-dark" style="display:none;"></div>
<span>
<?php p($l->t('Apps')); ?>
</span>
</a>
</li>
<?php endif; ?>

</ul>
</div>
</div></nav>
Expand Down Expand Up @@ -174,12 +144,6 @@
</a>
</li>
<?php endforeach; ?>
<li>
<a id="logout" <?php print_unescaped(OC_User::getLogoutAttribute()); ?>>
<img alt="" src="<?php print_unescaped(image_path('', 'actions/logout.svg') . '?v=' . $_['versionHash']); ?>">
<?php p($l->t('Log out'));?>
</a>
</li>
</ul>

</div>
Expand Down
Loading