[TASK] Cleanup entry classes in typo3/ part2
[Packages/TYPO3.CMS.git] / typo3 / sysext / recordlist / Classes / Controller / ElementBrowserFramesetController.php
1 <?php
2 namespace TYPO3\CMS\Recordlist\Controller;
3
4 /***************************************************************
5 * Copyright notice
6 *
7 * (c) 1999-2013 Kasper Skårhøj (kasperYYYY@typo3.com)
8 * All rights reserved
9 *
10 * This script is part of the TYPO3 project. The TYPO3 project is
11 * free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * The GNU General Public License can be found at
17 * http://www.gnu.org/copyleft/gpl.html.
18 * A copy is found in the textfile GPL.txt and important notices to the license
19 * from the author is found in LICENSE.txt distributed with these scripts.
20 *
21 *
22 * This script is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU General Public License for more details.
26 *
27 * This copyright notice MUST APPEAR in all copies of the script!
28 ***************************************************************/
29
30 /**
31 * Script Class, putting the frameset together.
32 *
33 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
34 */
35 class ElementBrowserFramesetController {
36
37 // Internal, dynamic
38 /**
39 * @todo Define visibility
40 */
41 public $content;
42
43 /**
44 * Main function.
45 * Creates the header code in XHTML, the JavaScript, then the frameset for the two frames.
46 *
47 * @return void
48 */
49 public function main() {
50 // Setting GPvars:
51 $mode = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('mode');
52 $bparams = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('bparams');
53 // Set doktype:
54 $GLOBALS['TBE_TEMPLATE']->docType = 'xhtml_frames';
55 $GLOBALS['TBE_TEMPLATE']->JScode = $GLOBALS['TBE_TEMPLATE']->wrapScriptTags('
56 function closing() { //
57 close();
58 }
59 function setParams(mode,params) { //
60 parent.content.location.href = "browse_links.php?mode="+mode+"&bparams="+params;
61 }
62 if (!window.opener) {
63 alert("ERROR: Sorry, no link to main window... Closing");
64 close();
65 }
66 ');
67 $this->content .= $GLOBALS['TBE_TEMPLATE']->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:TYPO3_Element_Browser'));
68 // URL for the inner main frame:
69 $url = $GLOBALS['BACK_PATH'] . 'browse_links.php?mode=' . rawurlencode($mode) . '&bparams=' . rawurlencode($bparams);
70 // Create the frameset for the window:
71 // Formerly there were a ' onunload="closing();"' in the <frameset> tag - but it failed on Safari browser on Mac unless the handler was "onUnload"
72 $this->content .= '
73 <frameset rows="*,1" framespacing="0" frameborder="0" border="0">
74 <frame name="content" src="' . htmlspecialchars($url) . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
75 <frame name="menu" src="' . $GLOBALS['BACK_PATH'] . 'dummy.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
76 </frameset>
77 ';
78 $this->content .= '
79 </html>';
80 }
81
82 /**
83 * Outputs the page content.
84 *
85 * @return void
86 */
87 public function printContent() {
88 echo $this->content;
89 }
90
91 }
92
93 ?>