/** * Adds all the loaded javascript files and snippets to the page. * * Depending on configuration the Javascript is added in header, footer or * not at all if the integrator decides to take care of it himself. * */ public function addJavascriptToPage() { $position = Util::getTypoScriptValue('plugin.tx_solr.javascriptFiles.loadIn'); if (empty($position)) { $position = self::POSITION_NONE; } switch ($position) { case self::POSITION_HEADER: $this->addJavascriptToPageHeader(); break; case self::POSITION_FOOTER: $this->registerForRenderPreProcessHook(); break; case self::POSITION_NONE: // do nothing, JS is handled by the integrator break; default: throw new \RuntimeException('Invalid value "' . $position . '" for Javascript position. Choose from "header", "footer", or "none".', 1336911986); } }