You are here

function uc_select_month in Ubercart 5

Same name and namespace in other branches
  1. 6.2 uc_store/uc_store.module \uc_select_month()
  2. 7.3 uc_store/uc_store.module \uc_select_month()

Create a month select box for a form.

3 calls to uc_select_month()
uc_payment_method_cod_form in payment/uc_payment_pack/uc_payment_pack.module
uc_payment_method_credit_form in payment/uc_credit/uc_credit.module
uc_payment_pack_receive_check_form in payment/uc_payment_pack/uc_payment_pack.module
Receive a check for an order and put in a clear date.

File

uc_store/uc_store.module, line 2283
Contains global Ubercart functions and store administration functionality.

Code

function uc_select_month($title = NULL, $default = NULL, $allow_empty = FALSE) {
  $options = $allow_empty ? array(
    '' => '',
  ) : array();
  $select = array(
    '#type' => 'select',
    '#title' => is_null($title) ? t('Month') : $title,
    '#options' => $options + array(
      1 => t('01 - January'),
      2 => t('02 - February'),
      3 => t('03 - March'),
      4 => t('04 - April'),
      5 => t('05 - May'),
      6 => t('06 - June'),
      7 => t('07 - July'),
      8 => t('08 - August'),
      9 => t('09 - September'),
      10 => t('10 - October'),
      11 => t('11 - November'),
      12 => t('12 - December'),
    ),
    '#default_value' => is_null($default) ? 0 : $default,
  );
  return $select;
}