Index: xmlsitemap.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/xmlsitemap/xmlsitemap.admin.inc,v
retrieving revision 1.19
diff -u -p -r1.19 xmlsitemap.admin.inc
--- xmlsitemap.admin.inc	1 Feb 2010 21:13:56 -0000	1.19
+++ xmlsitemap.admin.inc	2 Feb 2010 21:51:39 -0000
@@ -296,7 +296,17 @@ function xmlsitemap_add_form_entity_summ
 
     $row = array();
     if (!empty($bundle_info['admin']['access'])) {
-      $row[] = l($bundle_info['label'], $bundle_info['admin']['real path'], array('query' => drupal_get_destination()));
+      $row[] = l(
+        $bundle_info['label'],
+        "admin/config/search/xmlsitemap/settings/$entity/$bundle/nojs/",
+        array(
+          'query' => drupal_get_destination(),
+          'attributes' => array(
+            'class' => array('use-dialog', 'use-ajax')
+          ),
+        )
+      );
+      $form['#attached']['library']['dialog'] = array('dialog', 'dialog');
     }
     else {
       $row[] = $bundle_info['label'];
@@ -382,6 +389,74 @@ function xmlsitemap_add_form_type_option
   );
 }
 
+function xmlsitemap_entity_bundle_options_form(&$form, $form_state, $entity, $bundle) {
+  $info = xmlsitemap_get_link_info($entity);
+  $form['description'] = array(
+    '#markup' => '<div class="description">' . t('Changing these type settings will affect any links of this type that have either inclusion or priority set to default.') . '</div>',
+  );
+  $form['entity'] = array(
+    '#type' => 'value',
+    '#value' => $entity,
+  );
+  $form['bundle'] = array(
+    '#type' => 'value',
+    '#value' => $bundle,
+  );
+  $form['entity_info'] = array(
+    '#type' => 'value',
+    '#value' => $info,
+  );
+  $form['status'] = array(
+    '#type' => 'select',
+    '#title' => t('Inclusion'),
+    '#options' => xmlsitemap_get_status_options(),
+    '#default_value' => $info['bundles'][$bundle]['xmlsitemap']['status'],
+  );
+  $form['priority'] = array(
+    '#type' => 'select',
+    '#title' => t('Priority'),
+    '#options' => xmlsitemap_get_priority_options(),
+    '#default_value' => $info['bundles'][$bundle]['xmlsitemap']['priority'],
+    '#states' => array(
+      'invisible' => array(
+        'select[name="status"]' => array('value' => '0'),
+      ),
+    ),
+  );
+  $form['actions'] = array(
+    '#type' => 'container',
+  );
+  $form['actions']['save'] = array(
+    '#type' => 'submit',
+    '#value' => t('Save'),
+  );
+  return $form;
+}
+
+function xmlsitemap_entity_bundle_options_form_submit($form, $form_state) {
+  $info = $form_state['values']['entity_info'];
+  $entity = $form_state['values']['entity'];
+  $bundle = $form_state['values']['bundle'];
+  $status = $form_state['values']['status'];
+  $priority = $form_state['values']['priority'];
+
+  // Update variables.
+  $old_status = variable_get("xmlsitemap_{$entity}_status_{$bundle}", NULL);
+  $old_priority = variable_get("xmlsitemap_{$entity}_priority_{$bundle}", NULL);
+  variable_set("xmlsitemap_{$entity}_status_{$bundle}", $status);
+  variable_set("xmlsitemap_{$entity}_priority_{$bundle}", $priority);
+
+  // Update links in database.
+  if ($old_status != $status) {
+    xmlsitemap_update_links(array('status' => $status), array('type' => $entity, 'subtype' => $bundle, 'status_override' => 0));
+  }
+  if ($old_priority != $priority) {
+    xmlsitemap_update_links(array('priority' => $priority), array('type' => $entity, 'subtype' => $bundle, 'priority_override' => 0));
+  }
+
+  drupal_set_message(t('Settings for the @bundle-label %bundle have been saved.', array('@bundle-label' => drupal_strtolower($info['bundle label']), '%bundle' => $info['bundles'][$bundle]['label'])));
+}
+
 /**
  * Add a link's XML sitemap options to the link's form.
  *
Index: xmlsitemap.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/xmlsitemap/xmlsitemap.module,v
retrieving revision 1.50
diff -u -p -r1.50 xmlsitemap.module
--- xmlsitemap.module	31 Jan 2010 19:13:21 -0000	1.50
+++ xmlsitemap.module	2 Feb 2010 21:51:41 -0000
@@ -130,10 +130,35 @@ function xmlsitemap_menu() {
     'type' => MENU_CALLBACK,
     'file' => 'xmlsitemap.pages.inc',
   );
+  $items['admin/config/search/xmlsitemap/settings/%/%/%dialog_js'] = array(
+    'page callback' => 'xmlsitemap_bundle_settings_dialog',
+    'page arguments' => array(5, 6, 7),
+    'access arguments' => array('administer xmlsitemap'),
+    'type' => MENU_CALLBACK,
+  );
 
   return $items;
 }
 
+function xmlsitemap_bundle_settings_dialog($entity, $bundle, $ajax = FALSE) {
+  $info = xmlsitemap_get_link_info($entity);
+
+  if (!$ajax) {
+    $destination = drupal_get_destination();
+    unset($_GET['destination']);
+    drupal_goto($info['bundles'][$bundle]['admin']['real path'], array('query' => $destination));
+  }
+
+  module_load_include('inc', 'xmlsitemap', 'xmlsitemap.admin');
+
+  $content = drupal_get_form('xmlsitemap_entity_bundle_options_form', $entity, $bundle);
+  $options = array(
+    'title' => t('@bundle XML sitemap settings', array('@bundle' => $info['bundles'][$bundle]['label'])),
+  );
+  $output[] = dialog_command_display($content, $options);
+  ajax_render($output);
+}
+
 /**
  * Implements hook_cron().
  */
