-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1295 from nextcloud/nav-display-frontend
feat: Add UI elements to modify navigation display
- Loading branch information
Showing
16 changed files
with
336 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
<?php | ||
|
||
/** | ||
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors | ||
* SPDX-License-Identifier: AGPL-3.0-or-later | ||
*/ | ||
|
||
namespace OCA\Tables\Controller; | ||
|
||
use OCA\Tables\Service\ContextService; | ||
use OCP\AppFramework\Http\Attribute\NoAdminRequired; | ||
use OCP\AppFramework\Http\Attribute\NoCSRFRequired; | ||
use OCP\AppFramework\Http\Attribute\OpenAPI; | ||
use OCP\AppFramework\Http\DataResponse; | ||
use OCP\INavigationManager; | ||
use OCP\IRequest; | ||
use OCP\IURLGenerator; | ||
use OCP\IUserSession; | ||
|
||
/** | ||
* This is a workaround until https://github.com/nextcloud/server/pull/49904 is | ||
* settled in all covered NC versions; expected >= 31. | ||
*/ | ||
class NavigationController extends \OC\Core\Controller\NavigationController { | ||
public function __construct( | ||
protected ContextService $contextService, | ||
protected IUserSession $userSession, | ||
string $appName, | ||
IRequest $request, | ||
INavigationManager $navigationManager, | ||
IURLGenerator $urlGenerator | ||
) { | ||
parent::__construct($appName, $request, $navigationManager, $urlGenerator); | ||
} | ||
|
||
#[NoAdminRequired] | ||
#[NoCSRFRequired] | ||
#[OpenAPI(scope: OpenAPI::SCOPE_IGNORE)] | ||
public function getAppsNavigation(bool $absolute = false): DataResponse { | ||
$this->contextService->addToNavigation($this->userSession->getUser()?->getUID()); | ||
return parent::getAppsNavigation($absolute); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.