From fe77e77431ce9b8afcfc733c2831ae5ef3cbd1f8 Mon Sep 17 00:00:00 2001 From: Steven Wittens Date: Tue, 28 Feb 2006 21:10:04 +0000 Subject: [PATCH] - #49405: Minor advanced search UI/code tweaks --- misc/drupal.css | 3 +- modules/node.module | 60 ++++++++++++++++++++++++++++++++++------ modules/node/node.module | 60 ++++++++++++++++++++++++++++++++++------ 3 files changed, 104 insertions(+), 19 deletions(-) diff --git a/misc/drupal.css b/misc/drupal.css index 9b21676cdc8..cc2b4816acc 100644 --- a/misc/drupal.css +++ b/misc/drupal.css @@ -434,11 +434,12 @@ img.screenshot { .search-results .search-info { font-size: 0.85em; } -.search-advanced .criterium { +.search-advanced .criterion { float: left; margin-right: 2em; } .search-advanced .action { + float: left; clear: left; } #tracker td.replies { diff --git a/modules/node.module b/modules/node.module index 0199432a5bd..5f6e61a9d9a 100644 --- a/modules/node.module +++ b/modules/node.module @@ -736,22 +736,64 @@ function node_search($op = 'search', $keys = null) { $form = array(); // Keyword boxes - $form['advanced'] = array('#type' => 'fieldset', '#title' => t('Advanced search'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#attributes' => array('class' => 'search-advanced')); - - $form['advanced']['keywords'] = array('#type' => 'markup', '#prefix' => '
', '#suffix' => '
'); - $form['advanced']['keywords']['or'] = array('#type' => 'textfield', '#title' => t('Containing any of the words'), '#size' => 30, '#maxlength' => 255); - $form['advanced']['keywords']['phrase'] = array('#type' => 'textfield', '#title' => t('Containing the phrase'), '#size' => 30, '#maxlength' => 255); - $form['advanced']['keywords']['negative'] = array('#type' => 'textfield', '#title' => t('Containing none of the words'), '#size' => 30, '#maxlength' => 255); + $form['advanced'] = array( + '#type' => 'fieldset', + '#title' => t('Advanced search'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#attributes' => array('class' => 'search-advanced'), + ); + $form['advanced']['keywords'] = array( + '#prefix' => '
', + '#suffix' => '
', + ); + $form['advanced']['keywords']['or'] = array( + '#type' => 'textfield', + '#title' => t('Containing any of the words'), + '#size' => 30, + '#maxlength' => 255, + ); + $form['advanced']['keywords']['phrase'] = array( + '#type' => 'textfield', + '#title' => t('Containing the phrase'), + '#size' => 30, + '#maxlength' => 255, + ); + $form['advanced']['keywords']['negative'] = array( + '#type' => 'textfield', + '#title' => t('Containing none of the words'), + '#size' => 30, + '#maxlength' => 255, + ); // Taxonomy box if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) { - $form['advanced']['category'] = array('#type' => 'select', '#title' => t('Only in the category'), '#prefix' => '
', '#suffix' => '
', '#options' => $taxonomy, '#extra' => 'size="10"', '#multiple' => true); + $form['advanced']['category'] = array( + '#type' => 'select', + '#title' => t('Only in the category(s)'), + '#prefix' => '
', + '#size' => 10, + '#suffix' => '
', + '#options' => $taxonomy, + '#multiple' => TRUE, + ); } // Node types $types = node_get_types(); - $form['advanced']['type'] = array('#type' => 'checkboxes', '#title' => t('Only of the type'), '#prefix' => '
', '#suffix' => '
', '#options' => $types); - $form['advanced']['submit'] = array('#type' => 'submit', '#value' => t('Advanced Search'), '#prefix' => '
', '#suffix' => '
'); + $form['advanced']['type'] = array( + '#type' => 'checkboxes', + '#title' => t('Only of the type(s)'), + '#prefix' => '
', + '#suffix' => '
', + '#options' => $types, + ); + $form['advanced']['submit'] = array( + '#type' => 'submit', + '#value' => t('Advanced search'), + '#prefix' => '
', + '#suffix' => '

', + ); return $form; case 'post': diff --git a/modules/node/node.module b/modules/node/node.module index 0199432a5bd..5f6e61a9d9a 100644 --- a/modules/node/node.module +++ b/modules/node/node.module @@ -736,22 +736,64 @@ function node_search($op = 'search', $keys = null) { $form = array(); // Keyword boxes - $form['advanced'] = array('#type' => 'fieldset', '#title' => t('Advanced search'), '#collapsible' => TRUE, '#collapsed' => TRUE, '#attributes' => array('class' => 'search-advanced')); - - $form['advanced']['keywords'] = array('#type' => 'markup', '#prefix' => '
', '#suffix' => '
'); - $form['advanced']['keywords']['or'] = array('#type' => 'textfield', '#title' => t('Containing any of the words'), '#size' => 30, '#maxlength' => 255); - $form['advanced']['keywords']['phrase'] = array('#type' => 'textfield', '#title' => t('Containing the phrase'), '#size' => 30, '#maxlength' => 255); - $form['advanced']['keywords']['negative'] = array('#type' => 'textfield', '#title' => t('Containing none of the words'), '#size' => 30, '#maxlength' => 255); + $form['advanced'] = array( + '#type' => 'fieldset', + '#title' => t('Advanced search'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#attributes' => array('class' => 'search-advanced'), + ); + $form['advanced']['keywords'] = array( + '#prefix' => '
', + '#suffix' => '
', + ); + $form['advanced']['keywords']['or'] = array( + '#type' => 'textfield', + '#title' => t('Containing any of the words'), + '#size' => 30, + '#maxlength' => 255, + ); + $form['advanced']['keywords']['phrase'] = array( + '#type' => 'textfield', + '#title' => t('Containing the phrase'), + '#size' => 30, + '#maxlength' => 255, + ); + $form['advanced']['keywords']['negative'] = array( + '#type' => 'textfield', + '#title' => t('Containing none of the words'), + '#size' => 30, + '#maxlength' => 255, + ); // Taxonomy box if ($taxonomy = module_invoke('taxonomy', 'form_all', 1)) { - $form['advanced']['category'] = array('#type' => 'select', '#title' => t('Only in the category'), '#prefix' => '
', '#suffix' => '
', '#options' => $taxonomy, '#extra' => 'size="10"', '#multiple' => true); + $form['advanced']['category'] = array( + '#type' => 'select', + '#title' => t('Only in the category(s)'), + '#prefix' => '
', + '#size' => 10, + '#suffix' => '
', + '#options' => $taxonomy, + '#multiple' => TRUE, + ); } // Node types $types = node_get_types(); - $form['advanced']['type'] = array('#type' => 'checkboxes', '#title' => t('Only of the type'), '#prefix' => '
', '#suffix' => '
', '#options' => $types); - $form['advanced']['submit'] = array('#type' => 'submit', '#value' => t('Advanced Search'), '#prefix' => '
', '#suffix' => '
'); + $form['advanced']['type'] = array( + '#type' => 'checkboxes', + '#title' => t('Only of the type(s)'), + '#prefix' => '
', + '#suffix' => '
', + '#options' => $types, + ); + $form['advanced']['submit'] = array( + '#type' => 'submit', + '#value' => t('Advanced search'), + '#prefix' => '
', + '#suffix' => '

', + ); return $form; case 'post':