Skip to content

Commit

Permalink
Fix rebase from pr 608
Browse files Browse the repository at this point in the history
  • Loading branch information
e-spin committed Nov 29, 2023
1 parent 0e7e189 commit b92925f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
17 changes: 4 additions & 13 deletions src/Contao/View/Contao2BackendView/EditMask.php
Original file line number Diff line number Diff line change
Expand Up @@ -1021,17 +1021,10 @@ public function execute()
private function executeMultiLanguage(ContaoBackendViewTemplate $template)
{
$dataProvider = $this->getEnvironment()->getDataProvider($this->model->getProviderName());
assert($dataProvider instanceof DataProviderInterface);

if (
\in_array(
MultiLanguageDataProviderInterface::class,
\class_implements($dataProvider)
)
$dataProvider instanceof MultiLanguageDataProviderInterface
&& null !== $dataProvider->getLanguages($this->model->getId())
) {
/** @var MultiLanguageDataProviderInterface $dataProvider */
$dataProvider = $this->getEnvironment()->getDataProvider();

$locales = System::getContainer()->get('contao.intl.locales');
assert($locales instanceof Locales);

Expand All @@ -1043,10 +1036,8 @@ private function executeMultiLanguage(ContaoBackendViewTemplate $template)
$translator = $this->environment->getTranslator();
assert($translator instanceof TranslatorInterface);

$template->set(
'languages',
$controller->getSupportedLanguages($this->model->getId())
)
$template
->set('languages', $controller->getSupportedLanguages($this->model->getId()))
->set('language', $dataProvider->getCurrentLanguage())
->set('languageSubmit', $translator->translate('MSC.showSelected'))
->set('languageHeadline', $languages[$dataProvider->getCurrentLanguage()] ?? '');
Expand Down
8 changes: 7 additions & 1 deletion src/DataContainerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,15 @@

namespace ContaoCommunityAlliance\DcGeneral;

use Contao\EditableDataContainerInterface;
use Contao\ListableDataContainerInterface;

/**
* This interface describes an object providing access to an environment.
*/
interface DataContainerInterface extends \editable, \listable, EnvironmentAwareInterface
interface DataContainerInterface extends
EditableDataContainerInterface,
ListableDataContainerInterface,
EnvironmentAwareInterface
{
}

0 comments on commit b92925f

Please sign in to comment.