You are here

function _dxpr_theme_helper_search_block_content in DXPR Theme Helper 7

Helper function to generate content for full_screen_search

1 call to _dxpr_theme_helper_search_block_content()
dxpr_theme_helper_block_view in ./dxpr_theme_helper.module
Implements hook_block_view().

File

./dxpr_theme_helper.module, line 81

Code

function _dxpr_theme_helper_search_block_content() {
  $search_form = drupal_get_form('search_block_form');
  $search_form['search_block_form']['#prefix'] = '<div class="full-screen-search-form-input">';
  $search_form['search_block_form']['#prefix'] .= '<label class="text-primary">' . t('Type and Press “enter” to Search') . '</label>';
  $search_form['search_block_form']['#suffix'] = '</div>';
  $search_form['search_block_form']['#attributes']['placeholder'] = '';
  $search_form['search_block_form']['#attributes']['autocomplete'] = 'off';
  $search_form['search_block_form']['#attributes']['class'][] = 'search-query';
  $search_form['#attributes']['class'][] = 'element-invisible';
  $search_form['#attributes']['class'][] = 'full-screen-search-form';
  $search_form['#attributes']['class'][] = 'element-invisible';

  // Remove bootstrap_bootstrap_search_form_wrapper
  $search_form['search_block_form']['#theme_wrappers'] = array();

  // Main search button
  $content['full_screen_search_button'] = array(
    '#type' => 'button',
    '#button_type' => 'button',
    '#value' => '<span class="icon glyphicon glyphicon-search"><div class="screenreader-text element-invisible">Search</div></span>',
    '#attributes' => array(
      'class' => array(
        'btn-link',
        'full-screen-search-button',
      ),
    ),
  );
  $content['search_form'] = $search_form;
  return $content;
}