summaryrefslogtreecommitdiff
path: root/modules/search
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2005-10-11 19:44:35 +0000
committerDries Buytaert <dries@buytaert.net>2005-10-11 19:44:35 +0000
commit75fe6b6c0ae85d2b53cb803d5b028b050fd6d454 (patch)
tree70ea02551300ed5a696b4d289cfc4722924d58ca /modules/search
parentecf5ed57d66a182ae0e269942169e0a6cf3a3912 (diff)
downloadbrdo-75fe6b6c0ae85d2b53cb803d5b028b050fd6d454.tar.gz
brdo-75fe6b6c0ae85d2b53cb803d5b028b050fd6d454.tar.bz2
- Patch #33752 by chx, adrian, et al: another batch of form API changes/fixes.
Diffstat (limited to 'modules/search')
-rw-r--r--modules/search/search.module26
1 files changed, 13 insertions, 13 deletions
diff --git a/modules/search/search.module b/modules/search/search.module
index 51286d631..adc020eb5 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -143,19 +143,19 @@ function search_settings() {
$count = format_plural($remaining, 'There is 1 item left to index.', 'There are %count items left to index.');
$percentage = ((int)min(100, 100 * ($total - $remaining) / max(1, $total))) . '%';
$status = '<p><strong>'. t('%percentage of the site has been indexed.', array('%percentage' => $percentage)) .' '. $count .'</strong></p>';
- $form['search_admin'] = array(type => 'fieldset', title => t('Indexing status'));
- $form['search_admin']['status'] = array(type => 'markup', value => $status);
+ $form['search_admin'] = array('#type' => 'fieldset', '#title' => t('Indexing status'));
+ $form['search_admin']['status'] = array('#type' => 'markup', '#value' => $status);
$items = drupal_map_assoc(array(10, 20, 50, 100, 200, 500));
// Indexing throttle:
- $form['indexing_throttle'] = array(type => 'fieldset', title => t('Indexing throttle'));
- $form['indexing_throttle']['search_cron_limit'] = array(type => 'select', title => t('Items to index per cron run'), default_value => variable_get('search_cron_limit', 100), options => $items, description => t('The maximum amount of items that will be indexed in one cron run. Set this number lower if your cron is timing out or if PHP is running out of memory.'));
+ $form['indexing_throttle'] = array('#type' => 'fieldset', '#title' => t('Indexing throttle'));
+ $form['indexing_throttle']['search_cron_limit'] = array('#type' => 'select', '#title' => t('Items to index per cron run'), '#default_value' => variable_get('search_cron_limit', 100), '#options' => $items, '#description' => t('The maximum amount of items that will be indexed in one cron run. Set this number lower if your cron is timing out or if PHP is running out of memory.'));
// Indexing settings:
- $form['indexing_settings'] = array(type => 'fieldset', title => t('Indexing settings'));
- $form['indexing_settings']['info'] = array(type => 'markup', value => '<em>'. t('<p>Changing the setting below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.</p><p>The default settings should be appropriate for the majority of sites.</p>') .'</em>');
- $form['indexing_settings']['minimum_word_size'] = array(type => 'textfield', title => t('Minimum word length to index'), default_value => variable_get('minimum_word_size', 3), size => 5, maxlength => 3, description => t('The number of characters a word has to be to be indexed. Words shorter than this will not be searchable.'));
- $form['indexing_settings']['remove_short'] = array(type => 'textfield', title => t('Minimum word length to search for'), default_value => variable_get('remove_short', 3), size => 5, maxlength => 3, description => t('The number of characters a word has to be to be searched for, including wildcard characters.'));
+ $form['indexing_settings'] = array('#type' => 'fieldset', '#title' => t('Indexing settings'));
+ $form['indexing_settings']['info'] = array('#type' => 'markup', '#value' => '<em>'. t('<p>Changing the setting below will cause the site index to be rebuilt. The search index is not cleared but systematically updated to reflect the new settings. Searching will continue to work but new content won\'t be indexed until all existing content has been re-indexed.</p><p>The default settings should be appropriate for the majority of sites.</p>') .'</em>');
+ $form['indexing_settings']['minimum_word_size'] = array('#type' => 'textfield', '#title' => t('Minimum word length to index'), '#default_value' => variable_get('minimum_word_size', 3), '#size' => 5, '#maxlength' => 3, '#description' => t('The number of characters a word has to be to be indexed. Words shorter than this will not be searchable.'));
+ $form['indexing_settings']['remove_short'] = array('#type' => 'textfield', '#title' => t('Minimum word length to search for'), '#default_value' => variable_get('remove_short', 3), '#size' => 5, '#maxlength' => 3, '#description' => t('The number of characters a word has to be to be searched for, including wildcard characters.'));
return $form;
}
@@ -647,11 +647,11 @@ function search_form($action = '', $keys = '', $type = null, $prompt = null) {
$prompt = t('Enter your keywords');
}
- $form[action] = $action;
- $form['prompt'] = array(type => 'item', title => $prompt);
- $form['keys'] = array(type => 'textfield', title => '', default_value => $keys, size => $prompt ? 40 : 30, maxlength => 255);
- $form['submit'] = array(type => 'submit', value => t('Search'));
- $form[attributes] = array('class' => 'search-form');
+ $form['#action'] = $action;
+ $form['prompt'] = array('#type' => 'item', '#title' => $prompt);
+ $form['keys'] = array('#type' => 'textfield', '#title' => '', '#default_value' => $keys, '#size' => $prompt ? 40 : 30, '#maxlength' => 255);
+ $form['submit'] = array('#type' => 'submit', '#value' => t('Search'));
+ $form['#attributes'] = array('class' => 'search-form');
return drupal_get_form('search_form', $form);
}