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) { ...@@ -133,6 +133,7 @@ function _search_config_form_search_admin_settings_alter(&$form, $form_state) {
'containing_none' => t('Containing none of the words'), 'containing_none' => t('Containing none of the words'),
'types' => t('Only of the type(s)'), 'types' => t('Only of the type(s)'),
'category' => t('By category'), // @todo: Find correct field naming 'category' => t('By category'), // @todo: Find correct field naming
'language' => t('Languages'),
); );
foreach ($fields as $key => $label) { foreach ($fields as $key => $label) {
$form['content_node_search_config']['fields'][$key] = array( $form['content_node_search_config']['fields'][$key] = array(
......
...@@ -29,29 +29,35 @@ ...@@ -29,29 +29,35 @@
function search_config_node_settings() { function search_config_node_settings() {
$settings = variable_get('search_config', array()); $settings = variable_get('search_config', array());
$settings += array( $settings += array(
'forms' => array( 'forms' => array(),
'toggle_forms' => 0, // Show adv if both forms are present 'fields' => array(),
'move_keyword_search' => 0, // Move keyword search into adv form 'restrictions' => array(),
'advanced_populate' => 0, // Try and repopulate the adv form 'results' => array(),
'advanced_expand' => 'default', // Control the presentation of adv form );
// Controls all 3 'Containing...' fields.
'remove_containing_wrapper' => 'default', $settings['forms'] += array(
), 'toggle_forms' => 0, // Show adv if both forms are present
'fields' => array( 'move_keyword_search' => 0, // Move keyword search into adv form
'containing_any' => array(), 'advanced_populate' => 0, // Try and repopulate the adv form
'containing_phrase' => array(), 'advanced_expand' => 'default', // Control the presentation of adv form
'containing_none' => array(), // Controls all 3 'Containing...' fields.
'types' => array(), 'remove_containing_wrapper' => 'default',
'category' => array(), );
), $settings['fields'] += array(
'restrictions' => array( 'containing_any' => array(),
'admin_bypass' => 1, 'containing_phrase' => array(),
), 'containing_none' => array(),
// 10 is hardcoded in core. 'types' => array(),
'results' => array( 'category' => array(),
'limit' => '10', 'language' => array(),
), );
$settings['results'] += array(
'limit' => '10',
); );
$settings['restrictions'] += array(
'admin_bypass' => 1,
);
foreach ($settings['fields'] as $field => $info) { foreach ($settings['fields'] as $field => $info) {
$settings['fields'][$field] += array( $settings['fields'][$field] += array(
'remove' => 0, // Hides the field 'remove' => 0, // Hides the field
......
...@@ -92,9 +92,9 @@ function _search_config_advanced_form(&$form, $form_state) { ...@@ -92,9 +92,9 @@ function _search_config_advanced_form(&$form, $form_state) {
$fkeys = &$form['basic']['keys']; $fkeys = &$form['basic']['keys'];
$fkeywords = &$form['advanced']['keywords']; $fkeywords = &$form['advanced']['keywords'];
$ftype = &$form['advanced']['type']; $ftype = &$form['advanced']['type'];
$flang = NULL;
if (isset($form['advanced']['language'])) { 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. // 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