str('q') // don't print the search form if search action has been disabled // if (!actionOK('search')) return false; /** * Add the debounce dependency first */ PluginUtility::getSnippetManager()->attachJavascriptFromComponentId(self::COMBO_DEBOUNCE); PluginUtility::getSnippetManager()->attachJavascriptFromComponentId(self::COMBO_SEARCH_BOX); /** * Doku Base is not defined when the * {@link \ComboStrap\TplUtility::CONF_DISABLE_BACKEND_JAVASCRIPT} * is used */ $dokuBase = DOKU_BASE; PluginUtility::getSnippetManager()->attachJavascriptFromComponentId(self::SNIPPET_ID, "var DOKU_BASE='$dokuBase';"); PluginUtility::getSnippetManager()->attachJavascriptFromComponentId(self::SNIPPET_ID); try { $extraClass = $tagAttributes->getClass(""); } catch (ExceptionNull $e) { $extraClass = ""; } try { $id = WikiPath::createRequestedPagePathFromRequest()->getWikiId(); } catch (ExceptionNotFound $e) { LogUtility::error($e->getMessage(), self::CANONICAL,$e);; $id = "not_found"; } $inputSearchId = 'internal-search-box'; // https://getbootstrap.com/docs/5.0/getting-started/accessibility/#visually-hidden-content // $visuallyHidden = "sr-only"; $bootStrapVersion = Bootstrap::getFromContext()->getMajorVersion(); if ($bootStrapVersion == Bootstrap::BootStrapFiveMajorVersion) { $visuallyHidden = "visually-hidden"; } if($bootStrapVersion===Bootstrap::BootStrapFourMajorVersion){ $formInlineClass = "form-inline"; } else { $formInlineClass = "d-flex align-middle mb-0"; } $valueKeyProp = ""; if ($ACT == 'search') $valueKeyProp = ' value="' . htmlspecialchars($QUERY) . '" '; $browserAutoComplete = 'on'; if (!$tagAttributes->getBooleanValue('autocomplete')) { $browserAutoComplete = 'off'; } $tagClass = StyleAttribute::addComboStrapSuffix(self::TAG); $action = wl(); return << EOF; } }