function search_config_node_settings in Search configuration 7
Same name and namespace in other branches
- 8 search_config.module \search_config_node_settings()
Helper function to get the settings.
6 calls to search_config_node_settings()
- search_config_form_search_form_alter in ./
search_config.module - Implements of hook_form_FORM_alter().
- search_config_install in ./
search_config.install - Implements hook_install().
- search_config_query_node_access_alter in ./
search_config.module - Implements of hook_query_node_access_alter().
- search_config_update_7000 in ./
search_config.install - Provides the upgrade from 6.x to 7.x
- _search_config_advanced_form in ./
search_config.node.inc - This function implements the options to configure the default Drupal search form, including type filter, field visibility, form visibility, etc.
File
- ./
search_config.module, line 29 - Main functionality for the Search Configuration module.
Code
function search_config_node_settings() {
$settings = variable_get('search_config', array());
$settings += array(
'forms' => array(),
'fields' => array(),
'restrictions' => array(),
'results' => array(),
);
$settings['forms'] += array(
'toggle_forms' => 0,
// Show adv if both forms are present
'move_keyword_search' => 0,
// Move keyword search into adv form
'advanced_populate' => 0,
// Try and repopulate the adv form
'advanced_expand' => 'default',
// Control the presentation of adv form
// Controls all 3 'Containing...' fields.
'remove_containing_wrapper' => 'default',
);
$settings['fields'] += array(
'containing_any' => array(),
'containing_phrase' => array(),
'containing_none' => array(),
'types' => array(),
'category' => array(),
'language' => array(),
);
$settings['results'] += array(
'limit' => '10',
);
$settings['restrictions'] += array(
'admin_bypass' => 1,
'remove_advanced' => 0,
);
foreach ($settings['fields'] as $field => $info) {
$settings['fields'][$field] += array(
'remove' => 0,
// Hides the field
'roles' => array(),
);
if ($field == 'types') {
$settings['fields'][$field] += array(
'filter' => array(),
// Content type to HIDE
'groupings' => array(),
);
}
// @todo: What features do we need here?
if ($field == 'category') {
$settings['fields'][$field] += array(
'filter' => array(),
// Vocabs to HIDE
'widget' => 'textfield',
);
}
}
return $settings;
}