/**
  * Initializes <code>t3lib_TCEform</code> class for use in this module.
  *
  * @return	void
  */
 function initTCEForms()
 {
     $this->tceforms = t3lib_div::makeInstance('t3lib_TCEforms');
     $this->tceforms->initDefaultBEMode();
     $this->tceforms->backPath = $GLOBALS['BACK_PATH'];
     $this->tceforms->doSaveFieldName = 'doSave';
     $this->tceforms->localizationMode = t3lib_div::inList('text,media', $this->localizationMode) ? $this->localizationMode : '';
     // text,media is keywords defined in TYPO3 Core API..., see "l10n_cat"
     $this->tceforms->returnUrl = $this->R_URI;
     $this->tceforms->palettesCollapsed = !$this->MOD_SETTINGS['showPalettes'];
     $this->tceforms->disableRTE = $this->MOD_SETTINGS['disableRTE'];
     $this->tceforms->enableClickMenu = true;
     $this->tceforms->enableTabMenu = true;
     // Setting external variables:
     if ($GLOBALS['BE_USER']->uc['edit_showFieldHelp'] != 'text' && $this->MOD_SETTINGS['showDescriptions']) {
         $this->tceforms->edit_showFieldHelp = 'text';
     }
 }
Exemple #2
0
 /**
  * Main module operation
  *
  * @return	void
  */
 function main()
 {
     global $BE_USER, $LANG;
     // Begin edit:
     if (is_array($this->editconf)) {
         // Initialize TCEforms (rendering the forms)
         $this->tceforms = t3lib_div::makeInstance('t3lib_TCEforms');
         $this->tceforms->initDefaultBEMode();
         $this->tceforms->doSaveFieldName = 'doSave';
         $this->tceforms->localizationMode = t3lib_div::inList('text,media', $this->localizationMode) ? $this->localizationMode : '';
         // text,media is keywords defined in TYPO3 Core API..., see "l10n_cat"
         $this->tceforms->returnUrl = $this->R_URI;
         $this->tceforms->palettesCollapsed = !$this->MOD_SETTINGS['showPalettes'];
         $this->tceforms->disableRTE = !$BE_USER->isRTE();
         $this->tceforms->enableClickMenu = TRUE;
         $this->tceforms->enableTabMenu = TRUE;
         // Clipboard is initialized:
         $this->tceforms->clipObj = t3lib_div::makeInstance('t3lib_clipboard');
         // Start clipboard
         $this->tceforms->clipObj->initializeClipboard();
         // Initialize - reads the clipboard content from the user session
         // Setting external variables:
         $this->tceforms->edit_showFieldHelp = $BE_USER->uc['edit_showFieldHelp'];
         if ($this->editRegularContentFromId) {
             $this->editRegularContentFromId();
         }
         // Creating the editing form, wrap it with buttons, document selector etc.
         $editForm = $this->makeEditForm();
         if ($editForm) {
             $this->firstEl = reset($this->elementsData);
             // Checking if the currently open document is stored in the list of "open documents" - if not, then add it:
             if ((strcmp($this->docDat[1], $this->storeUrlMd5) || !isset($this->docHandler[$this->storeUrlMd5])) && !$this->dontStoreDocumentRef) {
                 $this->docHandler[$this->storeUrlMd5] = array($this->storeTitle, $this->storeArray, $this->storeUrl, $this->firstEl);
                 $BE_USER->pushModuleData('alt_doc.php', array($this->docHandler, $this->storeUrlMd5));
                 t3lib_BEfunc::setUpdateSignal('tx_opendocs::updateNumber', count($this->docHandler));
             }
             // Module configuration
             $this->modTSconfig = $this->viewId ? t3lib_BEfunc::getModTSconfig($this->viewId, 'mod.xMOD_alt_doc') : array();
             $body .= $this->tceforms->printNeededJSFunctions_top();
             $body .= $this->compileForm($editForm);
             $body .= $this->tceforms->printNeededJSFunctions();
             $body .= $this->functionMenus();
             $body .= $this->tceformMessages();
         }
     }
     // Access check...
     // The page will show only if there is a valid page and if this page may be viewed by the user
     $this->pageinfo = t3lib_BEfunc::readPageAccess($this->viewId, $this->perms_clause);
     // Setting up the buttons and markers for docheader
     $docHeaderButtons = $this->getButtons();
     $markers = array('LANGSELECTOR' => $this->langSelector(), 'EXTRAHEADER' => $this->extraFormHeaders(), 'CSH' => $docHeaderButtons['csh'], 'CONTENT' => $body);
     // Build the <body> for the module
     $this->content = $this->doc->startPage('TYPO3 Edit Document');
     $this->content .= $this->doc->moduleBody($this->pageinfo, $docHeaderButtons, $markers);
     $this->content .= $this->doc->endPage();
     $this->content = $this->doc->insertStylesAndJS($this->content);
 }