function hook_sbp_settings in Search by Page 6
Same name and namespace in other branches
- 7 search_by_page.api.php \hook_sbp_settings()
Add settings to the Search by Page settings screen (sub-module hook).
The returned form array is displayed as a component of the page at URL admin/settings/search_by_page/%env, and the settings are automatically saved using the form element names and the search_by_page_setting_set() function.
If your module has no settings, you need not implement this hook. If your module has many settings, you can also define your own settings page with path 'admin/settings/search_by_page/whatever' of type MENU_LOCAL_TASK, to add a tab to the settings page. You can use the function search_by_page_setting_get() to retrieve the setting.
Note that the database of paths is updated after the settings are submitted, so you do not need to do anything special to make this happen if you use this hook. If you use your own settings page, you may want to make use of these three functions: search_by_page_force_reindex() search_by_page_force_remove() search_by_page_rebuild_paths()
Parameters
$environment: ID of environment for settings.
Return value
Form API array that defines one or more fieldsets to add to the Search by Page settings screen at admin/settings/search_by_page/%env. If you want to use weights for your fieldsets, choose numbers between -98 and -1.
4 functions implement hook_sbp_settings()
Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.
- sbp_attach_sbp_settings in ./
sbp_attach.module - Implementation of Search by Page hook_sbp_settings().
- sbp_nodes_sbp_settings in ./
sbp_nodes.module - Implementation of Search by Page hook_sbp_settings().
- sbp_paths_sbp_settings in ./
sbp_paths.module - Implementation of Search by Page hook_sbp_settings().
- sbp_users_sbp_settings in ./
sbp_users.module - Implementation of Search by Page hook_sbp_settings().
1 invocation of hook_sbp_settings()
- search_by_page_admin_settings in ./
search_by_page.module - Returns the admin settings page for a single search environment.
File
- ./
search_by_page.api.php, line 197 - Search by Page module API.
Code
function hook_sbp_settings($environment) {
$form = array();
// add your settings form components here
return $form;
}