Commit 918bbb8c authored by Alan Davison's avatar Alan Davison
Browse files

Issues 1270630 by Alan D., bbbo: Added language field visibility settings.

parent 6ec04dbc
......@@ -133,6 +133,7 @@ function _search_config_form_search_admin_settings_alter(&$form, $form_state) {
'containing_none' => t('Containing none of the words'),
'types' => t('Only of the type(s)'),
'category' => t('By category'), // @todo: Find correct field naming
'language' => t('Languages'),
);
foreach ($fields as $key => $label) {
$form['content_node_search_config']['fields'][$key] = array(
......
......@@ -29,29 +29,35 @@
function search_config_node_settings() {
$settings = variable_get('search_config', array());
$settings += array(
'forms' => 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',
),
'fields' => array(
);
$settings['fields'] += array(
'containing_any' => array(),
'containing_phrase' => array(),
'containing_none' => array(),
'types' => array(),
'category' => array(),
),
'restrictions' => array(
'admin_bypass' => 1,
),
// 10 is hardcoded in core.
'results' => array(
'language' => array(),
);
$settings['results'] += array(
'limit' => '10',
),
);
$settings['restrictions'] += array(
'admin_bypass' => 1,
);
foreach ($settings['fields'] as $field => $info) {
$settings['fields'][$field] += array(
'remove' => 0, // Hides the field
......
......@@ -92,9 +92,9 @@ function _search_config_advanced_form(&$form, $form_state) {
$fkeys = &$form['basic']['keys'];
$fkeywords = &$form['advanced']['keywords'];
$ftype = &$form['advanced']['type'];
$flang = NULL;
if (isset($form['advanced']['language'])) {
$flang = &$form['advanced']['language'];
$fs_language = $settings['fields']['language'];
$form['advanced']['language']['#access'] = search_config_get_access($fs_language['remove'], $fs_language['roles']);
}
// Change the form fieldset.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment