Skip to content

Commit

Permalink
[FEATURE] PageLayout - Multilanguage
Browse files Browse the repository at this point in the history
This adds sidebar for MultiLanguage if more then one language
is available.

Related: #298
Release: 8.0.0
  • Loading branch information
Alexander Opitz committed Sep 11, 2021
1 parent 2ed6654 commit 58e6441
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
5 changes: 3 additions & 2 deletions Classes/Controller/Backend/PageLayoutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ public function showAction()
'configuration',
[
'allAvailableLanguages' => $this->allAvailableLanguages,
// If we have more then "all-languages" and 1 editors language available
'moreThenOneLanguageAvailable' => count($this->allAvailableLanguages) > 2 ? true : false,
'lllFile' => 'LLL:EXT:templavoilaplus/Resources/Private/Language/Backend/PageLayout.xlf',
'clipboard' => $this->clipboard2fluid(),
'userSettings' => TemplaVoilaUtility::getBackendUser()->uc['templavoilaplus'] ?? [],
Expand Down Expand Up @@ -656,8 +658,7 @@ protected function callHandler($type, $key, ...$param)
protected function initializeCurrentLanguage()
{
// Fill array allAvailableLanguages and currently selected language (from language selector or from outside)
$this->allAvailableLanguages = TemplaVoilaUtility::getAvailableLanguages(0, true, true, $this->modSharedTSconfig);

$this->allAvailableLanguages = TemplaVoilaUtility::getAvailableLanguages($this->pageId, true, true, $this->modSharedTSconfig);
$languageFromSession = (int)TemplaVoilaUtility::getBackendUser()->getSessionData('templavoilaplus.language');
// determine language parameter
$this->currentLanguageUid = (int)GeneralUtility::_GP('language') > 0
Expand Down
13 changes: 10 additions & 3 deletions Resources/Private/Templates/Backend/PageLayout/Show.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@
<section id="tvp-component-stage-container" data-identifier="tvpComponentStageContainer">
<div id="tvp-component-stage-container-inner" data-identifier="tvpComponentStageContainerInner">
<header id="tvp-component-stage-header">
<f:render section="Header" arguments="{_all}" />
<f:render section="Header" arguments="{_all}" />
</header>
<div id="tvp-component-stage-content">
<f:render section="Stage" arguments="{_all}" />
<f:render section="Stage" arguments="{_all}" />
</div>
</div>
</section>
<section id="tvp-component-sidebar-right" class="tvp-component-sidebar" data-identifier="tvpComponentSidebarLeft">
<f:render section="SidebarContentManipulation" />
<f:render section="SidebarContentManipulation" arguments="{_all}" />
</section>

</div>
Expand Down Expand Up @@ -79,6 +79,13 @@ <h1 id="tvpPageTitle" data-identifier="tvpPageTitle">{pageTitle}</h1>
</f:if>
</div>
</li>
<f:if condition="{configuration.moreThenOneLanguageAvailable}">
<li class="sidenav-item disabled" id="navbarLanguages">
<div>
<core:icon identifier="flags-multiple" size="default" />
</div>
</li>
</f:if>
<li class="sidenav-item disabled" id="navbarClipboard">
<div>
<f:if condition="{is10orNewer}">
Expand Down

0 comments on commit 58e6441

Please sign in to comment.