/** * function includeJavascript */ public function addHeaderParts() { // build target URL if not result page unset($linkconf); $linkconf['parameter'] = $this->conf['resultPage']; $linkconf['additionalParams'] = ''; $linkconf['useCacheHash'] = false; $targetUrl = TYPO3\CMS\Core\Utility\GeneralUtility::locationHeaderUrl($this->cObj->typoLink_URL($linkconf)); $content = $this->cObj->getSubpart($this->templateCode, '###JS_SEARCH_ALL###'); if ($this->conf['renderMethod'] != 'static') { $content .= $this->cObj->getSubpart($this->templateCode, '###JS_SEARCH_NON_STATIC###'); } // include js for "ajax after page reload" mode if ($this->conf['renderMethod'] == 'ajax_after_reload') { $content .= $this->cObj->getSubpart($this->templateCode, '###JS_SEARCH_AJAX_RELOAD###'); } // loop through LL and fill $markerArray array_key_exists($this->LLkey, $this->LOCAL_LANG) ? $langKey = $this->LLkey : ($langKey = 'default'); foreach ($this->LOCAL_LANG[$langKey] as $key => $value) { $markerArray['###' . strtoupper($key) . '###'] = $value; } // define some additional markers $markerArray['###SITE_REL_PATH###'] = TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey); $markerArray['###TARGET_URL###'] = $targetUrl; $markerArray['###PREFIX_ID###'] = $this->prefixId; $markerArray['###SEARCHBOX_DEFAULT_VALUE###'] = $this->pi_getLL('searchbox_default_value'); $markerArray['###DOMREADYACTION###'] = $this->onDomReady; $content = $this->cObj->substituteMarkerArray($content, $markerArray); // add JS to page header $GLOBALS['TSFE']->getPageRenderer()->addHeaderData($content); }