You are here

function apachesolr_search_get_value_title in Apache Solr Search 7

Same name and namespace in other branches
  1. 8 apachesolr_search.module \apachesolr_search_get_value_title()
  2. 6.3 apachesolr_search.module \apachesolr_search_get_value_title()

Title callback function to generate a title for a search page.

Parameters

integer $search_page_id:

integer $value:

string $keys Terms searched for.:

Return value

String

1 string reference to 'apachesolr_search_get_value_title'
apachesolr_search_load_all_search_types in ./apachesolr_search.module
Function that loads all the search types

File

./apachesolr_search.module, line 362
Provides a content search implementation for node content for use with the Apache Solr search application.

Code

function apachesolr_search_get_value_title($search_page_id = NULL, $value = NULL, $terms = NULL) {
  $page_title = 'Search results';
  if (isset($search_page_id)) {
    $search_page = apachesolr_search_page_load($search_page_id);
  }
  if ((!empty($value) || !empty($terms)) && $search_page) {
    $page_title = str_replace('%value', '@value', $search_page['page_title']);
    $page_title = str_replace('%terms', '@terms', $page_title);
  }
  else {
    if (isset($search_page_id) && $search_page && !empty($search_page['page_title'])) {

      // Set the page title normally. This would normally get used for menu items linking to search pages.
      $page_title = str_replace('%value', '', $search_page['page_title']);
      $page_title = str_replace('%terms', '', $page_title);
    }
  }
  return t($page_title, array(
    '@value' => $value,
    '@terms' => $terms,
  ));
}