Created
April 25, 2012 20:37
-
-
Save sanguis/2493155 to your computer and use it in GitHub Desktop.
search term and count
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function search_tc_menu_alter(&$items) { | |
$items['search']['title callback'] = 'search_tc_title'; | |
} | |
function search_tc_title($title) { | |
global $pager_total_items; | |
if ($pager_total_items[0] > 0) { | |
return t('!count search results for “!term”', array('!count' => $pager_total_items[0], '!term' => SEARCH_TERM)); | |
} | |
else { | |
return t("Search"); | |
} | |
} | |
function search_tc_form_search_form_alter(&$form, &$form_state, $form_id) { | |
define('SEARCH_TERM', $form_state['build_info']['args'][1]); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
working at http://drupal.org/sandbox/sanguis/1547644