function google_cse_results_gadget in Google Custom Search Engine 5
Display an Add-to-Google button.
1 call to google_cse_results_gadget()
- google_cse_searchbox_formbuilder in ./
google_cse.module - Form builder for the searchbox forms.
2 string references to 'google_cse_results_gadget'
- google_cse_admin_settings in ./
google_cse.module - Admin settings page for the CSE.
- google_cse_uninstall in ./
google_cse.install - Implementation of hook_uninstall().
File
- ./
google_cse.module, line 295 - Display a Google Custom Search Engine on your site.
Code
function google_cse_results_gadget() {
if (variable_get('google_cse_results_gadget', 1) && ($id = explode(':', variable_get('google_cse_cx', '')))) {
$output = '<div id="google-cse-results-gadget">';
$output .= '<a href="http://fusion.google.com/add?moduleurl=http%3A%2F%2Fwww.google.com%2Fcoop/api/' . drupal_urlencode($id[0]) . '/cse/' . drupal_urlencode($id[1]) . '/gadget">';
$output .= '<img src="http://buttons.googlesyndication.com/fusion/add.gif" width="104" height="17" border="0" alt="Add to Google" />';
$output .= '</a></div>';
return $output;
}
else {
return '';
}
}