You are here

function search404_error_message in Search 404 7

Displays an error message of page not found.

Parameters

string $keys: Keywords.

bool $jump_to_result: This param indicates wheather the search is jumped to a particlar search.

2 calls to search404_error_message()
search404_page in ./search404.page.inc
Main search function.
search404_results in ./search404.page.inc
Get the results for a search.

File

./search404.page.inc, line 103
The search404 module search page related functions.

Code

function search404_error_message($keys, $jump_to_result = FALSE) {
  if (variable_get('search404_disable_error_message', FALSE)) {
    return;
  }
  if ($jump_to_result) {
    $default_message = t('The page you requested does not exist.
    For your  convenience, a search was performed using the query @keys. Not quite what you were looking for? !other_results.', array(
      '@keys' => $keys,
      '!other_results' => l(t('Other results'), 'search404', array(
        'query' => array(
          'no_jump' => 1,
          'destination' => $keys,
        ),
      )),
    ));
  }
  else {
    $default_message = t('The page you requested does not exist. For your convenience, a search was performed using the query @keys.', array(
      '@keys' => $keys,
    ));
  }
  $show_message = variable_get('search404_search_message', '');
  if (!empty($show_message)) {
    $show_message = format_string($show_message, array(
      '@keys' => $keys,
    ));
  }
  else {
    $show_message = $default_message;
  }
  drupal_set_message($show_message, 'error', FALSE);
}