You are here

function theme_uc_credit_cvv_help in Ubercart 8.4

Same name and namespace in other branches
  1. 6.2 payment/uc_credit/uc_credit.theme \theme_uc_credit_cvv_help()
  2. 7.3 payment/uc_credit/uc_credit.theme.inc \theme_uc_credit_cvv_help()

Themes the credit card CVV help link.

1 string reference to 'theme_uc_credit_cvv_help'
uc_credit_theme in payment/uc_credit/uc_credit.module
Implements hook_theme().
1 theme call to theme_uc_credit_cvv_help()
CreditCardPaymentMethodBase::cartDetails in payment/uc_credit/src/CreditCardPaymentMethodBase.php
Returns the form or render array to be displayed at checkout.

File

payment/uc_credit/uc_credit.theme.inc, line 13
Theme functions for the uc_credit module.

Code

function theme_uc_credit_cvv_help(array $variables) {
  $build['image'] = [
    '#theme' => 'image',
    '#uri' => drupal_get_path('module', 'uc_credit') . '/images/info.png',
    '#alt' => 'What is the CVV?',
    '#prefix' => '<div class="uc-credit-cvv-help">',
  ];
  $build['link'] = [
    '#type' => 'link',
    '#title' => t("What's the CVV?"),
    '#url' => Url::fromRoute('uc_credit.cvv', [
      'uc_payment_method' => $variables['method'],
    ], [
      'attributes' => [
        'onclick' => "window.open(this.href, 'CVV_Info', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=480,height=520'); return false;",
      ],
    ]),
    '#suffix' => '</div>',
  ];
  return \Drupal::service('renderer')
    ->render($build);
}