# This patch file was generated by NetBeans IDE
# This patch can be applied using context Tools: Apply Diff Patch action on respective folder.
# It uses platform neutral UTF-8 encoding.
# Above lines and this line are ignored by the patching process.
Index: contributions/modules/webform/webform.module
--- contributions/modules/webform/webform.module Base (1.124.2.94)
+++ contributions/modules/webform/webform.module Locally Modified (Based On 1.124.2.94)
@@ -2412,3 +2412,46 @@
   // Ensure only wanted components are returned, even all are loaded.
   return $return_all ? $component_list : array_intersect_assoc($component_list, $enabled_list);
 }
+
+/**
+ * Implementation of hook_block().
+ */
+function webform_block($op = 'list', $delta = 0, $edit = array()) {
+  switch($op) {
+    case 'list':
+      $blocks = array();
+      $result = db_query(db_rewrite_sql("SELECT n.* FROM {node} n WHERE n.type = 'webform'"));
+      $nodes = array();
+      while ($node = db_fetch_object($result)) {
+        $blocks[$node->nid] = array(
+          'info' => t('@name webform', array('@name' => $node->title)),
+        );
+      }
+      return $blocks;
+    case 'view':
+      // Note title before rendering of form.
+      $title = drupal_get_title();
+      $node = node_load($delta);
+      
+      $submission = array();
+      $enabled = TRUE;
+      // Check if the user can add another submission.
+      if ($node->webform['submit_limit'] != -1) { // -1: Submissions are never throttled.
+        module_load_include('inc', 'webform', 'webform_submissions');
+    
+        if ($limit_exceeded = _webform_submission_limit_check($node)) {
+          $enabled = FALSE;
+        }
+      }
+      $preview = FALSE;
+      $form = drupal_get_form('webform_client_form_'. $delta, $node, $submission, $enabled, $preview);
+      $output = theme('webform_view', $node, $teaser, $page, $form, $enabled);
+      // Restore title, which will have been overridden.
+      drupal_set_title($title);
+      
+      return array(
+        'subject' => t('@type', array('@type' => $node->title)),
+        'content' => $form,
+      );
+  }
+}
\ No newline at end of file
