=== modified file 'payment/uc_2checkout/uc_2checkout.pages.inc'
--- payment/uc_2checkout/uc_2checkout.pages.inc	2010-02-04 21:52:20 +0000
+++ payment/uc_2checkout/uc_2checkout.pages.inc	2010-02-25 15:40:54 +0000
@@ -83,7 +83,7 @@
   // Add a comment to let sales team know this came in through the site.
   uc_order_comment_save($order->order_id, 0, t('Order created through website.'), 'admin');
 
-  $output = uc_cart_complete_sale($order, variable_get('uc_new_customer_login', FALSE));
+  $build = uc_cart_complete_sale($order, variable_get('uc_new_customer_login', FALSE));
 
   $page = variable_get('uc_cart_checkout_complete_page', '');
 
@@ -91,6 +91,6 @@
     drupal_goto($page);
   }
 
-  return $output;
+  return $build;
 }
 

=== modified file 'payment/uc_credit/uc_credit.admin.inc'
--- payment/uc_credit/uc_credit.admin.inc	2010-02-17 21:01:53 +0000
+++ payment/uc_credit/uc_credit.admin.inc	2010-02-25 15:37:54 +0000
@@ -9,12 +9,16 @@
 
 // Displays the credit card terminal page.
 function uc_credit_terminal($order) {
-  $output = l(t('Return to order view screen.'), 'admin/store/orders/'. $order->order_id);
+  $build['return'] = array(
+    '#theme' => 'link',
+    '#text' => t('Return to order view screen.'),
+    '#href' => 'admin/store/orders/'. $order->order_id,
+  );
 
-  $output .= '<p>'. t('Use this terminal to process credit card payments through your default gateway.') .'</p>';
+  $build['instructions'] = array('#markup' => '<p>'. t('Use this terminal to process credit card payments through your default gateway.') .'</p>');
 
   if (!variable_get('uc_credit_debug', FALSE) || variable_get('uc_credit_checkout_process', TRUE)) {
-    $output .= '<p>'. t('Be warned that credit card data will automatically be converted to the last 4 digits of the card once a transaction has occurred.  As such, subsequent charges after a partial payment will not have any stored credit card information to use.') .'</p>';
+    $build['warning'] = array('#markup' => '<p>'. t('Be warned that credit card data will automatically be converted to the last 4 digits of the card once a transaction has occurred.  As such, subsequent charges after a partial payment will not have any stored credit card information to use.') .'</p>');
   }
 
   $context = array(
@@ -24,12 +28,12 @@
       'order' => $order,
     ),
   );
-  $output .= '<div><strong>'. t('Order total: @total', array('@total' => uc_price($order->order_total, $context))) .'</strong></div>'
-            .'<div><strong>'. t('Balance: @balance', array('@balance' => uc_price(uc_payment_balance($order), $context))) .'</strong></div>';
-
-  $output .= drupal_get_form('uc_credit_terminal_form', $order);
-
-  return $output;
+  $build['details']['order_total'] = array('#markup' => '<div><strong>'. t('Order total: @total', array('@total' => uc_price($order->order_total, $context))) .'</strong></div>');
+  $build['details']['balance'] = array('#markup' => '<div><strong>'. t('Balance: @balance', array('@balance' => uc_price(uc_payment_balance($order), $context))) .'</strong></div>');
+
+  $build['form'] = drupal_get_form('uc_credit_terminal_form', $order);
+
+  return $build;
 }
 
 // Displays the credit card terminal form for administrators.

=== modified file 'payment/uc_cybersource/uc_cybersource.module'
--- payment/uc_cybersource/uc_cybersource.module	2010-02-17 21:01:53 +0000
+++ payment/uc_cybersource/uc_cybersource.module	2010-02-25 15:34:08 +0000
@@ -714,7 +714,10 @@
     $items[] = t('No taxes returned for this order.');
   }
 
-  return theme('item_list', array('items' => $items));
+  return array(
+    '#theme' => 'item_list',
+    '#items' => $items,
+  );
 }
 
 /**

=== modified file 'payment/uc_google_checkout/uc_google_checkout.admin.inc'
--- payment/uc_google_checkout/uc_google_checkout.admin.inc	2010-02-17 21:01:53 +0000
+++ payment/uc_google_checkout/uc_google_checkout.admin.inc	2010-02-25 15:32:40 +0000
@@ -312,7 +312,11 @@
     drupal_goto('admin/store/orders');
   }
 
-  $output = l(t('Return to order view screen.'), 'admin/store/orders/'. $order_id);
+  $build['return'] = array(
+    '#theme' => 'link',
+    '#text' => t('Return to order view screen.'),
+    '#href' => 'admin/store/orders/'. $order_id,
+  );
 
   $gc_balance = $order->gc_total;
   $payments = uc_payment_load_payments($order_id);
@@ -324,6 +328,7 @@
     }
   }
   $balance = uc_payment_balance($order);
+
   $context = array(
     'revision' => 'themed-original',
     'type' => 'order_total',
@@ -331,22 +336,46 @@
       'order' => $order,
     ),
   );
-  $output .= '<p>'. t('Use this terminal to process credit card payments:') .'</p>'
-            .'<table style="width: auto;"><tbody style="border-top: 0px;"><tr>'
-            .'<td><strong>'. t('Order total:') .'</strong> </td><td>'
-           . uc_price($order->order_total, $context) .'</td></tr><tr><td>'
-            .'<strong>'. t('Balance:') .'</strong> </td><td>'
-           . uc_price($balance, $context) .'</td></tr><tr><td><strong>'
-           . t('Google Checkout total:') .'</strong></td><td>'
-           . uc_price($order->gc_total, $context) .'</td></tr><tr><td><strong>'
-           . t('Google Checkout balance:') .'</strong></td<td>'
-           . uc_price($gc_balance, $context) .'</td></tr></tbody></table>';
+  $build['instructions'] = array('#markup' => '<p>'. t('Use this terminal to process credit card payments:') .'</p>');
+
+  $build['details'] = array(
+    '#prefix' => '<table style="width: auto;"><tbody style="border-top: 0px;">',
+    '#suffix' => '</tbody></table>',
+  );
+
+  $build['details']['order_total'] = array(
+    '#prefix' => '<tr>',
+    '#suffix' => '</tr>',
+  );
+  $build['details']['order_total']['label'] = array('#markup' => '<strong>' . t('Order total:') . '</strong>');
+  $build['details']['order_total']['value'] = array('#markup' => uc_price($order->order_total, $context));
+
+  $build['details']['balance'] = array(
+    '#prefix' => '<tr>',
+    '#suffix' => '</tr>',
+  );
+  $build['details']['balance']['label'] = array('#markup' => '<strong>' . t('Balance:') . '</strong>');
+  $build['details']['balance']['value'] = array('#markup' => uc_price($balance, $context));
+
+  $build['details']['gco_total'] = array(
+    '#prefix' => '<tr>',
+    '#suffix' => '</tr>',
+  );
+  $build['details']['gco_total']['label'] = array('#markup' => '<strong>' . t('Google Checkout total:') . '</strong>');
+  $build['details']['gco_total']['value'] = array('#markup' => uc_price($order->gc_total, $context));
+
+  $build['details']['gco_balance'] = array(
+    '#prefix' => '<tr>',
+    '#suffix' => '</tr>',
+  );
+  $build['details']['gco_balance']['label'] = array('#markup' => '<strong>' . t('Google Checkout balance:') . '</strong>');
+  $build['details']['gco_balance']['value'] = array('#markup' => uc_price($gc_balance, $context));
 
   if (in_array($order->financial_state, array('REVIEWING', 'CHARGEABLE', 'CHARGED'))) {
-    $output .= drupal_get_form('uc_google_checkout_terminal_form', $order, $gc_balance);
+    $build['form'] = drupal_get_form('uc_google_checkout_terminal_form', $order, $gc_balance);
   }
 
-  return $output;
+  return $build;
 }
 
 function uc_google_checkout_terminal_form($form, &$form_state, $order, $amount = 0) {

=== modified file 'payment/uc_google_checkout/uc_google_checkout.module'
--- payment/uc_google_checkout/uc_google_checkout.module	2010-02-19 19:29:01 +0000
+++ payment/uc_google_checkout/uc_google_checkout.module	2010-02-25 15:33:19 +0000
@@ -12,6 +12,7 @@
 
 function uc_google_checkout_help($page, $args) {
   $output = '';
+
   switch ($page) {
     case 'admin/store/settings/google_checkout':
       if (variable_get('uc_google_checkout_mode', 'checkout') == 'checkout') {
@@ -23,6 +24,7 @@
       $output .= t('In the <a href="!checkout_url/sell">Google Checkout Merchant Center</a>, enter %url as the callback URL for this site. This will allow Ubercart to communicate with Google Checkout.', array('!checkout_url' => $checkout_url, '%url' => url('google_checkout', array('absolute' => TRUE))));
     break;
   }
+
   return $output;
 }
 

=== modified file 'payment/uc_payment/uc_payment.admin.inc'
--- payment/uc_payment/uc_payment.admin.inc	2010-02-17 21:01:53 +0000
+++ payment/uc_payment/uc_payment.admin.inc	2010-02-25 15:21:17 +0000
@@ -11,7 +11,10 @@
 // Displays an overview of the payment settings.
 function uc_payment_settings_overview() {
   // Theme all the pages beneath this path into summary overviews.
-  return theme('summary_overview', array('summaries' => summarize_child_form_pages('admin/store/settings/payment/edit')));
+  return array(
+    '#theme' => 'summary_overview',
+    '#summaries' => summarize_child_form_pages('admin/store/settings/payment/edit'),
+  );
 }
 
 function uc_payment_settings_form() {
@@ -241,13 +244,13 @@
     $options[$gateway['id']] = $gateway['title'];
   }
 
-  $output = t('Please choose a payment gateway to use for that payment.');
+  $build['instructions'] = array('#markup' => t('Please choose a payment gateway to use for that payment.'));
 
-  $output .= drupal_get_form('uc_payment_gateway_select_form', $options,
+  $build['form'] = drupal_get_form('uc_payment_gateway_select_form', $options,
                $_SESSION['uc_payment_method'], $_SESSION['uc_payment_order_id'],
                $_SESSION['uc_payment_amount'], $_SESSION['uc_payment_data']);
 
-  return $output;
+  return $build;
 }
 
 function uc_payment_gateway_select_form($form, &$form_state, $options, $method, $order_id, $amount, $data) {

=== modified file 'payment/uc_paypal/uc_paypal.pages.inc'
--- payment/uc_paypal/uc_paypal.pages.inc	2010-02-17 21:01:53 +0000
+++ payment/uc_paypal/uc_paypal.pages.inc	2010-02-25 15:17:56 +0000
@@ -235,11 +235,11 @@
     $_SESSION['have_details'][$order->order_id] = TRUE;
   }
 
-  $output = t("Your order is almost complete!  Please fill in the following details and click 'Continue checkout' to finalize the purchase.");
-
-  $output .= drupal_get_form('uc_paypal_ec_review_form', $order);
-
-  return $output;
+  $build['instructions'] = array('#markup' => t("Your order is almost complete!  Please fill in the following details and click 'Continue checkout' to finalize the purchase."));
+
+  $build['form'] = drupal_get_form('uc_paypal_ec_review_form', $order);
+
+  return $build;
 }
 
 // Returns the form for the custom Review Payment screen for Express Checkout.
@@ -384,12 +384,21 @@
   }
 
   drupal_add_css(drupal_get_path('module', 'uc_cart') .'/uc_cart.css');
-  $output = '<div>'. theme('cart_review_table', array('show_subtotal' => FALSE)) .'</div>';
-  $output .= uc_order_pane_line_items('customer', $order);
-  $output .= '<p>'. t("Your order is not complete until you click the 'Submit order' button below. Your PayPal account will be charged for the amount shown above once your order is placed. You will receive confirmation once your payment is complete.") .'</p>';
-  $output .= drupal_get_form('uc_paypal_ec_submit_form');
-
-  return $output;
+
+  $build['review'] = array(
+    '#theme' => 'cart_review_table',
+    '#show_subtotal' => FALSE,
+    '#prefix' => '<div>',
+    '#suffix' => '</div>',
+  );
+
+  $build['line_items'] = array('#markup' => uc_order_pane_line_items('customer', $order));
+
+  $build['instructions'] = array('#markup' => '<p>'. t("Your order is not complete until you click the 'Submit order' button below. Your PayPal account will be charged for the amount shown above once your order is placed. You will receive confirmation once your payment is complete.") .'</p>');
+
+  $build['submit_form'] = drupal_get_form('uc_paypal_ec_submit_form');
+
+  return $build;
 }
 
 // Submits an order, calling the NVP API to send the order total to PayPal.

=== modified file 'shipping/uc_flatrate/uc_flatrate.admin.inc'
--- shipping/uc_flatrate/uc_flatrate.admin.inc	2010-02-17 21:01:53 +0000
+++ shipping/uc_flatrate/uc_flatrate.admin.inc	2010-02-25 15:12:07 +0000
@@ -10,7 +10,7 @@
  * List and compare all flatrate shipping quote methods.
  */
 function uc_flatrate_admin_methods() {
-  $output = '';
+  $build = array();
 
   $context = array(
     'revision' => 'themed',
@@ -35,11 +35,20 @@
 
   if (count($rows)) {
     $header = array(t('Title'), t('Label'), t('Base rate'), t('Default product rate'), array('data' => t('Operations'), 'colspan' => 2));
-    $output .= theme('table', array('header' => $header, 'rows' => $rows));
+    $build['methods'] = array(
+      '#theme' => 'table',
+      '#header' => $header,
+      '#rows' => $rows,
+    );
   }
-  $output .= l(t('Add a new flat rate shipping method.'), 'admin/store/settings/quotes/methods/flatrate/add');
-
-  return $output;
+
+  $build['add_more'] = array(
+    '#theme' => 'link',
+    '#text' => t('Add a new flat rate shipping method.'),
+    '#href' => 'admin/store/settings/quotes/methods/flatrate/add',
+  );
+
+  return $build;
 }
 
 /**

=== modified file 'shipping/uc_quote/uc_quote.admin.inc'
--- shipping/uc_quote/uc_quote.admin.inc	2010-02-17 21:01:53 +0000
+++ shipping/uc_quote/uc_quote.admin.inc	2010-02-25 15:10:08 +0000
@@ -17,7 +17,10 @@
   $summaries = array_merge($summaries, summarize_child_form_pages('admin/store/settings/quotes/methods', FALSE, TRUE));
 
   // Theme it all up in a summaries overview.
-  return theme('summary_overview', array('summaries' => $summaries));
+  return array(
+    '#theme' => 'summary_overview',
+    '#summaries' => $summaries,
+  );
 }
 
 /**

=== modified file 'shipping/uc_shipping/uc_shipping.admin.inc'
--- shipping/uc_shipping/uc_shipping.admin.inc	2010-02-17 21:01:53 +0000
+++ shipping/uc_shipping/uc_shipping.admin.inc	2010-02-25 15:44:29 +0000
@@ -61,14 +61,23 @@
   if (empty($rows)) {
     $rows[][] = array('data' => t("This order's products have not been organized into packages."), 'colspan' => 11);
   }
-  $output = theme('table', array('header' => $header, 'rows' => $rows));
+
+  $build['packages'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    'rows' => $rows,
+  );
 
   $result = db_query("SELECT op.order_product_id, CASE WHEN COUNT(pp.qty) = 0 THEN 0 ELSE SUM(op.qty) / COUNT(pp.qty) END AS total, SUM(pp.qty) AS packaged FROM {uc_order_products} AS op LEFT JOIN {uc_packaged_products} AS pp ON op.order_product_id = pp.order_product_id WHERE op.order_id = :id AND op.data LIKE :data GROUP BY op.order_product_id HAVING SUM(pp.qty) IS NULL OR CASE WHEN COUNT(pp.qty) = 0 THEN 0 ELSE SUM(op.qty) / COUNT(pp.qty) END > SUM(pp.qty)", array(':id' => $order->order_id, ':data' => '%s:9:"shippable";s:1:"1";%'));
   if ($result->fetchObject()) {
-    $output .= l(t('Create packages.'), 'admin/store/orders/'. $order->order_id .'/packages/new');
+    $build['add_more'] = array(
+      '#theme' => 'link',
+      '#text' => t('Create packages.'),
+      '#href' => 'admin/store/orders/'. $order->order_id .'/packages/new',
+    );
   }
 
-  return $output;
+  return $build;
 }
 
 /**
@@ -441,6 +450,7 @@
   $result = db_query("SELECT * FROM {uc_shipments} WHERE order_id = :id", array(':id' => $order->order_id));
   $header = array(t('Shipment ID'), t('Name'), t('Company'), t('Destination'), t('Ship date'), t('Estimated delivery'), t('Tracking number'), array('data' => t('Actions'), 'colspan' => 4));
   $rows = array();
+
   while ($shipment = db_fetch_object($result)) {
     $row = array();
     $row[] = $shipment->sid;
@@ -456,21 +466,37 @@
     $row[] = l(t('delete'), 'admin/store/orders/'. $order->order_id .'/shipments/'. $shipment->sid .'/delete');
     $rows[] = $row;
   }
+
   if (empty($rows)) {
     $rows[] = array(array('data' => t('No shipments have been made for this order.'), 'colspan' => 11));
   }
-  $output = theme('table', array('header' => $header, 'rows' => $rows));
+
+  $build['shipments'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+  );
+
   $packages = db_query("SELECT COUNT(*) FROM {uc_packages} WHERE order_id = :id AND sid IS NULL", array(':id' => $order->order_id))->fetchField();
   if ($packages) {
-    $output .= l(t('Make a new shipment'), 'admin/store/orders/'. $order->order_id .'/shipments/new');
+    $build['add_more'] = array(
+      '#theme' => 'link',
+      '#text' => t('Make a new shipment'),
+      '#href' => 'admin/store/orders/'. $order->order_id .'/shipments/new',
+    );
   }
   else {
     $result = db_query("SELECT op.order_product_id, CASE WHEN COUNT(pp.qty) = 0 THEN 0 ELSE SUM(op.qty) / COUNT(pp.qty) END AS total, SUM(pp.qty) AS packaged FROM {uc_order_products} AS op LEFT JOIN {uc_packaged_products} AS pp ON op.order_product_id = pp.order_product_id WHERE op.order_id = :id AND op.data LIKE :data GROUP BY op.order_product_id HAVING SUM(pp.qty) IS NULL OR CASE WHEN COUNT(pp.qty) = 0 THEN 0 ELSE SUM(op.qty) / COUNT(pp.qty) END > SUM(pp.qty)", array(':id' => $order->order_id, ':data' => '%s:9:"shippable";s:1:"1";%'));
     if (db_fetch_object($result)) {
-      $output .= l(t('Put products into packages to make shipments.'), 'admin/store/orders/'. $order->order_id .'/packages/new');
+      $build['add_more'] = array(
+        '#theme' => 'link',
+        '#text' => t('Put products into packages to make shipments.'),
+        '#href' => 'admin/store/orders/'. $order->order_id .'/packages/new',
+      );
     }
   }
-  return $output;
+
+  return $build;
 }
 
 /**
@@ -623,46 +649,66 @@
   $breadcrumb[] = l(t('Shipments'), 'admin/store/orders/'. $order->order_id .'/shipments');
   drupal_set_breadcrumb($breadcrumb);
 
-  $output = '';
+  $build = array();
 
   $origin = uc_order_address($shipment, 'o');
   $destination = uc_order_address($shipment, 'd');
-  $output .= '<div class="order-pane pos-left"><div class="order-pane-title">'. t('Pickup Address:') .'</div>'. $origin .'</div>';
-  $output .= '<div class="order-pane pos-left"><div class="order-pane-title">'. t('Delivery Address:') .'</div>'. $destination .'</div>';
-  $output .= '<div class="order-pane abs-left"><div class="order-pane-title">'. t('Schedule:') .'</div>';
+
+  $build['pickup_address'] = array('#markup' => '<div class="order-pane pos-left"><div class="order-pane-title">'. t('Pickup Address:') .'</div>'. $origin .'</div>');
+  $build['delivery_address'] = array('#markup' => '<div class="order-pane pos-left"><div class="order-pane-title">'. t('Delivery Address:') .'</div>'. $destination .'</div>');
+
   $rows = array();
   $rows[] = array(t('Ship date:'), format_date($shipment->ship_date, 'custom', 'D, '. variable_get('uc_date_format_default', 'm/d/Y')));
   $rows[] = array(t('Expected delivery:'), format_date($shipment->expected_delivery, 'custom', 'D, '. variable_get('uc_date_format_default', 'm/d/Y')));
-  $output .= theme('table', array('rows' => $rows, 'attributes' => array('style' => 'width: auto')));
-  $output .= '</div>';
-  $output .= '<div class="order-pane abs-left"><div class="order-pane-title">'. t('Shipment Details:') .'</div>';
+
+  $build['schedule'] = array(
+    '#theme' => 'table',
+    '#rows' => $rows,
+    '#attributes' => array('style' => 'width: auto'),
+    '#prefix' => '<div class="order-pane abs-left"><div class="order-pane-title">'. t('Schedule:') .'</div>',
+    '#suffix' => '</div>',
+  );
+
   $rows = array();
   $rows[] = array(t('Carrier:'), check_plain($shipment->carrier));
+
   if ($shipment->transaction_id) {
     $rows[] = array(t('Transaction ID:'), check_plain($shipment->transaction_id));
   }
+
   if ($shipment->tracking_number) {
     $rows[] = array(t('Tracking Number:'), check_plain($shipment->tracking_number));
   }
+
   $methods = module_invoke_all('shipping_method');
   $method = $methods[$shipment->shipping_method];
+
   if (isset($method['quote']['accessorials'][$shipment->accessorials])) {
     $rows[] = array(t('Services:'), $method['quote']['accessorials'][$shipment->accessorials]);
   }
   else {
     $rows[] = array(t('Services:'), $shipment->accessorials);
   }
+
   $context = array(
     'revision' => 'themed',
     'type' => 'amount',
   );
   $rows[] = array(t('Cost:'), uc_price($shipment->cost, $context, array('label' => FALSE)));
-  $output .= theme('table', array('rows' => $rows, 'attributes' => array('style' => 'width:auto')));
-  $output .= '</div>';
+
+  $build['details'] = array(
+    '#theme' => 'table',
+    '#rows' => $rows,
+    '#attributes' => array('style' => 'width:auto'),
+    '#prefix' => '<div class="order-pane abs-left"><div class="order-pane-title">'. t('Shipment Details:') .'</div>',
+    '#suffix' => '</div>',
+  );
+
   foreach ($shipment->packages as $package) {
-    $output .= uc_shipping_package_view($package);
+    $build['packages'][] = uc_shipping_package_view($package);
   }
-  return $output;
+
+  return $build;
 }
 
 /**

=== modified file 'shipping/uc_shipping/uc_shipping.module'
--- shipping/uc_shipping/uc_shipping.module	2010-02-25 14:27:28 +0000
+++ shipping/uc_shipping/uc_shipping.module	2010-02-25 14:55:57 +0000
@@ -289,38 +289,56 @@
  */
 function uc_shipping_package_view($package) {
   $shipment = uc_shipping_shipment_load($package->sid);
-  $output = '';
+  $build = array(
+    '#prefix' => '<div class="order-pane pos-left">',
+    '#suffix' => '</div>',
+  );
   $rows = array();
 
-  $output .= '<div class="order-pane pos-left"><div class="order-pane-title">'. t('Package %id:', array('%id' => $package->package_id)) .'</div>';
+  $build['title'] = array(
+    '#markup' => t('Package %id:', array('%id' => $package->package_id)),
+    '#prefix' => '<div class="order-pane-title">',
+    '#suffix' => '</div>',
+  );
+
   $rows[] = array(t('Contents:'), filter_xss_admin($package->description));
+
   if ($shipment) {
     $methods = module_invoke_all('shipping_method');
     $method = $methods[$shipment->shipping_method];
     $pkg_type = $method['ship']['pkg_types'][$package->pkg_type];
   }
+
   $rows[] = array(t('Package type:'), strlen($pkg_type) ? $pkg_type : check_plain($package->pkg_type));
+
   if ($package->length && $package->width && $package->height) {
     $rows[] = array(t('Dimensions:'), t('!l x !w x !h', array('!l' => uc_length_format($package->length), '!w' => uc_length_format($package->width), '!h' => uc_length_format($package->height))));
   }
+
   $context = array(
     'revision' => 'themed',
     'type' => 'amount',
   );
   $rows[] = array(t('Insured value:'), uc_price($package->value, $context));
+
   if ($package->tracking_number) {
     $rows[] = array(t('Tracking number:'), check_plain($package->tracking_number));
   }
+
   if ($shipment && $package->label_image && file_exists(file_create_path($package->label_image))) {
     $rows[] = array(t('Label:'), l(t('Click to view.'), 'admin/store/orders/'. $package->order_id .'/shipments/labels/'. $shipment->shipping_method .'/'. $package->label_image));
   }
   else {
     $rows[] = array(t('Label:'), t('n/a'));
   }
-  $output .= theme('table', array('rows' => $rows, 'attributes' => array('style' => 'width:auto;')));
-  $output .= '</div>';
-
-  return $output;
+
+  $build['package'] = array(
+    '#theme' => 'table',
+    '#rows' => $rows,
+    'attributes' => array('style' => 'width:auto;'),
+  );
+
+  return $build;
 }
 
 /**

=== modified file 'shipping/uc_weightquote/uc_weightquote.admin.inc'
--- shipping/uc_weightquote/uc_weightquote.admin.inc	2010-02-17 21:01:53 +0000
+++ shipping/uc_weightquote/uc_weightquote.admin.inc	2010-02-25 14:34:24 +0000
@@ -11,7 +11,7 @@
  * List and compare all weight-based shipping quote methods.
  */
 function uc_weightquote_admin_methods() {
-  $output = '';
+  $build = array();
 
   $context = array(
     'location' => 'shipping-weightquote-method-admin',
@@ -36,11 +36,20 @@
   }
   if (count($rows)) {
     $header = array(t('Title'), t('Label'), t('Base rate'), t('Default product rate'), array('data' => t('Operations'), 'colspan' => 2));
-    $output .= theme('table', array('header' => $header, 'rows' => $rows));
+    $build['methods'] = array(
+      '#theme' => 'table',
+      '#header' => $header,
+      'rows' => $rows,
+    );
   }
-  $output .= l(t('Add a new weight quote shipping method.'), 'admin/store/settings/quotes/methods/weightquote/add');
-
-  return $output;
+
+  $build['add_more'] = array(
+    '#theme' => 'link',
+    '#text' => t('Add a new weight quote shipping method.'),
+    '#href' => 'admin/store/settings/quotes/methods/weightquote/add',
+  );
+
+  return $build;
 }
 
 /**

=== modified file 'uc_attribute/uc_attribute.admin.inc'
--- uc_attribute/uc_attribute.admin.inc	2010-02-17 21:01:53 +0000
+++ uc_attribute/uc_attribute.admin.inc	2010-02-24 20:13:42 +0000
@@ -18,7 +18,7 @@
     array('data' => t('List position'), 'field' => 'a.ordering'),
     t('Number of options'),
     t('Display type'),
-    t('Operations'),
+    array('data' => t('Operations'), 'colspan' => 3),
   );
 
   $display_types = _uc_attribute_display_types();
@@ -48,11 +48,6 @@
     if (empty($attr->label)) {
       $attr->label = $attr->name;
     }
-    $ops = array(
-      l(t('edit'), 'admin/store/attributes/'. $attr->aid .'/edit'),
-      l(t('options'), 'admin/store/attributes/'. $attr->aid .'/options'),
-      l(t('delete'), 'admin/store/attributes/'. $attr->aid .'/delete'),
-    );
     $rows[] = array(
       check_plain($attr->name),
       check_plain($attr->label),
@@ -60,20 +55,33 @@
       array('data' => $attr->ordering, 'align' => 'center'),
       array('data' => $attr->options, 'align' => 'center'),
       $display_types[$attr->display],
-      implode(' ', $ops),
+      l(t('edit'), 'admin/store/attributes/'. $attr->aid .'/edit'),
+      l(t('options'), 'admin/store/attributes/'. $attr->aid .'/options'),
+      l(t('delete'), 'admin/store/attributes/'. $attr->aid .'/delete'),
     );
   }
 
   if (count($rows) == 0) {
     $rows[] = array(
-      array('data' => t('No product attributes have been added yet.'), 'colspan' => '6')
+      array('data' => t('No product attributes have been added yet.'), 'colspan' => '9')
     );
   }
 
-  $output = theme('table', array('header' => $header, 'rows' => $rows)) . theme('pager')
-          . l(t('Add an attribute'), 'admin/store/attributes/add');
+  $build['attributes'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+  );
+  $build['pager'] = array(
+    '#theme' => 'pager',
+  );
+  $build['add_more'] = array(
+    '#theme' => 'link',
+    '#text' => t('Add an attribute'),
+    '#href' => 'admin/store/attributes/add',
+  );
 
-  return $output;
+  return $build;
 }
 
 /**
@@ -84,7 +92,6 @@
  */
 function uc_attribute_form($form, &$form_state, $attribute = NULL) {
   // If an attribute specified, add its ID as a hidden value.
-
   if (!empty($attribute)) {
     $form['aid'] = array('#type' => 'hidden', '#value' => $attribute->aid);
     drupal_set_title(t('Edit attribute: %name', array('%name' => $attribute->name)));

=== modified file 'uc_cart_links/uc_cart_links.admin.inc'
--- uc_cart_links/uc_cart_links.admin.inc	2010-02-16 18:40:39 +0000
+++ uc_cart_links/uc_cart_links.admin.inc	2010-02-24 22:56:53 +0000
@@ -92,7 +92,17 @@
     );
   }
 
-  return theme('table', array('header' => $header, 'rows' => $rows)) . theme('pager', array('element' => 1));
+  $build['report'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+  );
+  $build['pager'] = array(
+    '#theme' => 'pager',
+    '#element' => 1,
+  );
+
+  return $build;
 }
 
 /**
@@ -125,9 +135,25 @@
     t('Turn off the add to cart message with m0.'),
   );
 
-  $output = '<div>'. t('There is currently no user interface for creating cart links, but this section includes some basic instructions.<br />Cart links are simple to form using a few actions and arguments with the following rules:')
-    .'<p>'. theme('item_list', array('items' => $items)) .'</p><p>'. theme('table', array('header' => $header, 'rows' => $rows)) .'</p><p>'. theme('item_list', array('items' => $items2)) .'</p><p>'. t('<b>Example:</b> /cart/add/e-p1_q5-imonday_special?destination=cart<br /><br />This example will empty the cart, add 5 of product 1 to the cart, track clicks with the ID "monday_special", and redirect the user to the cart. To use this on your site, simply create an HTML link to the URL you create:')
-    .'</p><p>&lt;a href="http://www.example.com/cart/add/e-p1_q5-imonday_special?destination=cart">'. t('Link text.') .'&lt;/a></p></div>';
+  $build = array(
+    '#prefix' => '<div>',
+    '#suffix' => '</div>',
+  );
+  $build['introduction'] = array('#markup' => t('There is currently no user interface for creating cart links, but this section includes some basic instructions.<br />Cart links are simple to form using a few actions and arguments with the following rules:'));
+  $build['suggestions'] = array(
+    '#theme' => 'item_list',
+    '#items' => $items,
+  );
+  $build['commands'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    'rows' => $rows,
+  );
+  $build['rules'] = array(
+    '#theme' => 'item_list',
+    '#items' => $items2,
+  );
+  $build['example'] = array('#markup' => '<p>' . t('<b>Example:</b> /cart/add/e-p1_q5-imonday_special?destination=cart<br /><br />This example will empty the cart, add 5 of product 1 to the cart, track clicks with the ID "monday_special", and redirect the user to the cart. To use this on your site, simply create an HTML link to the URL you create:') . '</p><p>&lt;a href="http://www.example.com/cart/add/e-p1_q5-imonday_special?destination=cart"&gt;' . t('Link text.') . '&lt;/a&gt;</p>');
 
-  return $output;
+  return $build;
 }

=== modified file 'uc_catalog/uc_catalog.admin.inc'
--- uc_catalog/uc_catalog.admin.inc	2010-02-16 18:40:39 +0000
+++ uc_catalog/uc_catalog.admin.inc	2010-02-24 19:49:33 +0000
@@ -12,7 +12,10 @@
  */
 function uc_catalog_settings_overview() {
   // Theme all the pages beneath this path into summary overviews.
-  return theme('summary_overview', array('summaries' => summarize_child_form_pages('admin/store/settings/catalog/edit')));
+  return array(
+    '#theme' => 'summary_overview',
+    '#summaries' => summarize_child_form_pages('admin/store/settings/catalog/edit'),
+  );
 }
 
 /**
@@ -220,11 +223,14 @@
  * Display links to all products that have not been categorized.
  */
 function uc_catalog_orphaned_products() {
+  $build = array();
+
   if (variable_get('taxonomy_maintain_index_table', TRUE)) {
-    $output = '<p>'. t('Orphaned products are products that you have created but
-       not yet assigned to a category in your product catalog. All such
-       products will appear as links below that you can follow to edit
-       the product listings to assign them to categories.') .'</p>';
+    $build['explanation'] = array(
+      '#markup' => t('Orphaned products are products that you have created but not yet assigned to a category in your product catalog. All such products will appear as links below that you can follow to edit the product listings to assign them to categories.'),
+      '#prefix' => '<p>',
+      '#suffix' => '</p>',
+    );
 
     $vid = variable_get('uc_catalog_vid', 0);
     $product_types = uc_product_types();
@@ -238,16 +244,27 @@
     }
 
     if (count($rows) > 0) {
-      $output .= theme('item_list', array('items' => $rows));
+      $build['orphans'] = array(
+        '#theme' => 'item_list',
+        '#items' => $rows,
+      );
     }
     else {
-      $output .= '<p>'. t('All products are currently listed in the catalog.') .'</p>';
+      $build['orphans'] = array(
+        '#markup' => t('All products are currently listed in the catalog.'),
+        '#prefix' => '<p>',
+        '#suffix' => '</p>',
+      );
     }
   }
   else {
-    $output = '<p>' . t('The node terms index is not being maintained, so Ubercart can not determine which products are not entered into the catalog.') . '</p>';
+    $build['orphans'] = array(
+      '#markup' => t('The node terms index is not being maintained, so Ubercart can not determine which products are not entered into the catalog.'),
+      '#prefix' => '<p>',
+      '#suffix' => '</p>',
+    );
   }
 
-  return $output;
+  return $build;
 }
 

=== modified file 'uc_catalog/uc_catalog.pages.inc'
--- uc_catalog/uc_catalog.pages.inc	2010-02-22 22:30:39 +0000
+++ uc_catalog/uc_catalog.pages.inc	2010-02-24 20:06:38 +0000
@@ -49,7 +49,7 @@
       );
     }
     if (!empty($child->uc_catalog_image)) {
-      $image = field_view_field('taxonomy_term', $child, 'uc_catalog_image');
+      $image = drupal_render(field_view_field('taxonomy_term', $child, 'uc_catalog_image'));
     }
     else {
       $image = '<div></div>';

=== modified file 'uc_file/uc_file.pages.inc'
--- uc_file/uc_file.pages.inc	2010-02-08 20:07:51 +0000
+++ uc_file/uc_file.pages.inc	2010-02-24 22:49:38 +0000
@@ -154,7 +154,10 @@
     $row++;
   }
 
-  return theme('uc_file_user_downloads', array('files' => $files));
+  return array(
+    '#theme' => 'uc_file_user_downloads',
+    '#files' => $files,
+  );
 }
 
 /**

=== modified file 'uc_reports/uc_reports.admin.inc'
--- uc_reports/uc_reports.admin.inc	2010-02-17 21:01:53 +0000
+++ uc_reports/uc_reports.admin.inc	2010-02-24 22:45:47 +0000
@@ -121,11 +121,42 @@
   }
   $csv_data = uc_reports_store_csv('uc_customers', $csv_rows);
 
-  $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('width' => '100%', 'class' => array('uc-sales-table'))));
-  $output .= theme('pager');
-  $output .= '<div class="uc-reports-links">'. l(t('Export to CSV file.'), 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user']) .'&nbsp;&nbsp;&nbsp;'. ((!is_null($_GET['nopage'])) ? l(t('Show paged records'), 'admin/store/reports/customers') : l(t('Show all records'), 'admin/store/reports/customers', array('query' => 'nopage=1'))) .'</div>';
+  $build['report'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#attributes' => array('width' => '100%', 'class' => array('uc-sales-table')),
+  );
+  $build['pager'] = array(
+    '#theme' => 'pager',
+  );
+  $build['links'] = array(
+    '#prefix' => '<div class="uc-reports-links">',
+    '#suffix' => '</div>',
+  );
+  $build['links']['export_csv'] = array(
+    '#theme' => 'link',
+    '#text' => t('Export to CSV file.'),
+    '#href' => 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user'],
+    '#suffix' => '&nbsp;&nbsp;&nbsp;',
+  );
+  if (!is_null($_GET['nopage'])) {
+    $build['links']['toggle_pager'] = array(
+      '#theme' => 'link',
+      '#text' => t('Show paged records'),
+      '#href' => 'admin/store/reports/customers',
+    );
+  }
+  else {
+    $build['links']['toggle_pager'] = array(
+      '#theme' => 'link',
+      '#text' => t('Show all records'),
+      '#href' => 'admin/store/reports/customers',
+      '#options' => array('query' => 'nopage=1'),
+    );
+  }
 
-  return $output;
+  return $build;
 }
 
 /**
@@ -277,12 +308,44 @@
   }
   $csv_data = uc_reports_store_csv('uc_products', $csv_rows);
 
-  $output = theme('uc_reports_product_table', array('header' => $header, 'rows' => $rows, 'attributes' => array('width' => '100%', 'class' => array('uc-sales-table'))));
-  $output .= theme('pager');
-  $output .= '<div class="uc-reports-links">'. l(t('Export to CSV file.'), 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user']) .'&nbsp;&nbsp;&nbsp;'. (!is_null($_GET['nopage']) ? l(t('Show paged records'), 'admin/store/reports/products') : l(t('Show all records'), 'admin/store/reports/products', array('query' => 'nopage=1'))) .'</div>';
-  $output .= '<small>*'. t('Make sure %setting_name is set to %state in the <a href="!url">access log settings page</a> to enable views column.', array('%setting_name' => 'count content views', '%state' => 'enabled', '!url' => url('admin/reports/settings', array('query' => 'destination=admin/store/reports/products')))) .'</small>';
-
-  return $output;
+  $build['report'] = array(
+    '#theme' => 'uc_reports_product_table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#attributes' => array('width' => '100%', 'class' => array('uc-sales-table')),
+  );
+  $build['pager'] = array(
+    '#theme' => 'pager',
+  );
+
+  $build['links'] = array(
+    '#prefix' => '<div class="uc-reports-links">',
+    '#suffix' => '</div>',
+  );
+  $build['links']['export_csv'] = array(
+    '#theme' => 'link',
+    '#text' => t('Export to CSV file.'),
+    '#href' => 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user'],
+    '#suffix' => '&nbsp;&nbsp;&nbsp;',
+  );
+  if (!is_null($_GET['nopage'])) {
+    $build['links']['toggle_pager'] = array(
+      '#theme' => 'link',
+      '#text' => t('Show paged records'),
+      '#href' => 'admin/store/reports/products',
+    );
+  }
+  else {
+    $build['links']['toggle_pager'] = array(
+      '#theme' => 'link',
+      '#text' => t('Show all records'),
+      '#href' => 'admin/store/reports/products',
+      '#options' => array('query' => 'nopage=1'),
+    );
+  }
+  $build['instructions'] = array('#markup' => '<small>*'. t('Make sure %setting_name is set to %state in the <a href="!url">access log settings page</a> to enable views column.', array('%setting_name' => 'count content views', '%state' => 'enabled', '!url' => url('admin/reports/settings', array('query' => 'destination=admin/store/reports/products')))) .'</small>');
+
+  return $build;
 }
 
 /**
@@ -461,12 +524,27 @@
   $csv_data = uc_reports_store_csv('uc_products', $csv_rows);
 
   // Build the page output holding the form, table, and CSV export link.
-  $output = drupal_get_form('uc_reports_products_custom_form', $args, $args['status'])
-          . theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('width' => '100%', 'class' => array('uc-sales-table'))))
-           .'<div class="uc-reports-links">'. l(t('Export to CSV file.'), 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user']) .'</div>';
+  $build['form'] = drupal_get_form('uc_reports_products_custom_form', $args, $args['status']);
+  $build['report'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#attributes' => array('width' => '100%', 'class' => array('uc-sales-table')),
+  );
+  $build['pager'] = array(
+    '#theme' => 'pager',
+  );
+  $build['links'] = array(
+    '#prefix' => '<div class="uc-reports-links">',
+    '#suffix' => '</div>',
+  );
+  $build['links']['export_csv'] = array(
+    '#theme' => 'link',
+    '#text' => t('Export to CSV file.'),
+    '#href' => 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user'],
+  );
 
-  $output .= theme('pager');
-  $output .= '<small>*'. t('Make sure %setting_name is set to %state in the <a href="!url">access log settings page</a> to enable views column.', array('%setting_name' => 'count content views', '%state' => 'enabled', '!url' => url('admin/reports/settings', array('query' => 'destination=admin/store/reports/products/custom')))) .'</small>';
+  $build['instructions'] = array('#markup' => '<small>*'. t('Make sure %setting_name is set to %state in the <a href="!url">access log settings page</a> to enable views column.', array('%setting_name' => 'count content views', '%state' => 'enabled', '!url' => url('admin/reports/settings', array('query' => 'destination=admin/store/reports/products/custom')))) .'</small>');
 
   return $output;
 }
@@ -729,7 +807,12 @@
   );
 
   // Add the sales data report table to the output.
-  $output = theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('class' => array('uc-sales-table'))));
+  $build['sales'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#attributes' => array('class' => array('uc-sales-table')),
+  );
 
   // Build the header statistics table header.
   $header = array(array('data' => t('Statistics'), 'width' => '50%'), '');
@@ -742,7 +825,12 @@
   );
 
   // Add the statistics table to the output.
-  $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('width' => '100%', 'class' => array('uc-sales-table'))));
+  $build['statistics'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#attributes' => array('width' => '100%', 'class' => array('uc-sales-table')),
+  );
 
   // Build the total orders by status table header.
   $header = array(array('data' => t('Total orders by status'), 'width' => '50%'), '');
@@ -774,9 +862,14 @@
   }
 
   // Add the total orders by status table to the output.
-  $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('class' => array('uc-sales-table'))));
+  $build['orders'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#attributes' => array('class' => array('uc-sales-table')),
+  );
 
-  return $output;
+  return $build;
 }
 
 /**
@@ -874,11 +967,25 @@
   $csv_data = uc_reports_store_csv('uc_sales_yearly', $csv_rows);
 
   // Build the page output holding the form, table, and CSV export link.
-  $output = drupal_get_form('uc_reports_sales_year_form', $year)
-          . theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('width' => '100%', 'class' => array('uc-sales-table'))))
-           .'<div class="uc-reports-links">'. l(t('Export to CSV file.'), 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user']) .'</div>';
-
-  return $output;
+  $build['form'] = drupal_get_form('uc_reports_sales_year_form', $year);
+  $build['report'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#attributes' => array('width' => '100%', 'class' => array('uc-sales-table')),
+  );
+
+  $build['links'] = array(
+    '#prefix' => '<div class="uc-reports-links">',
+    '#suffix' => '</div>',
+  );
+  $build['links']['export_csv'] = array(
+    '#theme' => 'link',
+    '#text' => t('Export to CSV file.'),
+    '#href' => 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user'],
+  );
+
+  return $build;
 }
 
 /**
@@ -1052,11 +1159,24 @@
   $csv_data = uc_reports_store_csv('uc_sales_custom', $csv_rows);
 
   // Build the page output holding the form, table, and CSV export link.
-  $output = drupal_get_form('uc_reports_sales_custom_form', $args, $args['status'])
-          . theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('width' => '100%', 'class' => array('uc-sales-table'))))
-           .'<div class="uc-reports-links">'. l(t('Export to CSV file.'), 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user']) .'</div>';
+  $build['form'] = drupal_get_form('uc_reports_sales_custom_form', $args, $args['status']);
+  $build['report'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#attributes' => array('width' => '100%', 'class' => array('uc-sales-table')),
+  );
+  $build['links'] = array(
+    '#prefix' => '<div class="uc-reports-links">',
+    '#suffix' => '</div>',
+  );
+  $build['links']['export_csv'] = array(
+    '#theme' => 'link',
+    '#text' => t('Export to CSV file.'),
+    '#href' => 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user'],
+  );
 
-  return $output;
+  return $build;
 }
 
 /**

=== modified file 'uc_stock/uc_stock.admin.inc'
--- uc_stock/uc_stock.admin.inc	2010-02-17 21:01:53 +0000
+++ uc_stock/uc_stock.admin.inc	2010-02-25 15:54:10 +0000
@@ -109,11 +109,45 @@
 
   $csv_data = uc_reports_store_csv('uc_stock', $csv_rows);
 
-  $output = drupal_get_form('uc_stock_report_form')
-          . theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('width' => '100%', 'class' => array('uc-stock-table'))))
-          . theme('pager');
-  $output .= '<div class="uc-reports-links">'. l(t('Export to CSV file'), 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user']) .'&nbsp;&nbsp;&nbsp;'. ((!is_null($_GET['nopage'])) ? l(t('Show paged records'), 'admin/store/reports/stock') : l(t('Show all records'), 'admin/store/reports/stock', $options = array('query' => 'nopage=1'))) .'</div>';
-  return $output;
+  $build['form'] = drupal_get_form('uc_stock_report_form');
+  $build['report'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#attributes' => array('width' => '100%', 'class' => array('uc-stock-table')),
+  );
+  $build['pager'] = array(
+    '#theme' => 'pager',
+  );
+
+  $build['links'] = array(
+    '#prefix' => '<div class="uc-reports-links">',
+    '#suffix' => '</div>',
+  );
+  $build['links']['export_csv'] = array(
+    '#theme' => 'link',
+    '#text' => t('Export to CSV file'),
+    '#href' => 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user'],
+    '#suffix' => '&nbsp;&nbsp;&nbsp;',
+  );
+
+  if (!is_null($_GET['nopage'])) {
+    $build['links']['toggle_pager'] = array(
+      '#theme' => 'link',
+      '#text' => t('Show paged records'),
+      '#href' => 'admin/store/reports/stock',
+    );
+  }
+  else {
+    $build['links']['toggle_pager'] = array(
+      '#theme' => 'link',
+      '#text' => t('Show all records'),
+      '#href' => 'admin/store/reports/stock',
+      '#options' => array('query' => 'nopage=1'),
+    );
+  }
+
+  return $build;
 }
 
 /**

=== modified file 'uc_tax_report/uc_tax_report.module'
--- uc_tax_report/uc_tax_report.module	2010-02-17 21:01:53 +0000
+++ uc_tax_report/uc_tax_report.module	2010-02-25 15:55:13 +0000
@@ -169,15 +169,31 @@
   $csv_data = uc_reports_store_csv('uc_tax_report', $csv_rows);
 
   // Build the page output holding the form, table, and CSV export link.
-  $output = drupal_get_form('uc_tax_report_params_form', $args, $args['status']);
-  $output .= theme('table', array('header' => $header, 'rows' => $rows, 'attributes' => array('width' => '100%', 'class' => array('uc-sales-table'))));
+  $build['form'] = drupal_get_form('uc_tax_report_params_form', $args, $args['status']);
+  $build['report'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+    '#attributes' => array('width' => '100%', 'class' => array('uc-sales-table')),
+  );
+
   if ($star_legend) {
-    $output .= '<div class="uc-reports-note"><p>' . $star_legend . '</p></div>';
+    $build['legend'] = array(
+      '#markup' => $star_legend,
+      '#prefix' => '<div class="uc-reports-note"><p>',
+      '#suffix' => '</p></div>',
+    );
   }
 
-  $output .= '<div class="uc-reports-links">'. l(t('Export to CSV file.'), 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user']) .'</div>';
+  $build['export_csv'] = array(
+    '#theme' => 'link',
+    '#text' => t('Export to CSV file.'),
+    '#href' => 'admin/store/reports/getcsv/'. $csv_data['report'] .'/'. $csv_data['user'],
+    '#prefix' => '<div class="uc-reports-links">',
+    '#suffix' => '</div>',
+  );
 
-  return $output;
+  return $build;
 }
 
 /**

=== modified file 'uc_taxes/uc_taxes.admin.inc'
--- uc_taxes/uc_taxes.admin.inc	2010-02-17 21:01:53 +0000
+++ uc_taxes/uc_taxes.admin.inc	2010-02-25 15:55:57 +0000
@@ -12,17 +12,11 @@
 function uc_taxes_admin_settings() {
   $rows = array();
 
-  $header = array(t('Name'), t('Rate'), t('Taxed products'), t('Taxed product types'), t('Taxed line items'), t('Weight'), 'data' => t('Operations'));
+  $header = array(t('Name'), t('Rate'), t('Taxed products'), t('Taxed product types'), t('Taxed line items'), t('Weight'), array('data' => t('Operations'), 'colspan' => 4));
 
   // Loop through all the defined tax rates.
   foreach (uc_taxes_rate_load() as $rate_id => $rate) {
     // Build the operations links for the tax rate.
-    $ops = array(
-       l(t('edit'), 'admin/store/settings/taxes/'. $rate_id .'/edit'),
-       l(t('conditions'), CA_UI_PATH .'/uc_taxes_'. $rate_id .'/edit/conditions'),
-       l(t('clone'), 'admin/store/settings/taxes/'. $rate_id .'/clone'),
-       l(t('delete'), 'admin/store/settings/taxes/'. $rate_id .'/delete'),
-    );
 
     // Add the row to the table.
     $rows[] = array(
@@ -32,20 +26,31 @@
       implode(', ', $rate->taxed_product_types),
       implode(', ', $rate->taxed_line_items),
       $rate->weight,
-      implode(' | ', $ops),
+      l(t('edit'), 'admin/store/settings/taxes/'. $rate_id .'/edit'),
+      l(t('conditions'), CA_UI_PATH .'/uc_taxes_'. $rate_id .'/edit/conditions'),
+      l(t('clone'), 'admin/store/settings/taxes/'. $rate_id .'/clone'),
+      l(t('delete'), 'admin/store/settings/taxes/'. $rate_id .'/delete'),
     );
   }
 
   // Let the user know if no tax rates are defined.
   if (empty($rows)) {
-    $rows[] = array(array('data' => t('No rates available.'), 'colspan' => 7));
+    $rows[] = array(array('data' => t('No rates available.'), 'colspan' => 10));
   }
 
   // Build the output including the table and a link to add a new rate.
-  $output = theme('table', array('header' => $header, 'rows' => $rows))
-          . l(t('Add a tax rate'), 'admin/store/settings/taxes/add');
+  $build['taxes'] = array(
+    '#theme' => 'table',
+    '#header' => $header,
+    '#rows' => $rows,
+  );
+  $build['add_more'] = array(
+    '#theme' => 'link',
+    '#text' => t('Add a tax rate'),
+    '#href' => 'admin/store/settings/taxes/add',
+  );
 
-  return $output;
+  return $build;
 }
 
 /**

