From 31b89595185610bc87f7369150303e8c66ef09ff Mon Sep 17 00:00:00 2001
From: Wouter Wolters <typo3@wouterwolters.nl>
Date: Tue, 14 Jul 2015 11:37:26 +0200
Subject: [PATCH] [TASK] Move close.html to ext:backend

To clean the typo3/ directory we move close.html
to ext:backend.

Resolves: #68108
Releases: master
Change-Id: Ieee52bd3ebea8f5c3f1c7f594d6d565864e07a76
Reviewed-on: http://review.typo3.org/41169
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
---
 typo3/close.html                              | 23 -------------------
 .../Controller/EditDocumentController.php     |  6 ++---
 .../Resources/Private/Templates/Close.html    | 15 ++++++++++++
 .../feedit/Classes/FrontendEditPanel.php      |  2 +-
 4 files changed, 19 insertions(+), 27 deletions(-)
 delete mode 100644 typo3/close.html
 create mode 100644 typo3/sysext/backend/Resources/Private/Templates/Close.html

diff --git a/typo3/close.html b/typo3/close.html
deleted file mode 100644
index eb6ab3f35749..000000000000
--- a/typo3/close.html
+++ /dev/null
@@ -1,23 +0,0 @@
-<?xml version="1.0" encoding="iso-8859-1"?>
-<?xml-stylesheet href="#internalStyle" type="text/css"?>
-<!DOCTYPE html
-     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
-     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html>
-<head>
-
-	<!-- Close script, used in particular by FormEngine to close the current edit window -->
-
-	<!-- TYPO3 Script ID: typo3/close.html -->
-	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
-	<title>Close</title>
-			<script type="text/javascript">
-			/*<![CDATA[*/
-				self.close();
-				window.opener.location.reload(true);
-			/*]]>*/
-			</script>
-</head>
-<body>
-</body>
-</html>
diff --git a/typo3/sysext/backend/Classes/Controller/EditDocumentController.php b/typo3/sysext/backend/Classes/Controller/EditDocumentController.php
index c8adb81caa95..ac0f7bef6dc6 100644
--- a/typo3/sysext/backend/Classes/Controller/EditDocumentController.php
+++ b/typo3/sysext/backend/Classes/Controller/EditDocumentController.php
@@ -1255,7 +1255,7 @@ class EditDocumentController {
 	 * @return string
 	 */
 	public function shortCutLink() {
-		if ($this->returnUrl == 'close.html' || !$this->getBackendUser()->mayMakeShortcut()) {
+		if ($this->returnUrl === 'sysext/backend/Resources/Private/Templates/Close.html' || !$this->getBackendUser()->mayMakeShortcut()) {
 			return '';
 		}
 		return $this->doc->makeShortcutIcon('returnUrl,edit,defVals,overrideVals,columnsOnly,returnNewPageId,editRegularContentFromId,noView', '', $this->MCONF['name'], 1);
@@ -1267,10 +1267,10 @@ class EditDocumentController {
 	 * @return string
 	 */
 	public function openInNewWindowLink() {
-		if ($this->returnUrl == 'close.html') {
+		if ($this->returnUrl === 'sysext/backend/Resources/Private/Templates/Close.html') {
 			return '';
 		}
-		$aOnClick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue(GeneralUtility::linkThisScript(array('returnUrl' => 'close.html'))) . ',' . GeneralUtility::quoteJSvalue(md5($this->R_URI)) . ',\'width=670,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
+		$aOnClick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue(GeneralUtility::linkThisScript(array('returnUrl' => 'sysext/backend/Resources/Private/Templates/Close.html'))) . ',' . GeneralUtility::quoteJSvalue(md5($this->R_URI)) . ',\'width=670,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
 		return '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '" title="' . $this->getLanguageService()->sL('LLL:EXT:lang/locallang_core.xlf:labels.openInNewWindow', TRUE) . '">' . IconUtility::getSpriteIcon('actions-window-open') . '</a>';
 	}
 
diff --git a/typo3/sysext/backend/Resources/Private/Templates/Close.html b/typo3/sysext/backend/Resources/Private/Templates/Close.html
new file mode 100644
index 000000000000..e5fbc77bef0b
--- /dev/null
+++ b/typo3/sysext/backend/Resources/Private/Templates/Close.html
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+	<head>
+		<!-- Close script, used in particular by FormEngine to close the current edit window -->
+		<!-- TYPO3 Script ID: typo3/sysext/backend/Resources/Private/Templates/close.html -->
+		<meta charset="utf-8" />
+		<title>Close</title>
+		<script type="text/javascript">
+			self.close();
+			window.opener.location.reload(true);
+		</script>
+	</head>
+	<body>
+	</body>
+</html>
\ No newline at end of file
diff --git a/typo3/sysext/feedit/Classes/FrontendEditPanel.php b/typo3/sysext/feedit/Classes/FrontendEditPanel.php
index c44fbc5f94b7..5ec4eee9d509 100644
--- a/typo3/sysext/feedit/Classes/FrontendEditPanel.php
+++ b/typo3/sysext/feedit/Classes/FrontendEditPanel.php
@@ -285,7 +285,7 @@ class FrontendEditPanel {
 	 * @see editPanelLinkWrap()
 	 */
 	protected function editPanelLinkWrap_doWrap($string, $url) {
-		$onclick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue($url . '&returnUrl=close.html') . ',\'FEquickEditWindow\',\'width=690,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
+		$onclick = 'vHWin=window.open(' . GeneralUtility::quoteJSvalue($url . '&returnUrl=sysext/backend/Resources/Private/Templates/Close.html') . ',\'FEquickEditWindow\',\'width=690,height=500,status=0,menubar=0,scrollbars=1,resizable=1\');vHWin.focus();return false;';
 		return '<a href="#" onclick="' . htmlspecialchars($onclick) . '" class="frontEndEditIconLinks">' . $string . '</a>';
 	}
 
-- 
GitLab