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:
authorJulius Härtl <jus@bitgrid.net>2022-07-16 10:58:33 +0300
committerJulius Härtl <jus@bitgrid.net>2022-07-16 11:00:53 +0300
commitca0435382d91a734842b74c097c4f57590c6e8a0 (patch)
tree0d535ebbed04d8e5f0b171a51a983e4df616848a
parent16b06dd75889bef318881a4783cff03aaeb971d9 (diff)
Allow to override #app-content and #app-navigation hrefs for content skipping
Signed-off-by: Julius Härtl <jus@bitgrid.net>
-rw-r--r--apps/dashboard/lib/Controller/DashboardController.php5
-rw-r--r--core/templates/layout.user.php4
-rw-r--r--lib/private/TemplateLayout.php3
3 files changed, 9 insertions, 3 deletions
diff --git a/apps/dashboard/lib/Controller/DashboardController.php b/apps/dashboard/lib/Controller/DashboardController.php
index 3763b07e7bc..4d4f6a5f31c 100644
--- a/apps/dashboard/lib/Controller/DashboardController.php
+++ b/apps/dashboard/lib/Controller/DashboardController.php
@@ -133,7 +133,10 @@ class DashboardController extends Controller {
$this->inititalState->provideInitialState('version', $this->config->getUserValue($this->userId, 'dashboard', 'backgroundVersion', 0));
$this->config->setUserValue($this->userId, 'dashboard', 'firstRun', '0');
- $response = new TemplateResponse('dashboard', 'index');
+ $response = new TemplateResponse('dashboard', 'index', [
+ 'id-app-content' => '#app-dashboard',
+ 'id-app-navigation' => null,
+ ]);
// For the weather widget we should allow the geolocation
$featurePolicy = new Http\FeaturePolicy();
diff --git a/core/templates/layout.user.php b/core/templates/layout.user.php
index 337a1dfc317..d6d0b4441bc 100644
--- a/core/templates/layout.user.php
+++ b/core/templates/layout.user.php
@@ -49,8 +49,8 @@ $getUserAvatar = static function (int $size) use ($_): string {
<input type="hidden" id="initial-state-<?php p($app); ?>" value="<?php p(base64_encode($initialState)); ?>">
<?php }?>
- <a href="#app-content" class="button primary skip-navigation skip-content"><?php p($l->t('Skip to main content')); ?></a>
- <a href="#app-navigation" class="button primary skip-navigation"><?php p($l->t('Skip to navigation of app')); ?></a>
+ <?php if ($_['id-app-content'] !== null) { ?><a href="<?php p($_['id-app-content']); ?>" class="button primary skip-navigation skip-content"><?php p($l->t('Skip to main content')); ?></a><?php } ?>
+ <?php if ($_['id-app-navigation'] !== null) { ?><a href="<?php p($_['id-app-navigation']); ?>" class="button primary skip-navigation"><?php p($l->t('Skip to navigation of app')); ?></a><?php } ?>
<div id="notification-container">
<div id="notification"></div>
diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php
index a5aabc04b61..96b785b2e1c 100644
--- a/lib/private/TemplateLayout.php
+++ b/lib/private/TemplateLayout.php
@@ -281,6 +281,9 @@ class TemplateLayout extends \OC_Template {
}
$this->assign('initialStates', $this->initialState->getInitialStates());
+
+ $this->assign('id-app-content', '#app-content');
+ $this->assign('id-app-navigation', '#app-navigation');
}
/**