### Eclipse Workspace Patch 1.0
#P embed_widgets
Index: embed_widgets.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/embed_widgets/embed_widgets.module,v
retrieving revision 1.5.2.3
diff -u -r1.5.2.3 embed_widgets.module
--- embed_widgets.module	5 Jun 2008 21:17:23 -0000	1.5.2.3
+++ embed_widgets.module	11 Jun 2008 23:26:49 -0000
@@ -70,11 +70,35 @@
     'access arguments' => array('view code for embedding widgets'),
     'type' => MENU_NORMAL_ITEM,
   );
+  
+  foreach (embed_widgets_get_types(TRUE) as $type => $type_info) {
+    // Add menu items, using the data returned.
+    $items['embed-widgets/%embed_widgets/code/' . $type] = array(
+      'title' => $type_info['title'],
+      'description' => 'Get HTML code for '. $type_info['title'] .' widget.',
+      'page callback' => 'drupal_get_form',
+      'access callback' => 'user_access',
+      'access arguments' => array('view code for embedding ' . $type .' widgets'),
+      'page arguments' => array($type_info['code form callback'], 1),
+      'type' => MENU_CALLBACK,
+    );
+  }
 
   return $items;
 }
 
 /**
+* Return available embed widget types.
+*/
+function embed_widgets_get_types($refresh = FALSE) {
+  static $types = array();
+  if ($refresh || empty($types)) {
+    $types = module_invoke_all('embed_widget_types');
+  }
+  return $types;
+}
+
+/**
  * Menu callback; displays a list of available embed widgets.
  */
 function embed_widgets_overview() {
@@ -197,36 +221,3 @@
   db_query("DELETE FROM {embed_widgets} WHERE wid = %d", $wid);
 }
 
-
-
-function _embed_widgets_filter($embed_widget, $content) {
-  if ($embed_widget['features']['filter_heads']) {
-    $content = preg_replace_callback('/(<h|<\/h)(\d+)/', '_embed_widgets_filter_callback', $content);
-  }
-  return $content;
-}
-
-function _embed_widgets_filter_callback($matches) {
-  return $matches[1] . ($matches[2] + 1);
-}
-
-/**
- * Return the themed output of an embedded page.
- */
-function theme_embed_widgets_page($page) {
-  // Allow theme overrides of the template.
-  if (file_exists(path_to_theme() .'/embed_widgets_page.tpl.php')) {
-    $file = path_to_theme() .'/embed_widgets_page.tpl.php';
-  }
-  else {
-    $file = drupal_get_path('module', 'embed_widgets') .'/embed_widgets_page.tpl.php';
-  }
-  // Adapted from _phptemplate_render();
-  extract($page, EXTR_SKIP);       // Extract the variables to a local namespace.
-  ob_start();                      // Start output buffering.
-  include $file;                   // Include the file.
-  $contents = ob_get_contents();   // Get the contents of the buffer.
-  ob_end_clean();                  // End buffering and discard.
-  return $contents;                // Return the contents.
-}
-
Index: embed_widgets_iframe/embed_widgets_iframe.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/embed_widgets/embed_widgets_iframe/Attic/embed_widgets_iframe.module,v
retrieving revision 1.1.2.7
diff -u -r1.1.2.7 embed_widgets_iframe.module
--- embed_widgets_iframe/embed_widgets_iframe.module	11 Jun 2008 22:50:30 -0000	1.1.2.7
+++ embed_widgets_iframe/embed_widgets_iframe.module	11 Jun 2008 23:26:49 -0000
@@ -9,6 +9,18 @@
 
 
 /**
+* Implementation of hook_embed_widget_types().
+*/
+function embed_widgets_iframe_embed_widget_types() {
+  return array(
+    'iframe' => array(
+      'title' => t('IFrame'),
+      'code form callback' => 'embed_widgets_iframe_code_form',
+    ),
+  );
+}
+
+/**
  * Implementation of hook_perm().
  */
 function embed_widgets_iframe_perm() {
@@ -20,15 +32,6 @@
  */
 function embed_widgets_iframe_menu() {
   $items = array();
-  $items['embed-widgets/%embed_widgets/code/iframe'] = array(
-      'title' => $embed_widget['title'],
-      'description' => 'Get HTML code for IFrame widget.',
-      'page callback' => 'drupal_get_form',
-      'access callback' => 'user_access', 
-      'access arguments' => array('view code for embedding iframe widgets'),
-      'page arguments' => array('embed_widgets_iframe_code_form'),
-      'type' => MENU_CALLBACK,
-    );
   $items['embed-widgets/%embed_widgets/embed/iframe'] = array(
       'title' => $embed_widget['title'],
       'description' => 'The embedded content.',
@@ -257,7 +260,7 @@
  * @return
  *   A form array.
  */
-function embed_widgets_iframe_code_form() {
+function embed_widgets_iframe_code_form(&$form_state, $embed_widget = '') {
   $embed_widget = embed_widgets_load(arg(1));
   $form = array();
   $form['embed_widgets_code'] = array(
@@ -265,7 +268,6 @@
     '#title' => t('Embed code for %title widget', array('%title' => $embed_widget['title'])),
     '#description' => t('To connect to this site, include this code on a page on your external website. Widget description: %description', array('%description' => $embed_widget['description'])),
     '#default_value' => embed_widgets_iframe_code($embed_widget),
-    //'#default_value' => t('This is a test'),
   );
 
   return $form;
