? uc_out_of_stock_coder.patch
Index: uc_out_of_stock.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/uc_out_of_stock/uc_out_of_stock.module,v
retrieving revision 1.2
diff -u -p -r1.2 uc_out_of_stock.module
--- uc_out_of_stock.module	5 Sep 2008 20:51:49 -0000	1.2
+++ uc_out_of_stock.module	7 Sep 2008 23:09:03 -0000
@@ -6,8 +6,8 @@ define ('UC_OUT_OF_STOCK_DEFAULT_HTML', 
 function uc_out_of_stock_form_alter($form_id, &$form) {
   $id = 'uc_product_add_to_cart_form';
   if ( substr($form_id, 0, strlen($id)) == $id ) {
-    drupal_add_js(drupal_get_path('module', 'uc_out_of_stock').'/uc_out_of_stock.js');
-    drupal_add_css(drupal_get_path('module', 'uc_out_of_stock').'/uc_out_of_stock.css');
+    drupal_add_js(drupal_get_path('module', 'uc_out_of_stock') .'/uc_out_of_stock.js');
+    drupal_add_css(drupal_get_path('module', 'uc_out_of_stock') .'/uc_out_of_stock.css');
   }
 }
 
@@ -15,24 +15,25 @@ function uc_out_of_stock_menu($may_cache
   $items = array();
   if ($may_cache) {
 
-  } else {
-  	$items[] = array(
-        'path' => 'admin/store/settings/uc_out_of_stock',
-        'title' => t('Out of Stock Settings'),
-        'access' => user_access('administer store'),
-        'description' => t('Configure out of stock settings.'),
-        'callback' => 'drupal_get_form',
-        'callback arguments' => array('uc_out_of_stock_settings'),
-        'type' => MENU_NORMAL_ITEM,
-      );
+  }
+  else {
+    $items[] = array(
+      'path' => 'admin/store/settings/uc_out_of_stock',
+      'title' => t('Out of Stock Settings'),
+      'access' => user_access('administer store'),
+      'description' => t('Configure out of stock settings.'),
+      'callback' => 'drupal_get_form',
+      'callback arguments' => array('uc_out_of_stock_settings'),
+      'type' => MENU_NORMAL_ITEM,
+    );
 
     $items[] = array(
-        'path' => 'uc_out_of_stock/query',
-        'title' => 'stock query',
-        'callback' => 'uc_out_of_stock_query',
-        'access' => true,
-        'type' => MENU_CALLBACK,
-      );
+      'path' => 'uc_out_of_stock/query',
+      'title' => 'stock query',
+      'callback' => 'uc_out_of_stock_query',
+      'access' => true,
+      'type' => MENU_CALLBACK,
+    );
   }
 
   return $items;
@@ -53,7 +54,7 @@ function uc_out_of_stock_query() {
       if ( $row->active ) {
         $response['stock'] = $row->stock;
         //$response['html'] = l(t('Please enquire'), '/contact', array('class' => 'sifr-natalia'));
-        $response['html'] = check_markup(variable_get('uc_out_of_stock_text', UC_OUT_OF_STOCK_DEFAULT_HTML), variable_get('uc_out_of_stock_format',FILTER_FORMAT_DEFAULT), FALSE);
+        $response['html'] = check_markup(variable_get('uc_out_of_stock_text', UC_OUT_OF_STOCK_DEFAULT_HTML), variable_get('uc_out_of_stock_format', FILTER_FORMAT_DEFAULT), FALSE);
         print implode('|', $response);
       }
     }
@@ -87,9 +88,9 @@ function uc_out_of_stock_settings_submit
 
 
 function uc_out_of_stock_settings() {
-  $text = check_markup(variable_get('uc_out_of_stock_text', UC_OUT_OF_STOCK_DEFAULT_HTML), variable_get('uc_out_of_stock_format',FILTER_FORMAT_DEFAULT), FALSE);
+  $text = check_markup(variable_get('uc_out_of_stock_text', UC_OUT_OF_STOCK_DEFAULT_HTML), variable_get('uc_out_of_stock_format', FILTER_FORMAT_DEFAULT), FALSE);
   $description = '<div class="description">This is the value below rendered as you would expect to see it</div>';
-  $text = '<div style="border: 1px solid lightgrey; padding: 10px;">'.$text.'</div>'.$description;
+  $text = '<div style="border: 1px solid lightgrey; padding: 10px;">'. $text .'</div>'. $description;
 
   $form['uc_out_of_stock_demo'] = array(
     '#type' => 'markup',
@@ -103,7 +104,7 @@ function uc_out_of_stock_settings() {
     '#description' => t('The HTML that will replace the Add To Cart button if no stock is available.'),
   );
 
-  $form['uc_out_of_stock_format'] = filter_form(variable_get('uc_out_of_stock_format',FILTER_FORMAT_DEFAULT));
+  $form['uc_out_of_stock_format'] = filter_form(variable_get('uc_out_of_stock_format', FILTER_FORMAT_DEFAULT));
 
   $form['buttons']['submit'] = array('#type' => 'submit', '#value' => t('Save configuration') );
   $form['buttons']['reset'] = array('#type' => 'submit', '#value' => t('Reset to defaults') );
