summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorNeil Drumm <drumm@3064.no-reply.drupal.org>2006-03-31 04:57:49 +0000
committerNeil Drumm <drumm@3064.no-reply.drupal.org>2006-03-31 04:57:49 +0000
commitb22d877ff84ad31b17d19090b8480ca2911ccef4 (patch)
tree3b6400c238092d9cfe9da3992cda1a183c7d6fe7 /modules
parenta539a3aa40f1e5575313c5d70a46baa2a47f6938 (diff)
downloadbrdo-b22d877ff84ad31b17d19090b8480ca2911ccef4.tar.gz
brdo-b22d877ff84ad31b17d19090b8480ca2911ccef4.tar.bz2
#56457 by chx: The search box that can be displayed by some themes (e.g. bluemarine) was not working.
Diffstat (limited to 'modules')
-rw-r--r--modules/search.module25
-rw-r--r--modules/search/search.module25
-rw-r--r--modules/system.module3
-rw-r--r--modules/system/system.module3
4 files changed, 30 insertions, 26 deletions
diff --git a/modules/search.module b/modules/search.module
index 647b856e0..d7129c1e7 100644
--- a/modules/search.module
+++ b/modules/search.module
@@ -969,7 +969,6 @@ function search_view() {
* An HTML string containing the search form.
*/
function search_form($action = '', $keys = '', $type = NULL, $prompt = NULL) {
-
if (!$action) {
$action = url('search/'. $type);
}
@@ -980,7 +979,6 @@ function search_form($action = '', $keys = '', $type = NULL, $prompt = NULL) {
$form = array(
'#action' => $action,
'#attributes' => array('class' => 'search-form'),
- '#redirect' => FALSE,
);
$form['module'] = array('#type' => 'value', '#value' => $type);
$form['basic'] = array('#type' => 'item', '#title' => $prompt);
@@ -992,7 +990,8 @@ function search_form($action = '', $keys = '', $type = NULL, $prompt = NULL) {
'#size' => $prompt ? 40 : 20,
'#maxlength' => 255,
);
- // processed_keys is used to coordinate keyword passing between other forms that hook into the basic search form.
+ // processed_keys is used to coordinate keyword passing between other forms
+ // that hook into the basic search form.
$form['basic']['inline']['processed_keys'] = array('#type' => 'value', '#value' => array());
$form['basic']['inline']['submit'] = array('#type' => 'submit', '#value' => t('Search'));
@@ -1000,27 +999,31 @@ function search_form($action = '', $keys = '', $type = NULL, $prompt = NULL) {
}
/**
- * As the search form collates keys from other modules hooked in via hook_form_alter, the validation
- * takes place in _submit. search_form_validate() is used solely to set the #ref property for the basic
+ * As the search form collates keys from other modules hooked in via
+ * hook_form_alter, the validation takes place in _submit.
+ * search_form_validate() is used solely to set the #ref property for the basic
* search form.
*/
-function search_form_validate($form_id, $form_values) {
- $form_values['processed_keys']['#ref'] = trim($form_values['keys']);
+function search_form_validate($form_id, $form_values, $form) {
+ $form['basic']['inline']['processed_keys']['#ref'] = trim($form_values['keys']);
}
/**
- * Process a search form submission. Uses a forms API #ref to accept processed search keys
- * from forms that hook into the default search form.
+ * Process a search form submission.
*/
function search_form_submit($form_id, $form_values) {
- $keys = $form_values['processed_keys']['#ref'];
+ $keys = $form_values['processed_keys'];
if ($keys == '') {
form_set_error('keys', t('Please enter some keywords.'));
// Fall through to the drupal_goto() call.
}
$type = $form_values['module'] ? $form_values['module'] : 'node';
- drupal_goto('search/'. $type .'/'. $keys);
+ return 'search/'. $type .'/'. $keys;
+}
+
+function search_box_submit($form_id, $form_values) {
+ return 'search/node/'. trim($form_values['keys']);
}
/**
diff --git a/modules/search/search.module b/modules/search/search.module
index 647b856e0..d7129c1e7 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -969,7 +969,6 @@ function search_view() {
* An HTML string containing the search form.
*/
function search_form($action = '', $keys = '', $type = NULL, $prompt = NULL) {
-
if (!$action) {
$action = url('search/'. $type);
}
@@ -980,7 +979,6 @@ function search_form($action = '', $keys = '', $type = NULL, $prompt = NULL) {
$form = array(
'#action' => $action,
'#attributes' => array('class' => 'search-form'),
- '#redirect' => FALSE,
);
$form['module'] = array('#type' => 'value', '#value' => $type);
$form['basic'] = array('#type' => 'item', '#title' => $prompt);
@@ -992,7 +990,8 @@ function search_form($action = '', $keys = '', $type = NULL, $prompt = NULL) {
'#size' => $prompt ? 40 : 20,
'#maxlength' => 255,
);
- // processed_keys is used to coordinate keyword passing between other forms that hook into the basic search form.
+ // processed_keys is used to coordinate keyword passing between other forms
+ // that hook into the basic search form.
$form['basic']['inline']['processed_keys'] = array('#type' => 'value', '#value' => array());
$form['basic']['inline']['submit'] = array('#type' => 'submit', '#value' => t('Search'));
@@ -1000,27 +999,31 @@ function search_form($action = '', $keys = '', $type = NULL, $prompt = NULL) {
}
/**
- * As the search form collates keys from other modules hooked in via hook_form_alter, the validation
- * takes place in _submit. search_form_validate() is used solely to set the #ref property for the basic
+ * As the search form collates keys from other modules hooked in via
+ * hook_form_alter, the validation takes place in _submit.
+ * search_form_validate() is used solely to set the #ref property for the basic
* search form.
*/
-function search_form_validate($form_id, $form_values) {
- $form_values['processed_keys']['#ref'] = trim($form_values['keys']);
+function search_form_validate($form_id, $form_values, $form) {
+ $form['basic']['inline']['processed_keys']['#ref'] = trim($form_values['keys']);
}
/**
- * Process a search form submission. Uses a forms API #ref to accept processed search keys
- * from forms that hook into the default search form.
+ * Process a search form submission.
*/
function search_form_submit($form_id, $form_values) {
- $keys = $form_values['processed_keys']['#ref'];
+ $keys = $form_values['processed_keys'];
if ($keys == '') {
form_set_error('keys', t('Please enter some keywords.'));
// Fall through to the drupal_goto() call.
}
$type = $form_values['module'] ? $form_values['module'] : 'node';
- drupal_goto('search/'. $type .'/'. $keys);
+ return 'search/'. $type .'/'. $keys;
+}
+
+function search_box_submit($form_id, $form_values) {
+ return 'search/node/'. trim($form_values['keys']);
}
/**
diff --git a/modules/system.module b/modules/system.module
index d52197656..a0dc4eb26 100644
--- a/modules/system.module
+++ b/modules/system.module
@@ -1194,8 +1194,7 @@ function system_theme_settings($key = '') {
* Output a search form.
*/
function search_box($path = NULL) {
- $form['#action'] = is_null($path) ? url('search') : url($path);
- $form['keys'] = array('#type' => 'textfield', '#size'=> 15, '#value' => '', '#attributes' => array('alt' => t('Enter the terms you wish to search for.')));
+ $form['keys'] = array('#type' => 'textfield', '#size'=> 15, '#default_value' => '', '#attributes' => array('alt' => t('Enter the terms you wish to search for.')));
$form['submit'] = array('#type' => 'submit', '#value' => t('Search'));
return drupal_get_form('search_box', $form);
}
diff --git a/modules/system/system.module b/modules/system/system.module
index d52197656..a0dc4eb26 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1194,8 +1194,7 @@ function system_theme_settings($key = '') {
* Output a search form.
*/
function search_box($path = NULL) {
- $form['#action'] = is_null($path) ? url('search') : url($path);
- $form['keys'] = array('#type' => 'textfield', '#size'=> 15, '#value' => '', '#attributes' => array('alt' => t('Enter the terms you wish to search for.')));
+ $form['keys'] = array('#type' => 'textfield', '#size'=> 15, '#default_value' => '', '#attributes' => array('alt' => t('Enter the terms you wish to search for.')));
$form['submit'] = array('#type' => 'submit', '#value' => t('Search'));
return drupal_get_form('search_box', $form);
}