function theme_uc_payment_method_credit_form in Ubercart 6.2
Same name and namespace in other branches
- 5 payment/uc_credit/uc_credit.module \theme_uc_payment_method_credit_form()
Themes the credit form to be in a compact table.
3 theme calls to theme_uc_payment_method_credit_form()
- uc_authorizenet_arb_admin_update_form in payment/
uc_authorizenet/ uc_authorizenet.admin.inc - uc_authorizenet_arb_user_update_form in payment/
uc_authorizenet/ uc_authorizenet.pages.inc - uc_credit_terminal_form in payment/
uc_credit/ uc_credit.admin.inc - Displays the credit card terminal form for administrators.
File
- payment/
uc_credit/ uc_credit.module, line 1161 - Defines the credit card payment method and hooks in payment gateways.
Code
function theme_uc_payment_method_credit_form($form) {
// Comment out this function to just straight display the form.
$form['cc_number']['#title'] = '';
$form['cc_start_month']['#title'] = '';
$form['cc_start_year']['#title'] = '';
$form['cc_exp_month']['#title'] = '';
$form['cc_exp_year']['#title'] = '';
$form['cc_issue']['#title'] = '';
if (arg(1) == 'checkout') {
$path = base_path() . drupal_get_path('module', 'uc_credit');
$output = '<table class="inline-pane-table" cellpadding="2">';
if (strlen($form['cc_policy']['#value']) > 0) {
$output .= '<tr><td colspan="2" class="description">' . $form['cc_policy']['#value'] . '</td></tr>';
}
if (variable_get('uc_credit_type_enabled', FALSE)) {
$form['cc_type']['#title'] = '';
$output .= '<tr><td class="field-label">' . '<label for="' . $form['cc_type']['#id'] . '">' . t('Card Type:') . '</label></td><td>' . drupal_render($form['cc_type']) . '</td></tr>';
}
if (variable_get('uc_credit_owner_enabled', FALSE)) {
$form['cc_owner']['#title'] = '';
$output .= '<tr><td class="field-label">' . '<label for="' . $form['cc_owner']['#id'] . '">' . t('Card Owner:') . '</label></td><td>' . drupal_render($form['cc_owner']) . '</td></tr>';
}
$output .= '<tr><td class="field-label">' . '<label for="' . $form['cc_number']['#id'] . '">' . t('Card Number:') . '</label></td><td>' . drupal_render($form['cc_number']) . '</td></tr>';
if (variable_get('uc_credit_start_enabled', FALSE)) {
$output .= '<tr><td class="field-label">' . '<label for="' . $form['cc_start_month']['#id'] . '">' . t('Start Date:') . '</label></td><td>' . drupal_render($form['cc_start_month']) . ' ' . drupal_render($form['cc_start_year']) . ' ' . t('(if present)') . '</td></tr>';
}
$output .= '<tr><td class="field-label">' . '<label for="' . $form['cc_exp_month']['#id'] . '">' . t('Expiration Date:') . '</label></td><td>' . drupal_render($form['cc_exp_month']) . ' ' . drupal_render($form['cc_exp_year']) . '</td></tr>';
if (variable_get('uc_credit_issue_enabled', FALSE)) {
$output .= '<tr><td class="field-label">' . '<label for="' . $form['cc_issue']['#id'] . '">' . t('Issue Number:') . '</label></td><td>' . drupal_render($form['cc_issue']) . ' ' . t('(if present)') . '</td></tr>';
}
if (variable_get('uc_credit_cvv_enabled', TRUE)) {
$form['cc_cvv']['#title'] = '';
$output .= '<tr><td class="field-label">' . '<label for="' . $form['cc_cvv']['#id'] . '">' . t('CVV:') . '</label></td><td>' . drupal_render($form['cc_cvv']) . theme('uc_credit_cvv_help') . '</td></tr>';
}
if (variable_get('uc_credit_bank_enabled', FALSE)) {
$form['cc_bank']['#title'] = '';
$output .= '<tr><td class="field-label">' . '<label for="' . $form['cc_bank']['#id'] . '">' . t('Issuing Bank:') . '</label></td><td>' . drupal_render($form['cc_bank']) . '</td></tr>';
}
$output .= '</table>';
}
else {
$output = '<table class="order-edit-table"><tbody style="border-top: 0px;">';
if (variable_get('uc_credit_type_enabled', FALSE)) {
$form['cc_type']['#title'] = '';
$output .= '<tr><td class="oet-label">' . t('Card Type:') . '</td><td>' . drupal_render($form['cc_type']) . '</td></tr>';
}
if (variable_get('uc_credit_owner_enabled', FALSE)) {
$form['cc_owner']['#title'] = '';
$output .= '<tr><td class="oet-label">' . t('Card Owner:') . '</td><td>' . drupal_render($form['cc_owner']) . '</td></tr>';
}
$output .= '<tr><td class="oet-label">' . t('Card Number:') . '</td><td>' . drupal_render($form['cc_number']) . '</td></tr>';
if (variable_get('uc_credit_start_enabled', FALSE)) {
$output .= '<tr><td class="oet-label">' . t('Start Date:') . '</td><td>' . drupal_render($form['cc_start_month']) . ' ' . drupal_render($form['cc_start_year']) . ' ' . t('(if present)') . '</td></tr>';
}
$output .= '<tr><td class="oet-label">' . t('Expiration Date:') . '</td><td>' . drupal_render($form['cc_exp_month']) . ' ' . drupal_render($form['cc_exp_year']) . '</td></tr>';
if (variable_get('uc_credit_issue_enabled', FALSE)) {
$output .= '<tr><td class="oet-label">' . t('Issue Number:') . '</td><td>' . drupal_render($form['cc_issue']) . ' ' . t('(if present)') . '</td></tr>';
}
if (variable_get('uc_credit_cvv_enabled', TRUE)) {
$form['cc_cvv']['#title'] = '';
$output .= '<tr><td class="oet-label">' . t('CVV:') . '</td><td>' . drupal_render($form['cc_cvv']) . '</td></tr>';
}
if (variable_get('uc_credit_bank_enabled', FALSE)) {
$form['cc_bank']['#title'] = '';
$output .= '<tr><td class="oet-label">' . t('Issuing Bank:') . '</td><td>' . drupal_render($form['cc_bank']) . '</td></tr>';
}
$output .= '</td></tr></tbody></table>';
}
return $output;
}