For users of search_files, http://drupal.org/project/search_files, the following gives the option to suppress the Search Files tab also.
Nb. This snippet also includes a fix for a typo in the comments
- // Deny access to the 'Content' search tab if the user has chosen to hide it.
+ // Deny access to the 'Users' search tab if the user has chosen to hide it.
Index: modules/suppress_search/suppress_search.settings.admin.inc
===================================================================
--- modules/suppress_search/suppress_search.settings.admin.inc (revision 14353)
+++ modules/suppress_search/suppress_search.settings.admin.inc (working copy)
@@ -35,6 +35,13 @@
'#description' => t('Check this to hide the \'Users\' tab on the search results page. You must clear cache after changing this setting.'),
);
+ $form['suppress_search_hide_files_tab'] = array(
+ '#type' => 'checkbox',
+ '#title' => t('Hide files tab'),
+ '#default_value' => variable_get('suppress_search_hide_files_tab', ''),
+ '#description' => t('Check this to hide the \'Files\' tab on the search results page. You must clear cache after changing this setting.'),
+ );
+
$index_total = db_result(db_query('select count(sid) from {search_index}'));
$dataset_total = db_result(db_query('select count(sid) from {search_dataset}'));
$form['status'] = array('#type' => 'fieldset', '#title' => t('Empty search index'));
Index: modules/suppress_search/suppress_search.module
===================================================================
--- modules/suppress_search/suppress_search.module (revision 14353)
+++ modules/suppress_search/suppress_search.module (working copy)
@@ -77,8 +77,13 @@
$items['search/node/%menu_tail']['access callback'] = FALSE;
}
- // Deny access to the 'Content' search tab if the user has chosen to hide it.
+ // Deny access to the 'Users' search tab if the user has chosen to hide it.
if (variable_get('suppress_search_hide_users_tab', 0)) {
$items['search/user/%menu_tail']['access callback'] = FALSE;
}
+
+ // Deny access to the 'Files' search tab if the user has chosen to hide it.
+ if (variable_get('suppress_search_hide_files_tab', 0)) {
+ $items['search/search_files/%menu_tail']['access callback'] = FALSE;
+ }
}