Skip to content

Commit

Permalink
fix: Make skip to content buttons work
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
  • Loading branch information
susnux committed Feb 22, 2023
1 parent b3b24b8 commit b104b27
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions lib/Controller/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,10 @@ public function index(): TemplateResponse {
$this->insertHeaderOnIos();
$this->initialStateService->provideInitialState($this->appName, 'maxStringLengths', Constants::MAX_STRING_LENGTHS);
$this->initialStateService->provideInitialState($this->appName, 'appConfig', $this->configService->getAppConfig());
return new TemplateResponse($this->appName, self::TEMPLATE_MAIN);
return new TemplateResponse($this->appName, self::TEMPLATE_MAIN, [
'id-app-content' => '#app-content-vue',
'id-app-navigation' => '#app-navigation-vue',
]);
}

/**
Expand Down Expand Up @@ -229,7 +232,7 @@ public function publicLinkView(string $hash): Response {
$this->initialStateService->provideInitialState($this->appName, 'isLoggedIn', $this->userSession->isLoggedIn());
$this->initialStateService->provideInitialState($this->appName, 'shareHash', $hash);
$this->initialStateService->provideInitialState($this->appName, 'maxStringLengths', Constants::MAX_STRING_LENGTHS);
return $this->provideTemplate(self::TEMPLATE_MAIN, $form);
return $this->provideTemplate(self::TEMPLATE_MAIN, $form, ['id-app-navigation' => null]);
}

public function provideEmptyContent(string $renderAs, Form $form = null): ?TemplateResponse {
Expand All @@ -246,11 +249,14 @@ public function provideEmptyContent(string $renderAs, Form $form = null): ?Templ
* @param Form $form Necessary to set header on public forms, not necessary for 'notfound'-template
* @return TemplateResponse
*/
public function provideTemplate(string $template, Form $form = null): ?TemplateResponse {
public function provideTemplate(string $template, Form $form = null, array $options = []): ?TemplateResponse {
// If not logged in, use PublicTemplate
if (!$this->userSession->isLoggedIn()) {
Util::addStyle($this->appName, 'public');
$response = new PublicTemplateResponse($this->appName, $template);
$response = new PublicTemplateResponse($this->appName, $template, array_merge([
'id-app-content' => '#app-content-vue',
'id-app-navigation' => null,
], $options));

// Set Header
$response->setHeaderTitle($this->l10n->t('Forms'));
Expand All @@ -272,7 +278,10 @@ public function provideTemplate(string $template, Form $form = null): ?TemplateR
return $response;
}

return new TemplateResponse($this->appName, $template);
return new TemplateResponse($this->appName, $template, array_merge([
'id-app-content' => '#app-content-vue',
'id-app-navigation' => '#app-navigation-vue',
], $options));
}

/**
Expand Down

0 comments on commit b104b27

Please sign in to comment.