diff --git a/includes/form.inc b/includes/form.inc index c6d2b7c..44e018a 100644 --- a/includes/form.inc +++ b/includes/form.inc @@ -23,21 +23,20 @@ function bootstrap_form_alter(&$form, &$form_state, $form_id) { * Implements hook_form_FORM_ID_alter() for search_form(). */ function bootstrap_form_search_form_alter(&$form, &$form_state) { - $form['#attributes']['class'][] = 'form-search'; - $form['#attributes']['class'][] = 'pull-left'; + // Add a clearfix class so the results don't overflow onto the form. + $form['#attributes']['class'][] = 'clearfix'; - $form['basic']['keys']['#title'] = ''; - $form['basic']['keys']['#attributes']['class'][] = 'col-sm-2'; - $form['basic']['keys']['#attributes']['placeholder'] = t('Search'); + // Remove container-inline from the container classes. + $form['basic']['#attributes']['class'] = array(); - // Hide the default button from display and implement a theme wrapper to add - // a submit button containing a search icon directly after the input element. + // Hide the default button from display. $form['basic']['submit']['#attributes']['class'][] = 'element-invisible'; - $form['basic']['keys']['#theme_wrappers'][] = 'bootstrap_search_form_wrapper'; - // Apply a clearfix so the results don't overflow onto the form. - $form['#suffix'] = '
'; - $form['#attributes']['class'][] = 'content-search'; + // Implement a theme wrapper to add a submit button containing a search icon + // directly after the input element. + $form['basic']['keys']['#theme_wrappers'] = array('bootstrap_search_form_wrapper'); + $form['basic']['keys']['#title'] = ''; + $form['basic']['keys']['#attributes']['placeholder'] = t('Search'); } /** @@ -47,13 +46,12 @@ function bootstrap_form_search_block_form_alter(&$form, &$form_state) { $form['#attributes']['class'][] = 'form-search'; $form['search_block_form']['#title'] = ''; - $form['search_block_form']['#attributes']['class'][] = 'col-sm-2'; $form['search_block_form']['#attributes']['placeholder'] = t('Search'); // Hide the default button from display and implement a theme wrapper to add // a submit button containing a search icon directly after the input element. $form['actions']['submit']['#attributes']['class'][] = 'element-invisible'; - $form['search_block_form']['#theme_wrappers'][] = 'bootstrap_search_form_wrapper'; + $form['search_block_form']['#theme_wrappers'] = array('bootstrap_search_form_wrapper'); // Apply a clearfix so the results don't overflow onto the form. $form['#attributes']['class'][] = 'content-search'; diff --git a/template.php b/template.php index 38554e9..2b51ac7 100755 --- a/template.php +++ b/template.php @@ -261,29 +261,30 @@ function bootstrap_process_block(&$variables, $hook) { * @ingroup themable */ function bootstrap_bootstrap_search_form_wrapper(&$variables) { - $output = '
'; - $output .= $variables['element']['#children']; - $output .= ''; - // fixme: in firefox (padding is of by 2 px) style="padding-top: 5px; padding-bottom: 5px" - $output .= ''; + $output .= ''; + $output .= '
'; + return $output; } - $output .= ''; - $output .= ''; - $output .= ''; - - return $output; - } +} - /** +/** * Implements hook_preprocess_icon(). * * bootstrap need additional class glyphicon to display icons * * @see icon_preprocess_icon_image() * @see template_preprocess_icon() -*/ + */ function bootstrap_preprocess_icon(&$variables) { $bundle = &$variables['bundle'];