diff options
author | Dries Buytaert <dries@buytaert.net> | 2009-10-09 01:00:08 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2009-10-09 01:00:08 +0000 |
commit | c05f2181dc8556cb6700e8c6bb6e6ded43273192 (patch) | |
tree | 5446facb7f5f18dfaac48aade56c0d86f1477fff /modules/search | |
parent | 48dd14a898420ae98984c951f59e8d299080bee8 (diff) | |
download | brdo-c05f2181dc8556cb6700e8c6bb6e6ded43273192.tar.gz brdo-c05f2181dc8556cb6700e8c6bb6e6ded43273192.tar.bz2 |
- Patch #572618 by effulgentsia, pwolanin, sun: all theme functions should take a single argument. Code clean-up and performance improvement. Woot.
Diffstat (limited to 'modules/search')
-rw-r--r-- | modules/search/search.api.php | 2 | ||||
-rw-r--r-- | modules/search/search.module | 2 | ||||
-rw-r--r-- | modules/search/search.pages.inc | 17 |
3 files changed, 11 insertions, 10 deletions
diff --git a/modules/search/search.api.php b/modules/search/search.api.php index f7c7f2d7f..0cfb1a1e6 100644 --- a/modules/search/search.api.php +++ b/modules/search/search.api.php @@ -192,7 +192,7 @@ function hook_search_execute($keys = NULL) { 'link' => url('node/' . $item->sid, array('absolute' => TRUE)), 'type' => check_plain(node_type_get_name($node)), 'title' => $node->title, - 'user' => theme('username', $node), + 'user' => theme('username', array('account' => $node)), 'date' => $node->changed, 'node' => $node, 'extra' => $extra, diff --git a/modules/search/search.module b/modules/search/search.module index 9d15edb5e..4108e5c5c 100644 --- a/modules/search/search.module +++ b/modules/search/search.module @@ -965,7 +965,7 @@ function search_data($keys = NULL, $type = 'node') { return module_invoke($type, 'search_page', $results); } else { - return theme('search_results', $results, $type); + return theme('search_results', array('results' => $results, 'type' => $type)); } } } diff --git a/modules/search/search.pages.inc b/modules/search/search.pages.inc index cdac3350f..f0035e0c2 100644 --- a/modules/search/search.pages.inc +++ b/modules/search/search.pages.inc @@ -49,15 +49,16 @@ function search_view($type = 'node') { /** * Theme the listing of search results * - * @param $title - * The subject of the listing. - * @param $content - * The content of the listing. + * @param $variables + * An associative array containing: + * - title: The subject of the listing. + * - content: The content of the listing. + * * @return * A string containing the listing output. */ -function theme_search_results_listing($title, $content) { - $output = '<h2 class="title">' . $title . '</h2><div>' . $content . '</div>'; +function theme_search_results_listing($variables) { + $output = '<h2 class="title">' . $variables['title'] . '</h2><div>' . $variables['content'] . '</div>'; return $output; } @@ -73,9 +74,9 @@ function theme_search_results_listing($title, $content) { function template_preprocess_search_results(&$variables) { $variables['search_results'] = ''; foreach ($variables['results'] as $result) { - $variables['search_results'] .= theme('search_result', $result, $variables['type']); + $variables['search_results'] .= theme('search_result', array('result' => $result, 'type' => $variables['type'])); } - $variables['pager'] = theme('pager', NULL); + $variables['pager'] = theme('pager', array('tags' => NULL)); // Provide alternate search results template. $variables['template_files'][] = 'search-results-' . $variables['type']; } |