diff --git a/config_form.php b/config_form.php index 55b50d7..f8c550c 100644 --- a/config_form.php +++ b/config_form.php @@ -134,7 +134,12 @@ - - - - +
+
+ +
+
+

+ formCheckbox(SearchConfig::OPTION_SEARCHBAR_ON_RESULTS, true, array('checked' => (boolean)get_option(SearchConfig::OPTION_SEARCHBAR_ON_RESULTS))); ?> +
+
diff --git a/models/SearchConfig.php b/models/SearchConfig.php index 8507751..c883aae 100644 --- a/models/SearchConfig.php +++ b/models/SearchConfig.php @@ -9,6 +9,7 @@ define('CONFIG_LABEL_PDFSEARCH', __('PDF Search')); define('CONFIG_LABEL_RELATIONSHIPS_VIEW', __('Relationships View')); define('CONFIG_LABEL_TITLES_ONLY', __('Titles Only')); +define('CONFIG_LABEL_SEARCHBAR_ON_RESULTS', __('Searchbar on results')); class SearchConfig extends ConfigOptions { @@ -21,6 +22,7 @@ class SearchConfig extends ConfigOptions const OPTION_PDFSEARCH = 'avantsearch_pdfsearch'; const OPTION_RELATIONSHIPS_VIEW = 'avantsearch_relationships_view'; const OPTION_TITLES_ONLY = 'avantsearch_titles_only'; + const OPTION_SEARCHBAR_ON_RESULTS = 'avantsearch_searchbar_on_results'; public static function emitInnoDbMessage($engine) { @@ -303,6 +305,7 @@ public static function saveConfiguration() self::saveOptionDataForIntegerSorting(); set_option(self::OPTION_TITLES_ONLY, intval($_POST[self::OPTION_TITLES_ONLY])); + set_option(self::OPTION_SEARCHBAR_ON_RESULTS, intval($_POST[self::OPTION_SEARCHBAR_ON_RESULTS])); set_option(self::OPTION_RELATIONSHIPS_VIEW, intval($_POST[self::OPTION_RELATIONSHIPS_VIEW])); set_option(self::OPTION_ADDRESS_SORTING, intval($_POST[self::OPTION_ADDRESS_SORTING])); set_option(self::OPTION_ELASTICSEARCH, $elasticsearchOption); diff --git a/views/public/simple-searchbar.php b/views/public/simple-searchbar.php new file mode 100644 index 0000000..04c6d7c --- /dev/null +++ b/views/public/simple-searchbar.php @@ -0,0 +1,44 @@ + + + +
+ "> + "> + "> + "> + "> + + → Advanced Search +
+
+ + \ No newline at end of file diff --git a/views/public/table-view.php b/views/public/table-view.php index f24bb1f..f546bbb 100644 --- a/views/public/table-view.php +++ b/views/public/table-view.php @@ -57,6 +57,12 @@ echo head(array('title' => $resultsMessage)); echo "
"; +if(get_option(SearchConfig::OPTION_SEARCHBAR_ON_RESULTS)) +{ + include 'simple-searchbar.php'; + // echo $this->partial('simple-searchbar.php', array('query' => $_REQUEST["keywords"])); +} + $paginationLinks = pagination_links(); echo "
$resultsMessage$paginationLinks
";