From 56f8ae58e14db8f5d4d748d2dbb40f164c569f60 Mon Sep 17 00:00:00 2001
From: Keigan Ashall <keigan.ashall@gmail.com>
Date: Tue, 21 Feb 2012 19:16:11 -0500
Subject: [PATCH] Issue #930952: Added theme function for wizard buttons.

---
 includes/wizard.inc       |    3 +--
 includes/wizard.theme.inc |   25 ++++++++++++++++++++++++-
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/includes/wizard.inc b/includes/wizard.inc
index 2ccbc34..08f9c11 100644
--- a/includes/wizard.inc
+++ b/includes/wizard.inc
@@ -285,8 +285,7 @@ function ctools_wizard_wrapper($form, &$form_state) {
   if (empty($form_info['no buttons'])) {
     // Ensure buttons stay on the bottom.
     $form['buttons'] = array(
-      '#prefix' => '<div class="clearfix">',
-      '#suffix' => '</div>',
+      '#theme' => 'ctools_wizard_buttons',
       '#weight' => 1000,
     );
 
diff --git a/includes/wizard.theme.inc b/includes/wizard.theme.inc
index 304906c..d7d3f4c 100644
--- a/includes/wizard.theme.inc
+++ b/includes/wizard.theme.inc
@@ -10,11 +10,17 @@ function ctools_wizard_theme(&$theme) {
     'variables' => array('trail' => NULL),
     'file' => 'includes/wizard.theme.inc',
   );
+  $theme['ctools_wizard_buttons'] = array(
+    'render element' => 'element',
+    'file' => 'includes/wizard.theme.inc',
+  );
 }
 
 /**
- * Themable display of the 'breadcrumb' trail to show the order of the
+ * Themeable display of the 'breadcrumb' trail to show the order of the
  * forms.
+ *
+ * @ingroup themeable 
  */
 function theme_ctools_wizard_trail($vars) {
   $trail = $vars['trail'];
@@ -23,3 +29,20 @@ function theme_ctools_wizard_trail($vars) {
   }
 }
 
+/**
+ * Themeable display of the wizard buttons.
+ *
+ * @ingroup themeable
+ */
+function theme_ctools_wizard_buttons($vars) {
+  $buttons = $vars['element'];
+  // dpm($vars);
+  $output = '';
+    $output .= '<div class="wizard-buttons clearfix" >';
+    foreach(element_children($buttons) as $key) {
+      $output .= drupal_render($buttons[$key]);
+    }
+    $output .= '</div>';
+
+  return $output;
+}
\ No newline at end of file
-- 
1.7.4.4

