| 2 |
|
|
| 3 |
/** |
/** |
| 4 |
* Overrides the _search_item hook. |
* Overrides the _search_item hook. |
| 5 |
* Returns a nice html output of each found item. |
* Returns HTML markup that, honestly, is actually sort of pathetic. |
| 6 |
|
* TODO - need to improve HTML markup |
| 7 |
*/ |
*/ |
| 8 |
function theme_swish_search_item($item){ |
function theme_swish_search_item($item){ |
| 9 |
global $base_url; |
global $base_url; |
| 10 |
$extra = $item['extra']; |
$extra = $item['extra']; |
| 11 |
|
|
| 12 |
$output = '<div style="line-height: 20px;"><img src="'.$base_url.'/modules/swish/images/'. strtolower($extra['file_type']) |
$output = '<div style="line-height: 20px;">'; |
| 13 |
.'.png" width="15" height="15" style="display: inline"> ' . l($item['title'], $item['link']) . '<br/>'; |
if (file_exists(getcwd() .'/'. drupal_get_path('module', 'swish') .'/images/'. strtolower($extra['file_type']). '.png')) { |
| 14 |
|
$output .= '<img src="'.$base_url. '/'. drupal_get_path('module','swish') .'/images/'. strtolower($extra['file_type']) |
| 15 |
|
.'.png" width="15" height="15" style="display: inline"> '; |
| 16 |
|
} |
| 17 |
|
$output .= l($item['title'], $item['link']) . '<br/>'; |
| 18 |
|
|
| 19 |
if ($item['snippet']) { |
if ($item['snippet']) { |
| 20 |
$output .= $item['snippet'].'<br />'; |
$output .= $item['snippet'].'<br />'; |