function sbp_paths_sbp_settings in Search by Page 6
Same name and namespace in other branches
- 7 sbp_paths.module \sbp_paths_sbp_settings()
Implementation of Search by Page hook_sbp_settings().
Adds a few settings to the Search by Page settings page.
File
- ./
sbp_paths.module, line 150 - Module file for Search by Page Paths, a sub-module for Search by Page.
Code
function sbp_paths_sbp_settings($environment) {
$form = array();
$form['sbp_paths'] = array(
'#type' => 'fieldset',
'#collapsible' => TRUE,
'#weight' => -80,
'#title' => t('Paths'),
);
$times = array(
'1' => t('1 second'),
'3600' => t('1 hour'),
'86400' => t('1 day'),
'604800' => t('1 week'),
'31449600' => t('1 year'),
'0' => t('Never'),
);
$form['sbp_paths']['sbp_paths_min_time'] = array(
'#type' => 'select',
'#title' => t('Minimum reindexing time'),
'#options' => $times,
'#default_value' => search_by_page_setting_get('sbp_paths_min_time', $environment, 1),
'#weight' => 5,
'#description' => t("After indexing any new pages added to the environment, Search by Page also cycles through previously-indexed pages, in case the rendered view of the page has changed. On some sites, you may want to limit the amount of reindexing, by setting a minimum time -- the page will not be reindexed until this time has passed."),
);
$form['sbp_paths']['sbp_paths_max_time'] = array(
'#type' => 'select',
'#title' => t('Maximum reindexing time'),
'#options' => $times,
'#default_value' => search_by_page_setting_get('sbp_paths_max_time', $environment, 0),
'#weight' => 6,
'#description' => t("Conversely to the minimum reindexing time (see above), Search by Page can be set to prioritize reindexing each page (by marking it as needing immediate reindexing) after this amount of time has passed. This has higher priority than the cycle-through reindexing of the setting above.") . ' ' . t('But be careful with this setting! If you set it too small, it can interfere with new content being indexed, because the reindexed content will have equal priority to content that has never been indexed. So make sure your settings allow for enough time for new content to be indexed before forcing reindexing.'),
);
return $form;
}