$item) { if ($item['admin_list']) { // Build the operation links for the current item. $arg = ($type == 'methods') ? strtr($name, '_', '-') : strtr($method . '-' . $name, '_', '-'); $links = menu_contextual_links('commerce-shipping-' . $type, 'admin/commerce/config/shipping/' . $type, array($arg)); // Add the item's row to the table's rows array. $rows[] = array( ($type == 'methods') ? theme('shipping_method_admin_overview', array('shipping_method' => $item)) : theme('shipping_service_admin_overview', array('shipping_service' => $item)), theme('links', array('links' => $links, 'attributes' => array('class' => 'links inline operations'))), ); } } // If no items are defined... if (empty($rows)) { // Add a standard empty row with a link to add a new item. if ($type == 'methods' || $method == NULL) { $empty_text = t('There are no shipping methods enabled.'); } else { $empty_text = t('There are no services defined for the %title shipping method.', array('%title' => commerce_shipping_method_get_title($method))); } $rows[] = array( array( 'data' => $empty_text, 'colspan' => 2, ) ); } return theme('table', array('header' => $header, 'rows' => $rows)); } /** * Builds an overview of a shipping method for display to an administrator. * * @param $variables * An array of variables used to generate the display; by default includes the * shipping_method key with a value of the shipping method info array. * * @ingroup themeable */ function theme_shipping_method_admin_overview($variables) { $shipping_method = $variables['shipping_method']; // Build the actual output. $output = check_plain($shipping_method['title']); $output .= ' (Machine name: ' . check_plain($shipping_method['name']) . ')'; $output .= '