You are here

function commerce_paypal_ec_block_configure in Commerce PayPal 7.2

Implements hook_block_configure().

File

modules/ec/commerce_paypal_ec.module, line 1691
Implements PayPal Express Checkout in Drupal Commerce checkout.

Code

function commerce_paypal_ec_block_configure($delta = '') {
  $form = array();
  if ($delta == 'commerce_paypal_ec_banners') {

    // Load the PayPal banners settings.
    $settings = (array) variable_get('commerce_paypal_ec_banners_settings', array()) + commerce_paypal_ec_banners_default_settings();
    $form['paypal_ec_banners'] = array(
      '#type' => 'fieldset',
      '#title' => t('PayPal Credit¹ Banners program settings'),
      '#description' => commerce_paypal_ec_banners_help_text(),
      '#collapsible' => FALSE,
      '#collapsed' => FALSE,
    );
    $form['paypal_ec_banners']['settings'] = array(
      '#tree' => TRUE,
    );

    // API Email.
    $form['paypal_ec_banners']['settings']['api_email'] = array(
      '#type' => 'textfield',
      '#title' => t('PayPal account e-mail address'),
      '#description' => t('Enter the same e-mail address used in your Express Checkout configuration.'),
      '#default_value' => $settings['api_email'],
    );
    $form['paypal_ec_banners']['settings']['banner_size'] = array(
      '#type' => 'select',
      '#title' => t('Banner size'),
      '#description' => t('Select the image size of the banner you want to display in this block.'),
      '#options' => array(
        t('Small') => array(
          '120x90' => '120 x 90',
          '150x100' => '150 x 100',
          '170x100' => '170 x 100',
          '190x100' => '190 x 100',
          '234x60' => '234 x 60',
        ),
        t('Medium') => array(
          '120x240' => '120 x 240',
          '250x250' => '250 x 250',
          '468x60' => '468 x 60',
          '728x90' => '728 x 90',
          '800x66' => '800 x 66',
        ),
        t('Large') => array(
          '120x600' => '120 x 600',
          '234x400' => '234 x 400',
          '280x280' => '280 x 280',
          '300x250' => '300 x 250',
          '336x280' => '336 x 280',
          '540x200' => '540 x 200',
        ),
      ),
      '#default_value' => $settings['banner_size'],
    );
  }
  $form['#attached']['css'][] = drupal_get_path('module', 'commerce_paypal_ec') . '/theme/commerce_paypal_ec.theme.css';
  return $form;
}