Commit 0de5ac09 authored by Oliver Bartsch's avatar Oliver Bartsch Committed by Benni Mack
Browse files

[TASK] Remove empty h2 and margin in Scheduler module

This patch removes an empty h2 tag in the scheduler
module and also removes an unnecessary margin-bottom
which visually looked like an empty table row.

Furthermore is the main template structure now also
rendered using the already existing standalone view
instance.

Resolves: #94567
Releases: master
Change-Id: I74b2ba00c52a4c92d506e8cde21493320b073e1e
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/69897


Tested-by: core-ci's avatarcore-ci <typo3@b13.com>
Tested-by: default avatarGuido Schmechel <guido.schmechel@brandung.de>
Tested-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
Reviewed-by: default avatarGuido Schmechel <guido.schmechel@brandung.de>
Reviewed-by: Benni Mack's avatarBenni Mack <benni@typo3.org>
parent 0e53b48b
......@@ -169,19 +169,23 @@ class SchedulerModuleController
$settings = $parsedBody['SET'] ?? $queryParams['SET'] ?? null;
$this->MOD_SETTINGS = BackendUtility::getModuleData($this->MOD_MENU, $settings, 'system_txschedulerM1', '', '', '');
// Set the form
$content = '<form name="tx_scheduler_form" id="tx_scheduler_form" method="post" action="">';
// Prepare main content
$content .= '<h1>' . $this->getLanguageService()->getLL('function.' . $this->MOD_SETTINGS['function']) . '</h1>';
$previousCMD = Action::cast($parsedBody['previousCMD'] ?? $queryParams['previousCMD'] ?? null);
$content .= $this->getModuleContent($previousCMD, $request->getAttribute('normalizedParams')->getRequestUri());
$content .= '<div id="extraFieldsSection"></div></form><div id="extraFieldsHidden"></div>';
// Prepare main content
$content = $this->getModuleContent($previousCMD, $request->getAttribute('normalizedParams')->getRequestUri());
$this->view->setTemplatePathAndFilename(
GeneralUtility::getFileAbsFileName('EXT:scheduler/Resources/Private/Templates/Backend/SchedulerModule/Index.html')
);
$this->view->assignMultiple([
'headline' => $this->getLanguageService()->getLL('function.' . $this->MOD_SETTINGS['function']),
'sectionTitle' => $this->getSectionTitle(),
'content' => $content,
]);
$this->getButtons($request);
$this->getModuleMenu();
$this->moduleTemplate->setContent($content);
$this->moduleTemplate->setContent($this->view->render());
$this->moduleTemplate->setTitle(
$this->getLanguageService()->sL('LLL:EXT:scheduler/Resources/Private/Language/locallang_mod.xlf:mlang_tabs_tab'),
$this->getLanguageService()->getLL('function.' . $this->MOD_SETTINGS['function'])
......@@ -239,7 +243,6 @@ class SchedulerModuleController
protected function getModuleContent(Action $previousAction, string $requestUri): string
{
$content = '';
$sectionTitle = '';
// Get submitted data
$this->submittedData = GeneralUtility::_GPmerged('tx_scheduler');
$this->submittedData['uid'] = (int)($this->submittedData['uid'] ?? 0);
......@@ -283,7 +286,6 @@ class SchedulerModuleController
try {
// Try adding or editing
$content .= $this->editTaskAction($requestUri);
$sectionTitle = $this->getLanguageService()->getLL('action.' . $this->getCurrentAction());
} catch (\LogicException|\UnexpectedValueException|\OutOfBoundsException $e) {
// Catching all types of exceptions that were previously handled and
// converted to messages
......@@ -326,8 +328,8 @@ class SchedulerModuleController
$content .= $this->infoScreenAction();
break;
}
// Wrap the content
return '<h2>' . $sectionTitle . '</h2><div class="tx_scheduler_mod1">' . $content . '</div>';
return $content;
}
/**
......@@ -1409,6 +1411,15 @@ class SchedulerModuleController
return date($dateFormat) . ', GMT ' . date('P') . ')';
}
protected function getSectionTitle(): string
{
$currentAction = (string)$this->getCurrentAction();
return ($this->MOD_SETTINGS['function'] ?? '') === 'scheduler' && ($currentAction === Action::ADD || $currentAction === Action::EDIT)
? $this->getLanguageService()->getLL('action.' . $currentAction)
: '';
}
/**
* Returns the Language Service
* @return LanguageService
......
......@@ -33,7 +33,7 @@
</f:else>
</f:if>
<div class="collapse show" data-state="expanded" id="recordlist-task-group-{groupIterator.index}">
<div class="table-fit">
<div class="table-fit mb-0">
<table class="table table-striped table-hover taskGroup-table">
<thead>
<tr class="taskGroup_{groupIterator.index}">
......
<form name="tx_scheduler_form" id="tx_scheduler_form" method="post">
<h1>{headline}</h1>
<f:if condition="{sectionTitle}">
<h2>{sectionTitle}</h2>
</f:if>
<div class="tx_scheduler_mod1">
<f:format.raw>{content}</f:format.raw>
</div>
<div id="extraFieldsSection"></div>
</form>
<div id="extraFieldsHidden"></div>
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment