Beispiel #1
0
 /**
  * Initializes the module for display of the settings form.
  *
  * @return	void
  */
 function init()
 {
     $this->MCONF = $GLOBALS['MCONF'];
     // Returns the script user - that is the REAL logged in user! ($GLOBALS[BE_USER] might be another user due to simulation!)
     $scriptUser = $this->getRealScriptUserObj();
     // ... and checking module access for the logged in user.
     $scriptUser->modAccess($this->MCONF, 1);
     $this->isAdmin = $scriptUser->isAdmin();
     // Getting the 'override' values as set might be set in User TSconfig
     $this->overrideConf = $GLOBALS['BE_USER']->getTSConfigProp('setup.override');
     // Getting the disabled fields might be set in User TSconfig (eg setup.fields.password.disabled=1)
     $this->tsFieldConf = $GLOBALS['BE_USER']->getTSConfigProp('setup.fields');
     // Create instance of object for output of data
     $this->doc = t3lib_div::makeInstance('template');
     $this->doc->backPath = $GLOBALS['BACK_PATH'];
     $this->doc->setModuleTemplate('templates/setup.html');
     $this->doc->JScodeLibArray['dyntabmenu'] = $this->doc->getDynTabMenuJScode();
     $this->doc->form = '<form action="index.php" method="post" name="usersetup" enctype="application/x-www-form-urlencoded">';
     $this->doc->tableLayout = array('defRow' => array('0' => array('<td class="td-label">', '</td>'), 'defCol' => array('<td valign="top">', '</td>')));
     $this->doc->table_TR = '<tr>';
     $this->doc->table_TABLE = '<table border="0" cellspacing="1" cellpadding="2" class="typo3-usersettings">';
 }
 /**
  * Constructor, initializing internal variables.
  *
  * @return	void
  */
 function init()
 {
     global $BE_USER, $BACK_PATH, $TBE_MODULES_EXT;
     // Setting class files to include:
     if (is_array($TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses'])) {
         $this->include_once = array_merge($this->include_once, $TBE_MODULES_EXT['xMOD_db_new_content_el']['addElClasses']);
     }
     // Setting internal vars:
     $this->id = intval(t3lib_div::_GP('id'));
     $this->sys_language = intval(t3lib_div::_GP('sys_language_uid'));
     $this->R_URI = t3lib_div::_GP('returnUrl');
     $this->colPos = t3lib_div::_GP('colPos');
     $this->uid_pid = intval(t3lib_div::_GP('uid_pid'));
     $this->MCONF['name'] = 'xMOD_db_new_content_el';
     $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id, 'mod.wizards.newContentElement');
     $config = t3lib_BEfunc::getPagesTSconfig($this->id);
     $this->config = $config['mod.']['wizards.']['newContentElement.'];
     // Starting the document template object:
     $this->doc = t3lib_div::makeInstance('template');
     $this->doc->backPath = $BACK_PATH;
     $this->doc->setModuleTemplate('templates/db_new_content_el.html');
     $this->doc->JScode = '';
     $this->doc->JScodeLibArray['dyntabmenu'] = $this->doc->getDynTabMenuJScode();
     $this->doc->form = '<form action="" name="editForm"><input type="hidden" name="defValues" value="" />';
     // Setting up the context sensitive menu:
     $this->doc->getContextMenuCode();
     // Getting the current page and receiving access information (used in main())
     $perms_clause = $BE_USER->getPagePermsClause(1);
     $this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $perms_clause);
     $this->access = is_array($this->pageinfo) ? 1 : 0;
 }
 /**
  * Initializes the module. See <code>t3lib_SCbase::init()</code> for more information.
  *
  * @return	void
  */
 function init()
 {
     // Setting module configuration:
     $this->MCONF = $GLOBALS['MCONF'];
     // Initialize Document Template object:
     $this->doc = t3lib_div::makeInstance('template');
     $this->doc->backPath = $GLOBALS['BACK_PATH'];
     $this->doc->setModuleTemplate('templates/ws_forms.html');
     $this->doc->form = '<form action="' . t3lib_div::getIndpEnv('SCRIPT_NAME') . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '" name="editform" onsubmit="return TBE_EDITOR.checkSubmit(1);">';
     $this->doc->getContextMenuCode();
     $this->doc->JScode .= $this->doc->getDynTabMenuJScode();
     // Parent initialization:
     t3lib_SCbase::init();
 }
    /**
     * Initialize the normal module operation
     *
     * @return	void
     */
    function init()
    {
        global $BE_USER, $LANG, $BACK_PATH;
        // Setting more GPvars:
        $this->popViewId = t3lib_div::_GP('popViewId');
        $this->popViewId_addParams = t3lib_div::_GP('popViewId_addParams');
        $this->viewUrl = t3lib_div::_GP('viewUrl');
        $this->editRegularContentFromId = t3lib_div::_GP('editRegularContentFromId');
        $this->recTitle = t3lib_div::_GP('recTitle');
        $this->disHelp = t3lib_div::_GP('disHelp');
        $this->noView = t3lib_div::_GP('noView');
        $this->perms_clause = $BE_USER->getPagePermsClause(1);
        // Set other internal variables:
        $this->R_URL_getvars['returnUrl'] = $this->retUrl;
        $this->R_URI = $this->R_URL_parts['path'] . '?' . t3lib_div::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 = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']);
        // Create an instance of the document template object
        $this->doc = $GLOBALS['TBE_TEMPLATE'];
        $this->doc->backPath = $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.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(' . $LANG->JScharCode($LANG->getLL('deleteWarning')) . ')' : '1==1') . '
				)	{
					window.location.href = "tce_db.php?cmd["+table+"]["+id+"][delete]=1&redirect="+escape(url)+"&vC=' . $BE_USER->veriCode() . '&prErr=1&uPT=1";
				}
				return false;
			}
		' . (isset($_POST['_savedokview_x']) && $this->popViewId ? 'if (window.opener) { ' . t3lib_BEfunc::viewOnClick($this->popViewId, '', t3lib_BEfunc::BEgetRootLine($this->popViewId), '', $this->viewUrl, $this->popViewId_addParams, FALSE) . ' } else { ' . t3lib_BEfunc::viewOnClick($this->popViewId, '', t3lib_BEfunc::BEgetRootLine($this->popViewId), '', $this->viewUrl, $this->popViewId_addParams) . ' } ' : '')) . $this->doc->getDynTabMenuJScode();
        // Setting up the context sensitive menu:
        $this->doc->getContextMenuCode();
        $this->doc->bodyTagAdditions = 'onload="window.scrollTo(0,' . t3lib_div::intInRange(t3lib_div::_GP('_scrollPosition'), 0, 10000) . ');"';
    }