Commit a3e3a616 authored by Wouter Wolters's avatar Wouter Wolters
Browse files

[TASK] Remove ModuleTemplate section calls

Resolves: #71259
Releases: master
Change-Id: I73bd6fbf775899761d362a973c6e56e33df76a18
Reviewed-on: https://review.typo3.org/44465


Reviewed-by: default avatarMarkus Sommer <markussom@posteo.de>
Tested-by: default avatarMarkus Sommer <markussom@posteo.de>
Reviewed-by: Mathias Schreiber's avatarMathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber's avatarMathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: default avatarStefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn's avatarChristian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters's avatarWouter Wolters <typo3@wouterwolters.nl>
parent 445c7539
......@@ -145,7 +145,7 @@ class MoveElementController extends AbstractModule
$onClick = 'window.location.href=' . GeneralUtility::quoteJSvalue(GeneralUtility::linkThisScript(array('makeCopy' => !$this->makeCopy))) . ';';
$headerLine .= '<div><input type="hidden" name="makeCopy" value="0" />' . '<input type="checkbox" name="makeCopy" id="makeCopy" value="1"' . ($this->makeCopy ? ' checked="checked"' : '') . ' onclick="' . htmlspecialchars($onClick) . '" /> <label for="makeCopy" class="t3-label-valign-top">' . $lang->getLL('makeCopy', 1) . '</label></div>';
// Add the header-content to the module content:
$this->content .= $this->moduleTemplate->section('', $headerLine, false, true);
$this->content .= '<div>' . $headerLine . '</div>';
// Reset variable to pick up the module content in:
$code = '';
// IF the table is "pages":
......@@ -227,12 +227,8 @@ class MoveElementController extends AbstractModule
}
}
// Add the $code content as a new section to the module:
$this->content .= $this->moduleTemplate->section(
$lang->getLL('selectPositionOfElement'),
$code,
false,
true
);
$this->content .= '<h2>' . $lang->getLL('selectPositionOfElement') . '</h2>';
$this->content .= '<div>' . $code . '</div>';
}
// Setting up the buttons and markers for docheader
$this->getButtons();
......
......@@ -322,16 +322,13 @@ class NewContentElementController extends AbstractModule
'new-content-element-wizard'
);
$this->content .= $this->moduleTemplate->section(
!$this->onClickEvent ? $lang->getLL('1_selectType') : '',
$code,
0,
1
);
$this->content .= !$this->onClickEvent ? '<h2>' . $lang->getLL('1_selectType', true) . '</h2>' : '';
$this->content .= '<div>' . $code . '</div>';
// If the user must also select a column:
if (!$this->onClickEvent) {
// Add anchor "sel2"
$this->content .= $this->moduleTemplate->section('', '<a name="sel2"></a>');
$this->content .= '<div><a name="sel2"></a></div>';
// Select position
$code = '<p>' . $lang->getLL('sel2', 1) . '</p>';
......@@ -346,7 +343,7 @@ class NewContentElementController extends AbstractModule
$colPosList = implode(',', array_unique(array_map('intval', $colPosIds)));
// Finally, add the content of the column selector to the content:
$code .= $posMap->printContentElementColumns($this->id, 0, $colPosList, 1, $this->R_URI);
$this->content .= $this->moduleTemplate->section($lang->getLL('2_selectPosition'), $code, 0, 1);
$this->content .= '<h2>' . $lang->getLL('2_selectPosition', true) . '</h2><div>' . $code . '</div>';
}
} else {
// In case of no access:
......
......@@ -198,13 +198,8 @@ class CreateFolderController extends AbstractModule
';
// Switching form tags:
$pageContent .= $this->moduleTemplate->section(
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfolders'
),
$code
);
$pageContent .= '</form>';
$pageContent .= '<h3>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfolders', true) . '</h3>';
$pageContent .= '<div>' . $code . '</form></div>';
}
if ($this->folderObject->getStorage()->checkUserActionPermission('add', 'File')) {
......@@ -243,13 +238,8 @@ class CreateFolderController extends AbstractModule
<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
</div>
';
$pageContent .= $this->moduleTemplate->section(
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:online_media.new_media',
true
),
$code
);
$pageContent .= '<h3>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:online_media.new_media', true) . '</h3>';
$pageContent .= '<div>' . $code . '</div>';
$pageContent .= '</form>';
$pageContent .= '<form action="' . BackendUtility::getModuleUrl('tce_file') . '" method="post" name="editform3">';
......@@ -286,13 +276,8 @@ class CreateFolderController extends AbstractModule
<input type="hidden" name="redirect" value="' . htmlspecialchars($this->returnUrl) . '" />
</div>
';
$pageContent .= $this->moduleTemplate->section(
$lang->sL(
'LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfile',
true
),
$code
);
$pageContent .= '<h3>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_newfolder.php.newfile', true) . '</h3>';
$pageContent .= '<div>' . $code . '</div>';
$pageContent .= '</form>';
}
......@@ -306,7 +291,7 @@ class CreateFolderController extends AbstractModule
$buttonBar->addButton($backButton);
}
$this->content .= $this->moduleTemplate->section('', $pageContent);
$this->content .= '<div>' . $pageContent . '</div>';
$this->moduleTemplate->setContent($this->content);
}
......
......@@ -156,7 +156,7 @@ class FileUploadController extends AbstractModule
}
$pageContent .= '</form>';
$this->content .= $this->moduleTemplate->section('', $pageContent);
$this->content .= '<div>' . $pageContent . '</div>';
$this->moduleTemplate->setContent($this->content);
}
......
......@@ -184,7 +184,7 @@ class RenameFileController extends AbstractModule
$this->content = '<h1>' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:file_rename.php.pagetitle') . '</h1>';
// add section
$this->content .= $this->moduleTemplate->section('', $pageContent);
$this->content .= '<div>' . $pageContent . '</div>';
$this->moduleTemplate->setContent($this->content);
}
......
......@@ -215,7 +215,7 @@ class ReplaceFileController extends AbstractModule
$this->content .= '<h1>' . $lang->sL('LLL:EXT:lang/locallang_core.xlf:file_replace.php.pagetitle') . '</h1>';
// Add the HTML as a section:
$this->content .= $this->moduleTemplate->section('', $code);
$this->content .= '<div>' . $code . '</div>';
$this->moduleTemplate->setContent($this->content);
}
......
......@@ -294,7 +294,7 @@ class NewRecordController extends AbstractModule
$this->pagesOnly();
}
// Add all the content to an output section
$this->content .= $this->moduleTemplate->section('', $this->code);
$this->content .= '<div>' . $this->code . '</div>';
// Setting up the buttons and markers for docheader
$this->getButtons();
// Build the <body> for the module
......@@ -585,6 +585,8 @@ class NewRecordController extends AbstractModule
$row .= '</ul></li>';
$finalRows[] = $row;
}
$finalRows[] = '</ul>';
// Make table:
$this->code .= implode('', $finalRows);
}
......
......@@ -837,13 +837,13 @@ class PageLayoutController
}
} catch (AccessDeniedException $e) {
// If no edit access, print error message:
$content = $this->moduleTemplate->section($lang->getLL('noAccess'), $lang->getLL('noAccess_msg')
. '<br /><br />'
. ($beUser->errorMsg ? 'Reason: ' . $beUser->errorMsg . '<br /><br />' : ''), 0, 1);
$content = '<h2>' . $lang->getLL('noAccess', true) . '</h2>';
$conten .= '<div>' . $lang->getLL('noAccess_msg') . '<br /><br />' . ($beUser->errorMsg ? 'Reason: ' . $beUser->errorMsg . '<br /><br />' : '') . '</div>';
}
} else {
// If no edit access, print error message:
$content = $this->moduleTemplate->section($lang->getLL('noAccess'), $lang->getLL('noAccess_msg'), 0, 1);
$content = '<h2>' . $lang->getLL('noAccess') . '</h2>';
$content .= '<div>' . $lang->getLL('noAccess_msg') . '</div>';
}
// Element selection matrix:
......
......@@ -216,18 +216,16 @@ class RteController extends AbstractWizardController
. $formResultCompiler->printNeededJSFunctions();
} else {
// ERROR:
$this->content .= $this->moduleTemplate->section(
$this->getLanguageService()->getLL('forms_title'),
'<span class="text-danger">'
$this->content .= '<h2>' . $this->getLanguageService()->getLL('forms_title', true) . '</h2>'
. '<div><span class="text-danger">'
. $this->getLanguageService()->getLL('table_noData', true)
. '</span>',
0,
1
);
. '</span></div>';
}
// Setting up the buttons and markers for docHeader
$this->getButtons();
// Build the <body> for the module
$this->content .= '</form>';
$this->moduleTemplate->setContent($this->content);
}
......
......@@ -161,19 +161,11 @@ class TableController extends AbstractWizardController
{
$this->content .= '<form action="' . htmlspecialchars($rUri) . '" method="post" id="TableController" name="wizardForm">';
if ($this->P['table'] && $this->P['field'] && $this->P['uid']) {
$this->content .= $this->moduleTemplate->section(
$this->getLanguageService()->getLL('table_title'),
$this->tableWizard(),
0,
1
);
$this->content .= '<h2>' . $this->getLanguageService()->getLL('table_title', true) . '</h2>'
. '<div>' . $this->tableWizard() . '</div>';
} else {
$this->content .= $this->moduleTemplate->section(
$this->getLanguageService()->getLL('table_title'),
'<span class="text-danger">' . $this->getLanguageService()->getLL('table_noData', true) . '</span>',
0,
1
);
$this->content .= '<h2>' . $this->getLanguageService()->getLL('table_title', true) . '</h2>'
. '<div><span class="text-danger">' . $this->getLanguageService()->getLL('table_noData', true) . '</span></div>';;
}
$this->content .= '</form>';
// Setting up the buttons and markers for docHeader
......
......@@ -39,7 +39,7 @@ use TYPO3\CMS\Core\Utility\GeneralUtility;
* $store->processStoreControl();
*
* // show control panel
* $this->content .= $this->doc->section('Settings', $store->getStoreControl(), 0, 1);
* $this->content .= '<h2>Settings</h2>' . '<div>' . $store->getStoreControl() . '</div>';
*
* Format of saved settings
*
......
......@@ -330,7 +330,7 @@ class QueryView
}
$msg = $this->procesStoreControl();
if (!$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableStoreControl']) {
$output .= $GLOBALS['SOBE']->getModuleTemplate()->section('Load/Save Query', $this->makeStoreControl(), 0, 1);
$output .= '<h2>Load/Save Query</h2><div>' . $this->makeStoreControl() . '</div>';
if ($msg) {
$output .= '<br />' . $msg;
}
......@@ -343,7 +343,7 @@ class QueryView
$qGen->setFormName($this->formName);
}
$tmpCode = $qGen->makeSelectorTable($GLOBALS['SOBE']->MOD_SETTINGS);
$output .= '<div id="query"></div>' . $GLOBALS['SOBE']->getModuleTemplate()->section('Make query', $tmpCode, 0, 1);
$output .= '<div id="query"></div>' . '<h2>Make query</h2><div>' . $tmpCode . '</div>';
$mQ = $GLOBALS['SOBE']->MOD_SETTINGS['search_query_makeQuery'];
// Make form elements:
if ($qGen->table && is_array($GLOBALS['TCA'][$qGen->table])) {
......@@ -362,16 +362,16 @@ class QueryView
}
}
if (!$GLOBALS['BE_USER']->userTS['mod.']['dbint.']['disableShowSQLQuery']) {
$output .= $GLOBALS['SOBE']->getModuleTemplate()->section('SQL query', $this->tableWrap(htmlspecialchars($qExplain)), 0, 1);
$output .= '<h2>SQL query</h2><div>' . $this->tableWrap(htmlspecialchars($qExplain)) . '</div>';
}
$res = @$GLOBALS['TYPO3_DB']->sql_query($qExplain);
if ($GLOBALS['TYPO3_DB']->sql_error()) {
$out = '<BR><strong>Error:</strong><BR><font color="red"><strong>' . $GLOBALS['TYPO3_DB']->sql_error() . '</strong></font>';
$output .= $GLOBALS['SOBE']->getModuleTemplate()->section('SQL error', $out, 0, 1);
$output .= '<h2>SQL error</h2><div>' . $out . '</div>';
} else {
$cPR = $this->getQueryResultCode($mQ, $res, $qGen->table);
$GLOBALS['TYPO3_DB']->sql_free_result($res);
$output .= $GLOBALS['SOBE']->getModuleTemplate()->section($cPR['header'], $cPR['content'], 0, 1);
$output .= '<h2>' . $cPR['header'] . '</h2><div>' . $cPR['content'] . '</div>';
}
}
}
......
......@@ -102,24 +102,18 @@ class ModuleController extends BaseScriptClass
// Debug log:
switch ($this->MOD_SETTINGS['function']) {
case 'info':
$this->content .= $this->moduleTemplate->section(
$languageService->getLL('Cached_info'),
$this->printCachedInfo()
);
$this->content .= '<h3>' . $languageService->getLL('Cached_info') . '</h3>';
$this->content .= '<div>' . $this->printCachedInfo() . '</div>';
$shortcutName = $languageService->getLL('Cached_info');
break;
case 'sqlcheck':
$this->content .= $this->moduleTemplate->section(
$languageService->getLL('SQL_check'),
$this->printSqlCheck()
);
$this->content .= '<h3>' . $languageService->getLL('SQL_check') . '</h3>';
$this->content .= '<div>' . $this->printSqlCheck() . '</div>';
$shortcutName = $languageService->getLL('SQL_check');
break;
case 0:
$this->content .= $this->moduleTemplate->section(
$languageService->getLL('Debug_log'),
$this->printLogMgm()
);
$this->content .= '<h3>' . $languageService->getLL('Debug_log') . '</h3>';
$this->content .= '<div>' . $this->printLogMgm() . '</div>';
break;
}
// ShortCut
......
......@@ -127,7 +127,7 @@ class PageFunctionsController extends \TYPO3\CMS\Backend\Module\BaseScriptClass
$this->content .= '<form action="' . htmlspecialchars(BackendUtility::getModuleUrl('web_func')) . '" id="PageFunctionsController" method="post"><input type="hidden" name="id" value="' . htmlspecialchars($this->id) . '" />';
$vContent = $this->moduleTemplate->getVersionSelector($this->id, true);
if ($vContent) {
$this->content .= $this->moduleTemplate->section('', $vContent);
$this->content .= '<div>' . $vContent . '</div>';
}
$this->extObjContent();
// Setting up the buttons and markers for docheader
......
......@@ -152,7 +152,7 @@ class ImportExportController extends BaseScriptClass
. '<input type="hidden" name="id" value="' . $this->id . '" />';
// Input data grabbed:
$inData = GeneralUtility::_GP('tx_impexp');
$this->content .= $this->moduleTemplate->sectionHeader($this->lang->getLL('title_' . (string)$inData['action']));
$this->content .= '<h3>' . $this->lang->getLL('title_' . (string)$inData['action'], true) . '</h3>';
$this->content .= '<div style="padding-top: 5px;"></div>';
$this->checkUpload();
switch ((string)$inData['action']) {
......@@ -556,9 +556,9 @@ class ImportExportController extends BaseScriptClass
$content = $this->moduleTemplate->getDynamicTabMenu($menuItems, 'tx_impexp_export', 1, false, true, false);
$content .= '<input type="hidden" name="tx_impexp[action]" value="export" />';
$this->content .= $this->moduleTemplate->section('', $content, 0, 1);
$this->content .= '<div>' . $content . '</div>';
// Output Overview:
$this->content .= $this->moduleTemplate->section($this->lang->getLL('execlistqu_structureToBeExported'), $overViewContent, 0, 1);
$this->content .= '<h2>' . $this->lang->getLL('execlistqu_structureToBeExported', true) . '</h2><div>' . $overViewContent . '</div>';
}
/**
......@@ -1286,12 +1286,12 @@ class ImportExportController extends BaseScriptClass
$content = '<div style="border: 1px black solid; margin: 10px 10px 10px 10px; padding: 10px 10px 10px 10px;">'
. $this->moduleTemplate->icons(1) . htmlspecialchars($extensionInstallationMessage) . '</div>' . $content;
}
$this->content .= $this->moduleTemplate->section('', $content, 0, 1);
$this->content .= '<div>' . $content . '</div>';
// Print overview:
if ($overviewContent) {
$this->content .= $this->moduleTemplate->section($inData['import_file']
$this->content .= '<h2>' . ($inData['import_file']
? $this->lang->getLL('importdata_structureHasBeenImported', true)
: $this->lang->getLL('filterpage_structureToBeImported', true), $overviewContent, 0, 1);
: $this->lang->getLL('filterpage_structureToBeImported', true)) . '</h2><div>' . $overviewContent . '</div>';
}
}
}
......
......@@ -119,7 +119,7 @@ class InfoModuleController extends BaseScriptClass
'" method="post" id="InfoModuleController" name="webinfoForm" class="form-inline form-inline-spaced">';
$vContent = $this->moduleTemplate->getVersionSelector($this->id, 1);
if ($vContent) {
$this->content .= $this->moduleTemplate->section('', $vContent);
$this->content .= '<div>' . $vContent . '</div>';
}
$this->extObjContent();
// Setting up the buttons and markers for docheader
......
......@@ -309,8 +309,8 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
$content .= $this->infoScreenAction();
break;
}
// Wrap the content in a section
return $this->moduleTemplate->section($sectionTitle, '<div class="tx_scheduler_mod1">' . $content . '</div>', false, true);
// Wrap the content
return '<h2>' . $sectionTitle . '</h2><div class="tx_scheduler_mod1">' . $content . '</div>';
}
/**
......
......@@ -402,7 +402,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
$this->getDatabaseConnection()->sql_free_result($res);
// If any records found
if (!empty($userList)) {
$content .= '<br />' . $this->taskObject->getModuleTemplate()->section($this->getLanguageService()->getLL('action_t1_listOfUsers'), implode('<br />', $userList));
$content .= '<br /><h3>' . $this->getLanguageService()->getLL('action_t1_listOfUsers', true) . '</h3><div>' . implode('<br />', $userList) . '</div>';
}
return $content;
}
......@@ -771,7 +771,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface
. $this->getLanguageService()->getLL(($queryIsEmpty ? 'action_createQuery'
: 'action_editQuery')) . '</a><br /><br />';
}
$content .= $this->taskObject->getModuleTemplate()->section($this->getLanguageService()->getLL('action_t2_result'), $actionContent, 0, 1);
$content .= '<h2>' . $this->getLanguageService()->getLL('action_t2_result', true) . '</h2><div>' . $actionContent . '</div>';
} else {
// Query is not configured
$flashMessage = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Messaging\FlashMessage::class, $this->getLanguageService()->getLL('action_notReady', true), $this->getLanguageService()->getLL('action_error'), \TYPO3\CMS\Core\Messaging\FlashMessage::ERROR);
......
......@@ -248,7 +248,7 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
'</table></div>';
$this->content = $this->doc->header($lang->getLL('moduleTitle'));
$this->content .= $this->moduleTemplate->section('', '<p class="lead">' . $lang->getLL('overview') . '</p>' . $table);
$this->content .= '<div><p class="lead">' . $lang->getLL('overview') . '</p>' . $table . '</div>';
// RENDER LIST of pages with templates, END
// Setting up the buttons and markers for docheader
......@@ -494,16 +494,15 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
$staticsText = '';
}
// Extension?
$theOutput .= $this->moduleTemplate->section(
$lang->getLL('newWebsite') . $staticsText,
'<p>' . $lang->getLL('newWebsiteDescription') . '</p>' . $selector . '<input class="btn btn-primary" type="submit" form="TypoScriptTemplateModuleController" name="newWebsite" value="' . $lang->getLL('newWebsiteAction') . '" />',
0, 1);
$theOutput .= '<h2>' . $lang->getLL('newWebsite', true) . $staticsText . '</h2>';
$theOutput .= '<div><p>' . $lang->getLL('newWebsiteDescription') . '</p>' . $selector
. '<input class="btn btn-primary" type="submit" form="TypoScriptTemplateModuleController" name="newWebsite" value="'
. $lang->getLL('newWebsiteAction') . '" /></div>';
}
// Extension?
$theOutput .= $this->moduleTemplate->section(
$lang->getLL('extTemplate'),
'<p>' . $lang->getLL('extTemplateDescription') . '</p>' . '<input class="btn btn-default" type="submit" form="TypoScriptTemplateModuleController" name="createExtension" value="' . $lang->getLL('extTemplateAction') . '" />',
0, 1);
$theOutput .= '<h2>' . $lang->getLL('extTemplate') . '</h2>';
$theOutput .= '<div><p>' . $lang->getLL('extTemplateDescription') . '</p>' . '<input class="btn btn-default" type="submit" form="TypoScriptTemplateModuleController" name="createExtension" value="' . $lang->getLL('extTemplateAction') . '" /></div>';
// Go to first appearing...
$first = $tmpl->ext_prevPageWithTemplate($this->id, $this->perms_clause);
if ($first) {
......@@ -511,10 +510,8 @@ class TypoScriptTemplateModuleController extends BaseScriptClass
'id' => $first['uid']
);
$aHref = BackendUtility::getModuleUrl('web_ts', $urlParameters);
$theOutput .= $this->moduleTemplate->section(
$lang->getLL('goToClosest'),
sprintf('<p>' . $lang->getLL('goToClosestDescription') . '</p>%s' . $lang->getLL('goToClosestAction') . '%s', htmlspecialchars($first['title']), $first['uid'], '<a class="btn btn-default" href="' . htmlspecialchars($aHref) . '">', '</a>'),
0, 1);
$theOutput .= '<h3>' . $lang->getLL('goToClosest') . '</h3>';
$theOutput .= '<div>' . sprintf('<p>' . $lang->getLL('goToClosestDescription') . '</p>%s' . $lang->getLL('goToClosestAction') . '%s', htmlspecialchars($first['title']), $first['uid'], '<a class="btn btn-default" href="' . htmlspecialchars($aHref) . '">', '</a>') . '</div>';
}
return $theOutput;
}
......
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