-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
28 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ | |
/** | ||
* This file is part of contao-community-alliance/dc-general-contao-frontend. | ||
* | ||
* (c) 2015-2022 Contao Community Alliance. | ||
* (c) 2015-2023 Contao Community Alliance. | ||
* | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
|
@@ -15,20 +15,21 @@ | |
* @author Richard Henkenjohann <[email protected]> | ||
* @author Sven Baumann <[email protected]> | ||
* @author Ingolf Steinhardt <[email protected]> | ||
* @copyright 2015-2022 Contao Community Alliance. | ||
* @copyright 2015-2023 Contao Community Alliance. | ||
* @license https://github.com/contao-community-alliance/dc-general-contao-frontend/blob/master/LICENSE LGPL-3.0 | ||
* @filesource | ||
*/ | ||
|
||
namespace ContaoCommunityAlliance\DcGeneral\ContaoFrontend\View; | ||
|
||
use ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\GetEditModeButtonsEvent; | ||
use ContaoCommunityAlliance\DcGeneral\ContaoFrontend\Event\DcGeneralFrontendEvents; | ||
use ContaoCommunityAlliance\DcGeneral\ContaoFrontend\Event\HandleSubmitEvent; | ||
use ContaoCommunityAlliance\DcGeneral\Data\DataProviderInterface; | ||
use ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\GetEditMaskSubHeadlineEvent; | ||
use ContaoCommunityAlliance\DcGeneral\Contao\View\Contao2BackendView\Event\GetEditModeButtonsEvent; | ||
use ContaoCommunityAlliance\DcGeneral\DataDefinition\ContainerInterface; | ||
use ContaoCommunityAlliance\DcGeneral\DataDefinition\Definition\PropertiesDefinitionInterface; | ||
use ContaoCommunityAlliance\DcGeneral\DataDefinition\Palette\PaletteInterface; | ||
use ContaoCommunityAlliance\DcGeneral\Data\DataProviderInterface; | ||
use ContaoCommunityAlliance\DcGeneral\Data\ModelInterface; | ||
use ContaoCommunityAlliance\DcGeneral\Data\PropertyValueBag; | ||
use ContaoCommunityAlliance\DcGeneral\DcGeneralEvents; | ||
|
@@ -192,7 +193,7 @@ public function execute() | |
$template->setData( | ||
[ | ||
'fieldsets' => $fieldSets, | ||
'subHeadline' => $this->getHeadline(), | ||
'subHeadline' => $this->getSubHeadline(), | ||
'table' => $this->definition->getName(), | ||
'enctype' => 'multipart/form-data', | ||
'error' => $this->errors, | ||
|
@@ -500,13 +501,30 @@ private function handleSubmit($buttons) | |
* Determine the headline to use. | ||
* | ||
* @return string. | ||
* | ||
* @deprecated This is deprecated since 2.3 and will be removed in 3.0. | ||
*/ | ||
private function getHeadline() | ||
private function getHeadline(): string | ||
{ | ||
if ($this->model->getId()) { | ||
return $this->translateLabel('editRecord', [$this->model->getId()]); | ||
} | ||
return $this->translateLabel('newRecord'); | ||
// @codingStandardsIgnoreStart | ||
@\trigger_error(__CLASS__ . '::' . __METHOD__ . ' is deprecated - use getSubHeadline()!', E_USER_DEPRECATED); | ||
// @codingStandardsIgnoreEnd | ||
|
||
$this->getSubHeadline(); | ||
} | ||
|
||
/** | ||
* Determine the headline to use. | ||
* | ||
* @return string. | ||
*/ | ||
private function getSubHeadline(): string | ||
{ | ||
$event = new GetEditMaskSubHeadlineEvent($this->environment, $this->model); | ||
|
||
$this->dispatcher->dispatch($event, $event::NAME); | ||
|
||
return $event->getHeadline(); | ||
} | ||
|
||
/** | ||
|