function uc_op_admin_comments_view_table in Ubercart 7.3
Builds the order admin comments table.
2 string references to 'uc_op_admin_comments_view_table'
- uc_order_pane_admin_comments in uc_order/
uc_order.order_pane.inc - Handles the "Admin Comments" order pane.
- uc_order_pane_callback in uc_order/
uc_order.api.php - Builds and processes an order pane defined by hook_uc_order_pane().
File
- uc_order/
uc_order.order_pane.inc, line 1302 - This file contains the callbacks for the default order panes supplied with Ubercart and their corresponding helper functions.
Code
function uc_op_admin_comments_view_table($comments) {
$table = array(
'#type' => 'tapir_table',
'#attributes' => array(
'class' => array(
'order-pane-table uc-order-comments',
),
),
);
$table['#columns']['date'] = array(
'cell' => array(
'data' => t('Date'),
'class' => array(
'date',
),
),
'weight' => 0,
);
$table['#columns']['user'] = array(
'cell' => array(
'data' => t('User'),
'class' => array(
'user',
),
),
'weight' => 1,
);
$table['#columns']['comment'] = array(
'cell' => array(
'data' => t('Comment'),
'class' => array(
'message',
),
),
'weight' => 2,
);
if (is_array($comments) && !empty($comments)) {
foreach ($comments as $comment) {
$data = array();
$data['date'] = array(
'#markup' => format_date($comment->created, 'short'),
'#cell_attributes' => array(
'class' => 'date',
),
);
$data['user'] = array(
'#markup' => theme('uc_uid', array(
'uid' => $comment->uid,
)),
'#cell_attributes' => array(
'class' => 'user',
),
);
$data['comment'] = array(
'#markup' => filter_xss_admin($comment->message),
'#cell_attributes' => array(
'class' => 'message',
),
);
$table['#rows'][] = $data;
}
}
else {
$data['comment'] = array(
'#markup' => t('This order has no admin comments associated with it.'),
'#cell_attributes' => array(
'colspan' => 'full',
),
);
$table['#rows'][] = $data;
}
return $table;
}