/**
  * Add inline code to the HTML
  * 
  * @param string $name
  * @param string $block
  * @param array $conf
  * @return void
  */
 function addJsInlineCode($name, $block, $conf = array())
 {
     if ($conf['jsinline']) {
         $GLOBALS['TSFE']->inlineJS['t3jquery.jsdata.' . $name] = $block;
     } elseif (tx_t3jquery::getIntFromVersion(TYPO3_version) >= 4003000) {
         $pagerender = $GLOBALS['TSFE']->getPageRenderer();
         if ($conf['tofooter'] == 'footer') {
             $pagerender->addJsFooterInlineCode($name, $block, $conf['compress'], $conf['forceOnTop']);
         } else {
             $pagerender->addJsInlineCode($name, $block, $conf['compress'], $conf['forceOnTop']);
         }
     } else {
         if ($conf['compress']) {
             $block = t3lib_div::minifyJavaScript($block);
         }
         if ($conf['tofooter'] == 'footer') {
             $GLOBALS['TSFE']->additionalFooterData['t3jquery.jsdata.' . $name] = t3lib_div::wrapJS($block, TRUE);
         } else {
             $GLOBALS['TSFE']->additionalHeaderData['t3jquery.jsdata.' . $name] = t3lib_div::wrapJS($block, TRUE);
         }
     }
 }
    /**
     * Shows the update Message
     * @return	string
     */
    public function displayMessage(&$params, &$tsObj)
    {
        $out = '';
        if (tx_t3jquery::getIntFromVersion(TYPO3_version) < 4003000) {
            // 4.3.0 comes with flashmessages styles. For older versions we include the needed styles here
            $cssPath = $GLOBALS['BACK_PATH'] . t3lib_extMgm::extRelPath('t3jquery');
            $out .= '<link rel="stylesheet" type="text/css" href="' . $cssPath . 'compat/flashmessages.css" media="screen" />';
        }
        // get all supported UI-Versions from folder
        $supportedUiVersions = t3lib_div::get_dirs(t3lib_div::getFileAbsFileName("EXT:t3jquery/res/jquery/ui/"));
        if (is_array($supportedUiVersions)) {
            foreach ($supportedUiVersions as $supportedUiVersion) {
                if (file_exists(t3lib_div::getFileAbsFileName("EXT:t3jquery/res/jquery/ui/") . $supportedUiVersion . '/jquery.xml')) {
                    $this->supportedUiVersion[] = $supportedUiVersion;
                }
            }
        }
        // get all supported TOOLS-Versions from folder
        $supportedToolsVersions = t3lib_div::get_dirs(t3lib_div::getFileAbsFileName("EXT:t3jquery/res/jquery/tools/"));
        if (is_array($supportedToolsVersions)) {
            foreach ($supportedToolsVersions as $supportedToolsVersion) {
                if (file_exists(t3lib_div::getFileAbsFileName("EXT:t3jquery/res/jquery/tools/") . $supportedToolsVersion . '/jquery.xml')) {
                    $this->supportedToolsVersion[] = $supportedToolsVersion;
                }
            }
        }
        // get the conf array
        $this->confArr = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['t3jquery']);
        // if form is submited, the POST values are taken
        $post = t3lib_div::_POST();
        if (count($post) > 0) {
            $jQueryUiVersion = $post['data']['jQueryUiVersion'];
            $jQueryToolsVersion = $post['data']['jQueryTOOLSVersion'];
            $jQueryVersion = $post['data']['jQueryVersion'] . "-" . $post['data']['jQueryUiVersion'] . ($post['data']['jQueryTOOLSVersion'] ? "-" . $post['data']['jQueryTOOLSVersion'] : "");
            $configDir = $post['data']['configDir'] . (preg_match("/\\/\$/", $configDir) ? "" : "/");
        } else {
            $jQueryUiVersion = $this->confArr['jQueryUiVersion'];
            $jQueryToolsVersion = $this->confArr['jQueryTOOLSVersion'];
            $jQueryVersion = T3JQUERYVERSION;
            $configDir = tx_t3jquery::getJqPath();
        }
        if ($this->checkConfig() === FALSE) {
            $out .= '
	<div class="typo3-message message-warning">
		<div class="message-header">' . $GLOBALS['LANG']->sL('LLL:EXT:t3jquery/locallang.xml:extmng.checkConfigHeader') . '</div>
		<div class="message-body">
			' . $GLOBALS['LANG']->sL('LLL:EXT:t3jquery/locallang.xml:extmng.checkConfig') . '
		</div>
	</div>';
        } elseif ($this->confArr['integrateFromCDN'] || $post['data']['integrateFromCDN']) {
            // Nothing to check
        } else {
            // check the actual version
            if ($jQueryUiVersion && !in_array($jQueryUiVersion, $this->supportedUiVersion) || $jQueryToolsVersion && !in_array($jQueryToolsVersion, $this->supportedToolsVersion)) {
                $out .= '
	<div class="typo3-message message-information">
		<div class="message-header">' . $GLOBALS['LANG']->sL('LLL:EXT:t3jquery/locallang.xml:extmng.updatermsgHeader') . '</div>
		<div class="message-body">
			' . $GLOBALS['LANG']->sL('LLL:EXT:t3jquery/locallang.xml:extmng.updatermsg') . '
		</div>
	</div>';
            }
            // Check if the library exists
            if (!file_exists(PATH_site . $configDir . tx_t3jquery::getJqName())) {
                $out .= '
	<a href="javascript:void();" onclick="top.goToModule(\'tools_txt3jqueryM1\',\'\',\'createLib=1\');this.blur();return false;">
		<div class="typo3-message message-warning">
			<div class="message-header">' . $GLOBALS['LANG']->sL('LLL:EXT:t3jquery/locallang.xml:extmng.updatermsgHeader2') . '</div>
			<div class="message-body">
				' . sprintf($GLOBALS['LANG']->sL('LLL:EXT:t3jquery/locallang.xml:extmng.updatermsg2'), $configDir . tx_t3jquery::getJqName()) . '
			</div>
		</div>
	</a>';
            }
        }
        $out = '<div style="position:absolute;top:10px;right:10px; width:300px;">' . $out . '</div>';
        return $out;
    }