Commit 61dfb8f2 authored by Felix Kopp's avatar Felix Kopp Committed by Christian Kuhn
Browse files

[TASK] Move backend templates to extension contexts

Most html templates in backend are used in one extension only.
Those templates should be held in extension context to reduce
dependencies.

Creates extbase/flow directory structures.

Change-Id: I7638092b695d36c4cea2a2755d8285bf92114bb0
Fixes: #47786
Releases: 6.2
Reviewed-on: https://review.typo3.org/20374
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
parent 8ff9ca25
......@@ -59,7 +59,7 @@ class ElementHistoryController {
// Create internal template object:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/show_rechis.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/show_rechis.html');
// Start the page header:
$this->content .= $this->doc->header($GLOBALS['LANG']->getLL('title'));
}
......
......@@ -111,7 +111,7 @@ class MoveElementController {
// Starting the document template object:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/move_el.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/move_el.html');
$this->doc->JScode = '';
// Starting document content (header):
$this->content = '';
......
......@@ -128,7 +128,7 @@ class NewContentElementController {
// Starting the document template object:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/db_new_content_el.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/db_new_content_el.html');
$this->doc->JScode = '';
$this->doc->form = '<form action="" name="editForm"><input type="hidden" name="defValues" value="" />';
// Setting up the context sensitive menu:
......
......@@ -574,7 +574,7 @@ class EditDocumentController {
// Create an instance of the document template object
$this->doc = $GLOBALS['TBE_TEMPLATE'];
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/alt_doc.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/alt_doc.html');
$this->doc->form = '<form action="' . htmlspecialchars($this->R_URI) . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="document.editform._scrollPosition.value=(document.documentElement.scrollTop || document.body.scrollTop); return TBE_EDITOR.checkSubmit(1);">';
$this->doc->getPageRenderer()->loadPrototype();
$this->doc->JScode = $this->doc->wrapScriptTags('
......
......@@ -113,7 +113,7 @@ class CreateFolderController {
$this->title = $icon . htmlspecialchars($this->folderObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->folderObject->getIdentifier());
// Setting template object
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->setModuleTemplate('templates/file_newfolder.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/file_newfolder.html');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->JScode = $this->doc->wrapScriptTags('
var path = "' . $this->target . '";
......
......@@ -106,7 +106,7 @@ class EditFileController {
// Setting template object
// ***************************
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->setModuleTemplate('templates/file_edit.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/file_edit.html');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->JScode = $this->doc->wrapScriptTags('
function backToList() { //
......
......@@ -104,7 +104,7 @@ class FileUploadController {
$this->title = $icon . htmlspecialchars($this->folderObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->folderObject->getIdentifier());
// Setting template object
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->setModuleTemplate('templates/file_upload.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/file_upload.html');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->form = '<form action="tce_file.php" method="post" name="editform" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '">';
}
......
......@@ -111,7 +111,7 @@ class RenameFileController {
$this->title = $icon . htmlspecialchars($this->fileOrFolderObject->getStorage()->getName()) . ': ' . htmlspecialchars($this->fileOrFolderObject->getIdentifier());
// Setting template object
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->setModuleTemplate('templates/file_rename.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/file_rename.html');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->JScode = $this->doc->wrapScriptTags('
function backToList() { //
......
......@@ -102,7 +102,7 @@ class FileSystemNavigationFrameController {
// Create template object:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/alt_file_navframe.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/alt_file_navframe.html');
$this->doc->showFlashMessages = FALSE;
// Adding javascript code for AJAX (prototype), drag&drop and the filetree as well as the click menu code
$this->doc->getDragDropCode('folders');
......
......@@ -174,7 +174,7 @@ class NewRecordController {
// Create instance of template class for output
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/db_new.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/db_new.html');
$this->doc->JScode = '';
// Setting up the context sensitive menu:
$this->doc->getContextMenuCode();
......
......@@ -414,7 +414,7 @@ class PageLayoutController {
// Start document template object:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/db_layout.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/db_layout.html');
// JavaScript:
$this->doc->JScode = '<script type="text/javascript" ' . 'src="' . \TYPO3\CMS\Core\Utility\GeneralUtility::createVersionNumberedFilename(($GLOBALS['BACK_PATH'] . '../t3lib/jsfunc.updateform.js')) . '">' . '</script>';
$this->doc->JScode .= $this->doc->wrapScriptTags('
......@@ -551,7 +551,7 @@ class PageLayoutController {
// If no access or id value, create empty document:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/db_layout.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/db_layout.html');
$this->doc->JScode = $this->doc->wrapScriptTags('
if (top.fsMod) top.fsMod.recentIds["web"] = ' . intval($this->id) . ';
');
......@@ -596,7 +596,7 @@ class PageLayoutController {
*/
public function renderQuickEdit() {
// Alternative template
$this->doc->setModuleTemplate('templates/db_layout_quickedit.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/db_layout_quickedit.html');
// Alternative form tag; Quick Edit submits its content to tce_db.php.
$this->doc->form = '<form action="' . htmlspecialchars(($GLOBALS['BACK_PATH'] . 'tce_db.php?&prErr=1&uPT=1')) . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
// Setting up the context sensitive menu:
......@@ -1123,4 +1123,4 @@ class PageLayoutController {
}
?>
\ No newline at end of file
?>
......@@ -81,7 +81,6 @@ class PageTreeNavigationController {
*/
public $setTempDBmount;
// A static HTML template, usually in templates/alt_db_navframe.html
/**
* @todo Define visibility
*/
......@@ -144,7 +143,7 @@ class PageTreeNavigationController {
// Create template object:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/alt_db_navframe.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/alt_db_navframe.html');
$this->doc->showFlashMessages = FALSE;
// Get HTML-Template
// Adding javascript code for AJAX (prototype), drag&drop and the pagetree as well as the click menu code
......
......@@ -192,7 +192,7 @@ class FormsController {
// Document template object:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/wizard_forms.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/wizard_forms.html');
$this->doc->JScode = $this->doc->wrapScriptTags('
function jumpToUrl(URL,formEl) { //
window.location.href = URL;
......
......@@ -84,7 +84,7 @@ class RteController {
// Starting the document template object:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/wizard_rte.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/wizard_rte.html');
// Need to NOT have the page wrapped in DIV since if we do that we destroy
// the feature that the RTE spans the whole height of the page!!!
$this->doc->divClass = '';
......
......@@ -127,7 +127,7 @@ class TableController {
// Document template object:
$this->doc = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->doc->backPath = $GLOBALS['BACK_PATH'];
$this->doc->setModuleTemplate('templates/wizard_table.html');
$this->doc->setModuleTemplate('EXT:backend/Resources/Private/Templates/wizard_table.html');
$this->doc->JScode = $this->doc->wrapScriptTags('
function jumpToUrl(URL,formEl) { //
window.location.href = URL;
......
......@@ -2398,7 +2398,7 @@ class InlineElement {
/** @var $pageRenderer \TYPO3\CMS\Core\Page\PageRenderer */
$pageRenderer = clone $GLOBALS['SOBE']->doc->getPageRenderer();
$pageRenderer->setCharSet($GLOBALS['LANG']->charSet);
$pageRenderer->setTemplateFile(TYPO3_mainDir . 'templates/helper_javascript_css.html');
$pageRenderer->setTemplateFile('EXT:backend/Resources/Private/Templates/helper_javascript_css.html');
$javaScriptAndStyleSheets = $pageRenderer->render();
return $javaScriptAndStyleSheets;
}
......
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