You are here

function google_plusone_build_preview_button in Google Plus One Button | Google+ Badge 7

Same name and namespace in other branches
  1. 6 google_plusone.admin.inc \google_plusone_build_preview_button()

Returns HTML for a preview button in the admin settings page.

2 calls to google_plusone_build_preview_button()
google_plusone_admin_settings in ./google_plusone.admin.inc
Menu callback: displays the Google Plus One module settings page.
google_plusone_block_configure in ./google_plusone.module
Implements hook_block_configure().

File

./google_plusone.admin.inc, line 166
Administration page for the Google +1 Button.

Code

function google_plusone_build_preview_button($sizes) {
  $output = '<div id="google_plusone_preview" style="display:none;">';
  $output .= '<div style="float: right;padding:2em;margin: 0 3em 0 3em;font-size:1.2em;border: thin groove #999;">' . t('Real time preview (annotation, width and size) for http://drupal.org') . '<br /><br />';
  foreach ($sizes as $size => $value) {
    $output .= '<div id="google_plusone_' . $size . '" style="display:none">';
    $output .= '<br clear="all" />' . t('With no annotation:') . '<br /><br />';
    $output .= '<div class="g-plusone" data-href="http://drupal.org" data-size="' . $size . '" data-annotation="none"></div>';
    $output .= '<br /><br clear="all" />' . t('With bubble annotation:') . '<br /><br />';
    $output .= '<div class="g-plusone" data-href="http://drupal.org" data-size="' . $size . '" data-annotation="bubble"></div>';
    $output .= '<br /><br clear="all" />' . t('With inline annotation:') . '<br /><br /><div class="g-inline">';
    $output .= '<div class="g-plusone" data-href="http://drupal.org" data-size="' . $size . '" data-annotation="inline"></div>';
    $output .= '</div></div>';
  }
  $output .= '</div></div>';
  return $output;
}