Index: nrembrowser.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nrembrowser/nrembrowser.module,v
retrieving revision 1.13.2.67
diff -u -p -r1.13.2.67 nrembrowser.module
--- nrembrowser.module	22 Sep 2010 20:38:48 -0000	1.13.2.67
+++ nrembrowser.module	6 Oct 2010 01:21:12 -0000
@@ -1024,24 +1024,36 @@ function nrembrowser_add_media_page_form
       }
     }
 
+    $hide_submit = FALSE;
     // Filter nodes by views.
     if (isset($options['view_name'])) {
       $references = nrembrowser_build_view($options);
     }
     else {
-      // Get the db placeholders for our array of allowed types.
-      $placeholders = db_placeholders($allowed_types, 'varchar');
-
-      // Write the SQL.
-      $sql = db_rewrite_sql("SELECT nid, title FROM {node} WHERE type in ($placeholders) ORDER BY created DESC");
-      if ($options['use_pager']) {
-        $results = pager_query($sql, $options['items_per_page'], $options['pager_element'], NULL, $allowed_types);
+      if (!empty($allowed_types)) {
+        // Get the db placeholders for our array of allowed types.
+        $placeholders = db_placeholders($allowed_types, 'varchar');
+
+        // Write the SQL.
+        $sql = db_rewrite_sql("SELECT nid, title FROM {node} WHERE type in ($placeholders) ORDER BY created DESC");
+        if ($options['use_pager']) {
+          $results = pager_query($sql, $options['items_per_page'], $options['pager_element'], NULL, $allowed_types);
+        }
+        else {
+          $results = db_query($sql, $allowed_types);
+        }
+        while ($result = db_fetch_array($results)) {
+          $references[$result['nid']] = $result;
+        }
       }
       else {
-        $results = db_query($sql, $allowed_types);
-      }
-      while ($result = db_fetch_array($results)) {
-        $references[$result['nid']] = $result;
+        if (user_access('administer site configuration')) {
+          drupal_set_message(t('You must first add a content type to be included into the WYSIWYG nrembrowser by going to the Node Reference / Embed Media Browser 
+            !settings_page and selecting content types that you would like to add to the browser for WYSIWYG from the fieldset "%settings_fieldset".', 
+            array('!settings_page' => l(t('settings page'), 'admin/settings/nrembrowser'), '%settings_fieldset' => t('Node type settings'))), 'error');
+        }
+        $options['empty_message'] = nrembrowser_variable_get('wysiwyg_empty_user_txt');
+        $hide_submit = TRUE;
       }
     }
   }
@@ -1112,10 +1124,13 @@ function nrembrowser_add_media_page_form
     );
   }
 
-  $form['submit'] = array(
-    '#type' => 'submit',
-    '#value' => t('OK'),
-  );
+  if ($hide_submit != TRUE) {
+    $form['submit'] = array(
+      '#type' => 'submit',
+      '#value' => t('OK'),
+    );
+  }
+
   return $form;
 }
 
Index: includes/nrembrowser.variables.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nrembrowser/includes/nrembrowser.variables.inc,v
retrieving revision 1.2.2.13
diff -u -p -r1.2.2.13 nrembrowser.variables.inc
--- includes/nrembrowser.variables.inc	4 Aug 2010 21:34:46 -0000	1.2.2.13
+++ includes/nrembrowser.variables.inc	6 Oct 2010 01:21:12 -0000
@@ -111,6 +111,7 @@ function nrembrowser_variable_default($n
       'wysiwyg_default_icon' => drupal_get_path('module', 'nrembrowser') .'/plugins/nrembrowser/images/icon-image.png',
       'imagecache_preset' => 'nrembrowser_thumbnail',
       'wysiwyg_imagecache_preset' => '',
+      'wysiwyg_empty_user_txt' => t('There are no content types configured for Node Reference / Embed Media Browser please contact a site administrator.'),
 
       // IFrame variables for the embedded node add form.
       'iframe_width' => '100%',
