From 0741d8e32320f4578853ae92b242c2f7cd2d339a Mon Sep 17 00:00:00 2001 From: Dries Buytaert Date: Mon, 21 Sep 2009 06:36:54 +0000 Subject: - Patch #550742 by douggreen | Zarabadoo: remove Search box from theme system, default to block system instead. --- modules/search/search-theme-form.tpl.php | 38 -------------------------------- modules/search/search.install | 7 ++++++ modules/search/search.module | 37 +------------------------------ modules/search/search.test | 2 +- modules/system/page.tpl.php | 5 ----- 5 files changed, 9 insertions(+), 80 deletions(-) delete mode 100644 modules/search/search-theme-form.tpl.php (limited to 'modules') diff --git a/modules/search/search-theme-form.tpl.php b/modules/search/search-theme-form.tpl.php deleted file mode 100644 index bee1ad28b..000000000 --- a/modules/search/search-theme-form.tpl.php +++ /dev/null @@ -1,38 +0,0 @@ - - *
- * - *
- * - * - * To check for all available data within $search, use the code below. - * - * '. check_plain(print_r($search, 1)) .''; ?> - * - * @see template_preprocess_search_theme_form() - */ -?> - diff --git a/modules/search/search.install b/modules/search/search.install index 5cb6f887b..7711df0e3 100644 --- a/modules/search/search.install +++ b/modules/search/search.install @@ -15,6 +15,13 @@ function search_uninstall() { variable_del('search_cron_limit'); } +/** + * Implement hook_install(). + */ +function search_install() { + drupal_set_message(t('You can add the search block now.', array('@url' => url('admin/structure/block')))); +} + /** * Implement hook_schema(). */ diff --git a/modules/search/search.module b/modules/search/search.module index c72dfe5b7..35b817d3f 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -117,10 +117,6 @@ function search_help($path, $arg) { */ function search_theme() { return array( - 'search_theme_form' => array( - 'arguments' => array('form' => NULL), - 'template' => 'search-theme-form', - ), 'search_block_form' => array( 'arguments' => array('form' => NULL), 'template' => 'search-block-form', @@ -892,7 +888,7 @@ function search_form($form, &$form_state, $action = '', $keys = '', $type = NULL } /** - * Form builder; Output a search form for the search block and the theme's search box. + * Form builder; Output a search form for the search block's search box. * * @ingroup forms * @see search_box_form_submit() @@ -929,33 +925,6 @@ function search_box_form_submit($form, &$form_state) { $form_state['redirect'] = 'search/node/' . trim($form_state['values'][$form_id]); } -/** - * Process variables for search-theme-form.tpl.php. - * - * The $variables array contains the following arguments: - * - $form - * - * @see search-theme-form.tpl.php - */ -function template_preprocess_search_theme_form(&$variables) { - $variables['search'] = array(); - $hidden = array(); - // Provide variables named after form keys so themers can print each element independently. - foreach (element_children($variables['form']) as $key) { - $type = $variables['form'][$key]['#type']; - if ($type == 'hidden' || $type == 'token') { - $hidden[] = drupal_render($variables['form'][$key]); - } - else { - $variables['search'][$key] = drupal_render($variables['form'][$key]); - } - } - // Hidden form elements have no value to themers. No need for separation. - $variables['search']['hidden'] = implode($hidden); - // Collect all form elements to make it easier to print the whole form. - $variables['search_form'] = implode($variables['search']); -} - /** * Process variables for search-block-form.tpl.php. * @@ -1127,10 +1096,6 @@ function _search_excerpt_replace(&$text) { } function search_forms() { - $forms['search_theme_form']= array( - 'callback' => 'search_box', - 'callback arguments' => array('search_theme_form'), - ); $forms['search_block_form']= array( 'callback' => 'search_box', 'callback arguments' => array('search_block_form'), diff --git a/modules/search/search.test b/modules/search/search.test index e0fae433d..6472dc14d 100644 --- a/modules/search/search.test +++ b/modules/search/search.test @@ -503,7 +503,7 @@ class SearchCommentTestCase extends DrupalWebTestCase { // Search for $title. $edit = array( - 'search_theme_form' => $comment_body, + 'search_block_form' => $comment_body, ); $this->drupalPost('', $edit, t('Search')); $this->assertText($node->title, t('Node found in search results.')); diff --git a/modules/system/page.tpl.php b/modules/system/page.tpl.php index be4921656..417a18c3f 100644 --- a/modules/system/page.tpl.php +++ b/modules/system/page.tpl.php @@ -26,7 +26,6 @@ * in theme settings. * * Navigation: - * - $search_box: HTML to display the search box, empty if search has been disabled. * - $main_menu (array): An array containing the Main menu links for the * site, if they have been configured. * - $secondary_menu (array): An array containing the Secondary menu links for @@ -87,10 +86,6 @@ - - - -
-- cgit v1.2.3