function uc_order_pane_print_button in Ubercart 7.3
Handles the "Print button" order pane.
1 string reference to 'uc_order_pane_print_button'
- uc_order_uc_order_pane in uc_order/
uc_order.module - Implements hook_uc_order_pane().
File
- uc_order/
uc_order.order_pane.inc, line 16 - This file contains the callbacks for the default order panes supplied with Ubercart and their corresponding helper functions.
Code
function uc_order_pane_print_button($op, $order, &$form = NULL, &$form_state = NULL) {
switch ($op) {
case 'customer':
if (user_access('view own invoices')) {
$link = t('Click to open a window with a printable invoice.');
$build = array(
'#markup' => l($link, 'user/' . $order->uid . '/orders/' . $order->order_id . '/print', array(
'html' => TRUE,
'attributes' => array(
'onclick' => "window.open(this.href, '" . t('Invoice') . "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=600,height=480,left=50,top=50'); return false;",
),
)),
);
return $build;
}
}
}