[TASK] Move and Namespace classes
[Packages/TYPO3.CMS.git] / typo3 / sysext / recordlist / Classes / Controller / ElementBrowserFramesetController.php
1 <?php
2 namespace TYPO3\CMS\Recordlist\Controller;
3
4 /**
5 * Script Class, putting the frameset together.
6 *
7 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
8 * @package TYPO3
9 * @subpackage core
10 */
11 class ElementBrowserFramesetController {
12
13 // Internal, dynamic
14 /**
15 * @todo Define visibility
16 */
17 public $content;
18
19 /**
20 * Main function.
21 * Creates the header code in XHTML, the JavaScript, then the frameset for the two frames.
22 *
23 * @return void
24 * @todo Define visibility
25 */
26 public function main() {
27 // Setting GPvars:
28 $mode = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('mode');
29 $bparams = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('bparams');
30 // Set doktype:
31 $GLOBALS['TBE_TEMPLATE']->docType = 'xhtml_frames';
32 $GLOBALS['TBE_TEMPLATE']->JScode = $GLOBALS['TBE_TEMPLATE']->wrapScriptTags('
33 function closing() { //
34 close();
35 }
36 function setParams(mode,params) { //
37 parent.content.location.href = "browse_links.php?mode="+mode+"&bparams="+params;
38 }
39 if (!window.opener) {
40 alert("ERROR: Sorry, no link to main window... Closing");
41 close();
42 }
43 ');
44 $this->content .= $GLOBALS['TBE_TEMPLATE']->startPage($GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:TYPO3_Element_Browser'));
45 // URL for the inner main frame:
46 $url = ((($GLOBALS['BACK_PATH'] . 'browse_links.php?mode=') . rawurlencode($mode)) . '&bparams=') . rawurlencode($bparams);
47 // Create the frameset for the window:
48 // Formerly there were a ' onunload="closing();"' in the <frameset> tag - but it failed on Safari browser on Mac unless the handler was "onUnload"
49 $this->content .= ((('
50 <frameset rows="*,1" framespacing="0" frameborder="0" border="0">
51 <frame name="content" src="' . htmlspecialchars($url)) . '" marginwidth="0" marginheight="0" frameborder="0" scrolling="auto" noresize="noresize" />
52 <frame name="menu" src="') . $GLOBALS['BACK_PATH']) . 'dummy.php" marginwidth="0" marginheight="0" frameborder="0" scrolling="no" noresize="noresize" />
53 </frameset>
54 ';
55 $this->content .= '
56 </html>';
57 }
58
59 /**
60 * Outputs the page content.
61 *
62 * @return void
63 * @todo Define visibility
64 */
65 public function printContent() {
66 echo $this->content;
67 }
68
69 }
70
71
72 ?>