uc_currency_format(uc_payment_balance($arg1))));
$output .= ' ('. l(t('View'), 'admin/store/orders/'. $arg1->order_id .'/payments') .')
';
}
$method_name = _payment_method_data($arg1->payment_method, 'review');
if (empty($method_name)) {
$method_name = _payment_method_data($arg1->payment_method, 'name');
}
$output .= t('Method: @payment_method', array('@payment_method' => $method_name));
$func = _payment_method_data($arg1->payment_method, 'callback');
if (function_exists($func)) {
$method_output = $func('order-view', $arg1);
if (!empty($method_output)) {
$output .= '
'. $method_output;
}
}
return $output;
case 'customer':
$method_name = _payment_method_data($arg1->payment_method, 'review');
if (empty($method_name)) {
$method_name = _payment_method_data($arg1->payment_method, 'name');
}
$output .= t('Method: @payment_method', array('@payment_method' => $method_name));
$func = _payment_method_data($arg1->payment_method, 'callback');
if (function_exists($func)) {
$method_output = $func('customer-view', $arg1);
if (!empty($method_output)) {
$output .= '
'. $method_output;
}
}
return $output;
case 'edit-form':
uc_add_js('misc/progress.js');
uc_add_js("var def_payment_msg = '';", 'inline');
$form['payment'] = array(
'#type' => 'fieldset',
'#title' => t("Modify 'Payment info'"),
'#collapsible' => TRUE,
'#collapsed' => FALSE
);
$methods = _payment_method_list();
foreach ($methods as $method) {
$options[$method['id']] = $method['name'];
}
$form['payment']['payment_method'] = array(
'#type' => 'select',
'#title' => t('Payment method'),
'#default_value' => $arg1->payment_method,
'#options' => (is_array($options)) ? $options : array(t('None available')),
'#attributes' => array('onchange' => "add_order_save_hold(); get_payment_details('admin/store/orders/". $arg1->order_id ."/payment_details/' + this.value);"),
'#disabled' => (is_array($options)) ? FALSE : TRUE,
);
return $form;
case 'edit-theme':
uc_add_js(drupal_get_path('module', 'uc_payment') .'/uc_payment.js');
$methods = _payment_method_list();
$js = 'var methods = {';
foreach ($methods as $method) {
$js .= '"'. $method['name'] .'": "' . $method['id'] .'", ';
}
$js = rtrim($js, ' ,') .'};';
uc_add_js($js, 'inline');
uc_add_js("\$(document).ready( function () { add_order_save_hold(); get_payment_details('admin/store/orders/' + \$('#edit-order-id').val() + '/payment_details/' + \$('#edit-payment-method').val()); } );", 'inline');
$output = '
'. $title .': | ' . drupal_render($arg1['payment'][$field]) .' |