From bcdc930c978b25d39606e22590128f8706f1c6ca Mon Sep 17 00:00:00 2001
From: Tom Kirkpatrick <tom@systemseed.com>
Date: Thu, 29 Mar 2012 19:38:26 +0200
Subject: [PATCH] Addition of previous and next classes, and more flexibility
 for advanced theming

---
 commerce_checkout_progress.module |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/commerce_checkout_progress.module b/commerce_checkout_progress.module
index 216b5b8..0b42d85 100644
--- a/commerce_checkout_progress.module
+++ b/commerce_checkout_progress.module
@@ -162,10 +162,16 @@ function theme_commerce_checkout_progress_list($variables) {
   foreach ($items as $page_id => $page) {
     $class = array();
     if ($page_id === $current_page) {
-      $class = array('active');
+      $class[] = 'active';
       // Active page and next pages should not be linked.
       $visited = FALSE;
     }
+    if ($page_id === $items[$current_page]['prev_page']) {
+      $class[] = 'previous';
+    }
+    if ($page_id === $items[$current_page]['next_page']) {
+      $class[] = 'next';
+    }
     // @TODO: Calculate width based on 100 / qty of pages.
     $class[] = $page_id;
     $data    = t($page['title']);
@@ -179,7 +185,7 @@ function theme_commerce_checkout_progress_list($variables) {
         // Only render the link on the pages those user has already been on.
         // Make sure the loaded order is the same one found in the URL.
         if (arg(1) == $order_id) {
-          $data = l($data, "checkout/{$order_id}/{$page_id}");
+          $data = l($data, "checkout/{$order_id}/{$page_id}", array('html' => TRUE));
         }
       }
     }
-- 
1.7.4.4

