Esempio n. 1
0
    /**
     * Standard init function of a module.
     *
     * @return	void
     */
    function init()
    {
        global $BE_USER, $LANG, $BACK_PATH, $TYPO3_CONF_VARS;
        /**
         * Extension Categories (static var)
         * Content must be redundant with the same internal variable as in class.tx_extrep.php!
         */
        $this->categories = array('be' => $GLOBALS['LANG']->getLL('category_BE'), 'module' => $GLOBALS['LANG']->getLL('category_BE_modules'), 'fe' => $GLOBALS['LANG']->getLL('category_FE'), 'plugin' => $GLOBALS['LANG']->getLL('category_FE_plugins'), 'misc' => $GLOBALS['LANG']->getLL('category_miscellanous'), 'services' => $GLOBALS['LANG']->getLL('category_services'), 'templates' => $GLOBALS['LANG']->getLL('category_templates'), 'example' => $GLOBALS['LANG']->getLL('category_examples'), 'doc' => $GLOBALS['LANG']->getLL('category_documentation'));
        /**
         * Extension States
         * Content must be redundant with the same internal variable as in class.tx_extrep.php!
         */
        $this->states = tx_em_Tools::getStates();
        $this->script = 'mod.php?M=tools_em';
        $this->privacyNotice = $GLOBALS['LANG']->getLL('privacy_notice');
        $securityMessage = $GLOBALS['LANG']->getLL('security_warning_extensions') . '<br /><br />' . sprintf($GLOBALS['LANG']->getLL('security_descr'), '<a href="http://typo3.org/teams/security/" target="_blank">', '</a>');
        $flashMessage = t3lib_div::makeInstance('t3lib_FlashMessage', $securityMessage, $GLOBALS['LANG']->getLL('security_header'), t3lib_FlashMessage::INFO);
        $this->securityHint = $flashMessage->render();
        $this->excludeForPackaging = $GLOBALS['TYPO3_CONF_VARS']['EXT']['excludeForPackaging'];
        // Setting module configuration:
        $this->MCONF = $GLOBALS['MCONF'];
        // Setting GPvars:
        $this->CMD = is_array(t3lib_div::_GP('CMD')) ? t3lib_div::_GP('CMD') : array();
        $this->lookUpStr = trim(t3lib_div::_GP('lookUp'));
        $this->listRemote = t3lib_div::_GP('ter_connect');
        $this->listRemote_search = trim(t3lib_div::_GP('ter_search'));
        $this->noDocHeader = intval(t3lib_div::_GP('nodoc') > 0);
        $this->settings = t3lib_div::makeInstance('tx_em_Settings');
        $this->install = t3lib_div::makeInstance('tx_em_Install', $this);
        if (t3lib_div::_GP('silentMode') || $this->noDocHeader) {
            $this->CMD['silentMode'] = 1;
            $this->noDocHeader = 1;
        }
        if ($this->CMD['silentMode']) {
            $this->install->setSilentMode(TRUE);
        }
        // Configure menu
        $this->menuConfig();
        // Setting internal static:
        $this->requiredExt = t3lib_div::trimExplode(',', t3lib_extMgm::getRequiredExtensionList(), TRUE);
        // Initialize Document Template object:
        $this->doc = t3lib_div::makeInstance('template');
        $this->doc->backPath = $BACK_PATH;
        $this->doc->setModuleTemplate('templates/em_index.html');
        // Initialize helper objects
        $this->api = t3lib_div::makeInstance('tx_em_API');
        $this->terConnection = t3lib_div::makeInstance('tx_em_Connection_Ter', $this);
        $this->terConnection->wsdlURL = $TYPO3_CONF_VARS['EXT']['em_wsdlURL'];
        $this->xmlHandler = t3lib_div::makeInstance('tx_em_Tools_XmlHandler');
        $this->xmlHandler->emObj = $this;
        $this->xmlHandler->useObsolete = $this->MOD_SETTINGS['display_obsolete'];
        // Initialize newListing
        if (isset($this->MOD_MENU['function']['extensionmanager'])) {
            $this->extensionmanager = t3lib_div::makeInstance('tx_em_ExtensionManager', $this);
        } else {
            $this->extensionmanager =& $this;
        }
        // Output classes
        $this->extensionList = t3lib_div::makeInstance('tx_em_Extensions_List', $this);
        $this->extensionDetails = t3lib_div::makeInstance('tx_em_Extensions_Details', $this);
        $this->translations = t3lib_div::makeInstance('tx_em_Translations', $this);
        // the id is needed for getting same styles TODO: general table styles
        $this->doc->bodyTagId = 'typo3-mod-tools-em-index-php';
        // JavaScript
        $this->doc->JScode = $this->doc->wrapScriptTags('
			script_ended = 0;
			function jumpToUrl(URL)	{	//
				window.location.href = URL;
			}
		');
        // Reload left frame menu
        if ($this->CMD['refreshMenu']) {
            $this->doc->JScode .= $this->doc->wrapScriptTags('
				if(top.refreshMenu) {
					top.refreshMenu();
				} else {
					top.TYPO3ModuleMenu.refreshMenu();
				}
			');
        }
        // Descriptions:
        $this->descrTable = '_MOD_' . $this->MCONF['name'];
        if ($BE_USER->uc['edit_showFieldHelp']) {
            $LANG->loadSingleTableDescription($this->descrTable);
        }
        // Setting username/password etc. for upload-user:
        $this->fe_user['username'] = $this->MOD_SETTINGS['fe_u'];
        $this->fe_user['password'] = $this->MOD_SETTINGS['fe_p'];
        parent::init();
        $this->handleExternalFunctionValue('singleDetails');
    }