You are here

function google_qr_code_block_view in Google QR Code Generator 7

Google_qr_code Implements hook_block_view().

Choose block to render (1 choice currently).

File

./google_qr_code.module, line 23
Provides block using Google Charts to render QR code.

Code

function google_qr_code_block_view($delta = '') {
  switch ($delta) {
    case 'qr_code':

      // Variables to make available to JS!
      $js_to_pass = array(
        'googleQRcode' => array(
          'height' => variable_get('google_qr_code_height', '250'),
          'width' => variable_get('google_qr_code_width', '250'),
          'whenShow' => variable_get('google_qr_code_when_show', ''),
          'url' => url(current_path(), array(
            'absolute' => TRUE,
          )),
        ),
      );
      drupal_add_js($js_to_pass, 'setting');
      $block['subject'] = t('Google QR Code Generator');
      $block['content'] = google_qr_code_contents($delta);
      break;
  }
  return $block;
}