diff --git a/module/VuFind/src/VuFind/Controller/AbstractBase.php b/module/VuFind/src/VuFind/Controller/AbstractBase.php index c7024ba7d54f726da972353cd7bf7262dbb9a4f6..69fdaf2c5c7f20ab3b8b32e6390db5410ece9aac 100644 --- a/module/VuFind/src/VuFind/Controller/AbstractBase.php +++ b/module/VuFind/src/VuFind/Controller/AbstractBase.php @@ -132,10 +132,9 @@ class AbstractBase extends AbstractActionController */ protected function createViewModel($params = null) { - $layout = $this->params() - ->fromPost('layout', $this->params()->fromQuery('layout', false)); - if ('lightbox' === $layout) { + if ($this->inLightbox()) { $this->layout()->setTemplate('layout/lightbox'); + $params['inLightbox'] = true; } return new ViewModel($params); } @@ -679,4 +678,18 @@ class AbstractBase extends AbstractActionController { return $this->serviceLocator->get(\VuFind\RecordTab\TabManager::class); } + + /** + * Are we currently in a lightbox context? + * + * @return bool + */ + protected function inLightbox() + { + return + $this->params()->fromPost( + 'layout', $this->params()->fromQuery('layout', false) + ) === 'lightbox' + || 'layout/lightbox' == $this->layout()->getTemplate(); + } } diff --git a/module/VuFind/src/VuFind/Controller/MyResearchController.php b/module/VuFind/src/VuFind/Controller/MyResearchController.php index 0dc721062ebcb866670b4c24ca860ef9e5af2c53..0c3dcad453da21776c0fd1ea4866c827a512228c 100644 --- a/module/VuFind/src/VuFind/Controller/MyResearchController.php +++ b/module/VuFind/src/VuFind/Controller/MyResearchController.php @@ -56,17 +56,6 @@ class MyResearchController extends AbstractBase */ protected $paginationHelper = null; - /** - * Are we currently in a lightbox context? - * - * @return bool - */ - protected function inLightbox() - { - return $this->getRequest()->getQuery('layout', 'no') === 'lightbox' - || 'layout/lightbox' == $this->layout()->getTemplate(); - } - /** * Construct an HTTP 205 (refresh) response. Useful for reporting success * in the lightbox without actually rendering content. diff --git a/themes/bootstrap3/templates/feedback/form.phtml b/themes/bootstrap3/templates/feedback/form.phtml index 1b4802c0fd300bce3490fc642eb5278f5de82755..5f42743553978e1876177c75c58999cbfcd9b487 100644 --- a/themes/bootstrap3/templates/feedback/form.phtml +++ b/themes/bootstrap3/templates/feedback/form.phtml @@ -16,10 +16,11 @@ $helpPre = isset($help['pre']) ? $this->translate($help['pre']) : null; $helpPost = isset($help['post']) ? $this->translate($help['post']) : null; ?> -<div class="feedback-content"> +<?php if (!$this->inLightbox): ?><div class="feedback-content"><?php endif; ?> <?php if ($title): ?> <?php $this->headTitle($title); ?> - <h1><?=$title?></h1> + <?php $headTag = $this->inLightbox ? 'h2' : 'h1'; ?> + <<?=$headTag?>><?=$title?></<?=$headTag?>> <?php endif; ?> <?=$this->flashmessages()?> @@ -96,4 +97,4 @@ <?php endforeach ?> <?= $this->form()->closeTag() ?> <?php endif ?> -</div> +<?php if (!$this->inLightbox): ?></div><?php endif; ?>