/**
     * Constructs this view
     *
     * Defines the global variable SOBE. Normally this is used by the wizards
     * which are one file only. SOBE is used by typo3/template.php. This view is
     * now the class with the global variable name SOBE.
     *
     * Defines the document template object.
     *
     * @return void
     */
    public function __construct(\TYPO3\CMS\Form\Domain\Repository\ContentRepository $repository)
    {
        parent::__construct($repository);
        $GLOBALS['LANG']->includeLLFile('EXT:form/Resources/Private/Language/locallang_wizard.xml');
        $GLOBALS['SOBE'] = $this;
        // Define 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('EXT:form/Resources/Private/Templates/Wizard.html');
        $this->doc->JScode = $this->doc->wrapScriptTags('
			function jumpToUrl(URL,formEl) {
				window.location.href = URL;
			}
		');
        $this->pageRenderer = $this->doc->getPageRenderer();
        $this->pageRenderer->enableConcatenateFiles();
        $this->pageRenderer->enableCompressCss();
        $this->pageRenderer->enableCompressJavascript();
    }
    /**
     * Initialize the normal module operation
     *
     * @return void
     * @todo Define visibility
     */
    public function init()
    {
        // Setting more GPvars:
        $this->popViewId = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('popViewId');
        $this->popViewId_addParams = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('popViewId_addParams');
        $this->viewUrl = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('viewUrl');
        $this->editRegularContentFromId = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('editRegularContentFromId');
        $this->recTitle = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('recTitle');
        $this->disHelp = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('disHelp');
        $this->noView = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('noView');
        $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
        // Set other internal variables:
        $this->R_URL_getvars['returnUrl'] = $this->retUrl;
        $this->R_URI = $this->R_URL_parts['path'] . '?' . \TYPO3\CMS\Core\Utility\GeneralUtility::implodeArrayForUrl('', $this->R_URL_getvars);
        // MENU-ITEMS:
        // If array, then it's a selector box menu
        // If empty string it's just a variable, that'll be saved.
        // Values NOT in this array will not be saved in the settings-array for the module.
        $this->MOD_MENU = array('showPalettes' => '');
        // Setting virtual document name
        $this->MCONF['name'] = 'xMOD_alt_doc.php';
        // CLEANSE SETTINGS
        $this->MOD_SETTINGS = \TYPO3\CMS\Backend\Utility\BackendUtility::getModuleData($this->MOD_MENU, \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET'), $this->MCONF['name']);
        // 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->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('
			function jumpToUrl(URL,formEl) {	//
				if (!TBE_EDITOR.isFormChanged()) {
					window.location.href = URL;
				} else if (formEl && formEl.type=="checkbox") {
					formEl.checked = formEl.checked ? 0 : 1;
				}
			}
				// Object: TS:
				// passwordDummy and decimalSign are used by tbe_editor.js and have to be declared here as
				// TS object overwrites the object declared in tbe_editor.js
			function typoSetup() {	//
				this.uniqueID = "";
				this.passwordDummy = "********";
				this.PATH_typo3 = " ";
				this.decimalSign = ".";
			}
			var TS = new typoSetup();

				// Info view:
			function launchView(table,uid,bP) {	//
				var backPath= bP ? bP : "";
				var thePreviewWindow="";
				thePreviewWindow = window.open(backPath+"show_item.php?table="+encodeURIComponent(table)+"&uid="+encodeURIComponent(uid),"ShowItem"+TS.uniqueID,"height=300,width=410,status=0,menubar=0,resizable=0,location=0,directories=0,scrollbars=1,toolbar=0");
				if (thePreviewWindow && thePreviewWindow.focus) {
					thePreviewWindow.focus();
				}
			}
			function deleteRecord(table,id,url) {	//
				if (
					' . ($GLOBALS['BE_USER']->jsConfirmation(4) ? 'confirm(' . $GLOBALS['LANG']->JScharCode($GLOBALS['LANG']->getLL('deleteWarning')) . ')' : '1==1') . '
				)	{
					window.location.href = "tce_db.php?cmd["+table+"]["+id+"][delete]=1' . \TYPO3\CMS\Backend\Utility\BackendUtility::getUrlToken('tceAction') . '&redirect="+escape(url)+"&vC=' . $GLOBALS['BE_USER']->veriCode() . '&prErr=1&uPT=1";
				}
				return false;
			}
		' . (isset($_POST['_savedokview_x']) && $this->popViewId ? 'if (window.opener) { ' . \TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($this->popViewId, '', \TYPO3\CMS\Backend\Utility\BackendUtility::BEgetRootLine($this->popViewId), '', $this->viewUrl, $this->popViewId_addParams, FALSE) . ' } else { ' . \TYPO3\CMS\Backend\Utility\BackendUtility::viewOnClick($this->popViewId, '', \TYPO3\CMS\Backend\Utility\BackendUtility::BEgetRootLine($this->popViewId), '', $this->viewUrl, $this->popViewId_addParams) . ' } ' : ''));
        // Setting up the context sensitive menu:
        $this->doc->getContextMenuCode();
        $this->doc->bodyTagAdditions = 'onload="window.scrollTo(0,' . \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange(\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('_scrollPosition'), 0, 10000) . ');"';
    }