You are here

function ds_build_shared_page_variables in Display Suite 7

Same name and namespace in other branches
  1. 7.2 modules/ds_search/ds_search.module \ds_build_shared_page_variables()

Build shared page variables.

Parameters

$build: The build array.

1 call to ds_build_shared_page_variables()
ds_search_search_page in modules/ds_search/ds_search.module
Implements hook_search_page().

File

modules/ds_search/ds_search.module, line 436
Display Suite search.

Code

function ds_build_shared_page_variables(&$build) {

  // Search results title.
  if (variable_get('ds_search_show_title', FALSE)) {
    $build['search_title'] = array(
      '#markup' => '<h2>' . t('Search results') . '</h2>',
    );
  }

  // Extra variables.
  if (variable_get('ds_search_variables', 'none') != 'none') {
    $build['search_extra'] = array(
      '#markup' => '<div class="ds-search-extra">' . ds_search_extra_variables(arg(2)) . '</div>',
    );
  }

  // Search results.
  $build['search_results'] = array();

  // Pager.
  $build['search_pager'] = array(
    '#markup' => theme('pager', array(
      'tags' => NULL,
    )),
  );

  // CSS and JS.
  if (variable_get('ds_search_highlight', FALSE)) {
    drupal_add_css(drupal_get_path('module', 'ds_search') . '/ds_search.theme.css');
    drupal_add_js(drupal_get_path('module', 'ds_search') . '/ds_search.js');
    drupal_add_js(array(
      'ds_search' => array(
        'selector' => check_plain(variable_get('ds_search_highlight_selector', '.view-mode-search_result')),
        'search' => check_plain(arg(2)),
      ),
    ), 'setting');
  }
}