? 372887-domain_batch_operations.patch
Index: API.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/API.php,v
retrieving revision 1.50
diff -u -p -r1.50 API.php
--- API.php	1 Nov 2009 16:30:55 -0000	1.50
+++ API.php	1 Nov 2009 18:17:41 -0000
@@ -495,6 +495,10 @@ function hook_domainconf() {
  *
  * - '#group' [optional] Used to place elements into fieldsets for the main domain configuration page. If not set, any
  *    new element will be added to the 'Site configuration' fieldset.
+ *
+ * - '#update_all' [optional] Allows the batch settings form to use one input field to reset all values. This should beginLogging
+ * set to TRUE in most cases. If your value must be unique per domain, set this to FALSE or leave empty.
+ *
  * - '#module' [optional] Used to group like elements together on the batch action list.
  *
  * @ingroup domain_hooks
@@ -518,6 +522,7 @@ function hook_domainbatch() {
     '#data_type' => 'string',
     '#weight' => 0,
     '#group' => t('My settings'),
+    '#update_all' => TRUE,
     '#module' => t('Domain Access'),
   );
   return $batch;
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/README.txt,v
retrieving revision 1.71
diff -u -p -r1.71 README.txt
--- README.txt	31 Oct 2009 19:12:04 -0000	1.71
+++ README.txt	1 Nov 2009 18:17:43 -0000
@@ -986,6 +986,14 @@ additional batch actions.
 
 It may be necessary to enter the batch form from the primary domain.
 
+For some settings, you may see an 'Update value for all domains' section
+of the form. You may use this value to reset all domains to the same
+setting. This option is not available for settings that must be unique
+per domain, such as the domain string.
+
+For global settings to apply, you must check the 'Apply to all domains'
+box before submitting the form.
+
 ----
 4.10  Assigning Users to Domains
 
Index: domain.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.admin.inc,v
retrieving revision 1.40
diff -u -p -r1.40 domain.admin.inc
--- domain.admin.inc	31 Oct 2009 18:28:32 -0000	1.40
+++ domain.admin.inc	1 Nov 2009 18:17:44 -0000
@@ -775,6 +775,25 @@ function domain_batch_form($form_state, 
     '#type' => 'markup',
     '#value' => theme('domain_batch_title', $batch)
   );
+
+  // For some values, allow every record to be updated.
+  if (!empty($batch['#update_all'])) {
+    $form['domain_batch_all'] = array(
+      '#type' => 'fieldset',
+      '#title' => t('Update value for all domains'),
+      '#weight' => -10,
+      '#collapsible' => TRUE,
+      '#collapsed' => TRUE,
+      '#description' => t('By entering a value below and checking the <strong>Apply to all domains</strong> option, you can set the desired value for all domains.'),
+    );
+    $form['domain_batch_all']['batch_all_setting'] = $batch['#form'];
+    $form['domain_batch_all']['batch_all_setting']['#default_value'] = $batch['#system_default'];
+    $form['domain_batch_all']['batch_override'] = array(
+      '#type' => 'checkbox',
+      '#title' => t('Apply to all domains'),
+    );
+    $form['domain_batch_all']['submit'] = array('#type' => 'submit', '#value' => t('Update all domain settings'));
+  }
   $form['domain_batch'] = array(
     '#tree' => TRUE,
     '#title' => $batch['#form']['#title'],
@@ -888,6 +907,9 @@ function theme_domain_admin_users_form($
 function theme_domain_batch_form($form) {
   $output = '';
   $output = drupal_render($form['message']);
+  if (isset($form['domain_batch_all'])) {
+    $output .= drupal_render($form['domain_batch_all']);
+  }
   $header = array(t('Id'), t('Domain'), t('Setting'));
   $rows = array();
   foreach (element_children($form['domain_batch']) as $key) {
@@ -932,6 +954,13 @@ function domain_batch_form_validate($for
  * FormsAPI for saving batch form actions.
  */
 function domain_batch_form_submit($form, &$form_state) {
+  if (!empty($form_state['values']['batch_override'])) {
+    foreach ($form_state['values']['domain_batch'] AS $domain_id => $value) {
+      $options_all[$domain_id] = $form_state['values']['batch_all_setting'];
+    }
+    $form_state['values']['domain_batch'] = $options_all;
+  }
+
   $item = $form_state['values']['batch_item'];
   switch ($form_state['values']['handler']) {
     case 'domain':
Index: domain.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.module,v
retrieving revision 1.133
diff -u -p -r1.133 domain.module
--- domain.module	1 Nov 2009 16:30:55 -0000	1.133
+++ domain.module	1 Nov 2009 18:17:47 -0000
@@ -2054,6 +2054,7 @@ function domain_domainbatch() {
     '#variable' => 'domain_root',
     '#validate' => 'domain_batch_validate',
     '#data_type' => 'string',
+    '#update_all' => FALSE,
     '#weight' => -10,
   );
   //Change all the sitenames at once.
@@ -2071,6 +2072,7 @@ function domain_domainbatch() {
     '#variable' => 'domain_sitename',
     '#validate' => 'domain_batch_validate',
     '#data_type' => 'string',
+    '#update_all' => TRUE,
     '#weight' => -10,
   );
   // Change all the schemes at once.
@@ -2086,6 +2088,7 @@ function domain_domainbatch() {
     '#system_default' => variable_get('domain_scheme', 'http://'),
     '#variable' => 'domain_scheme',
     '#data_type' => 'string',
+    '#update_all' => TRUE,
     '#weight' => -10,
   );
   // Change all the valid flags at once.
@@ -2100,6 +2103,7 @@ function domain_domainbatch() {
     '#meta_description' => t('Edit all domain status flags.'),
     '#system_default' => 1,
     '#data_type' => 'integer',
+    '#update_all' => TRUE,
     '#weight' => -10,
   );
   foreach ($batch as $key => $value) {
Index: domain_conf/domain_conf.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_conf/domain_conf.module,v
retrieving revision 1.52
diff -u -p -r1.52 domain_conf.module
--- domain_conf/domain_conf.module	24 Oct 2009 22:11:27 -0000	1.52
+++ domain_conf/domain_conf.module	1 Nov 2009 18:17:48 -0000
@@ -192,6 +192,7 @@ function domain_conf_domainbatch() {
     '#meta_description' => t('Set the email address for all domains.'),
     '#data_type' => 'string',
     '#weight' => -8,
+    '#update_all' => TRUE,
     '#group' => t('Site configuration'),
   );
   // Change the site slogan.
@@ -209,6 +210,7 @@ function domain_conf_domainbatch() {
     '#meta_description' => t('Set the site slogan for all domains.'),
     '#data_type' => 'string',
     '#weight' => -8,
+    '#update_all' => TRUE,
     '#group' => t('Site configuration'),
   );
   // Change the site slogan.
@@ -226,6 +228,7 @@ function domain_conf_domainbatch() {
     '#meta_description' => t('Set the site mission for all domains.'),
     '#data_type' => 'string',
     '#weight' => -8,
+    '#update_all' => TRUE,
     '#group' => t('Site configuration'),
   );
   // Change the site footer.
@@ -243,6 +246,7 @@ function domain_conf_domainbatch() {
     '#meta_description' => t('Set the site footer for all domains.'),
     '#data_type' => 'string',
     '#weight' => -8,
+    '#update_all' => TRUE,
     '#group' => t('Site configuration'),
   );
   // Change the site frontpage.
@@ -260,6 +264,7 @@ function domain_conf_domainbatch() {
     '#meta_description' => t('Set the site frontpage for all domains.'),
     '#data_type' => 'string',
     '#weight' => -8,
+    '#update_all' => TRUE,
     '#group' => t('Site configuration'),
   );
   // Change the anonymous user name.
@@ -277,6 +282,7 @@ function domain_conf_domainbatch() {
     '#meta_description' => t('Set the anonymous user label for all domains.'),
     '#data_type' => 'string',
     '#weight' => -8,
+    '#update_all' => TRUE,
     '#group' => t('Site configuration'),
   );
   // Change the administrative theme.
@@ -299,6 +305,7 @@ function domain_conf_domainbatch() {
     '#meta_description' => t('Set the administrative theme for all domains.'),
     '#data_type' => 'string',
     '#weight' => -8,
+    '#update_all' => TRUE,
     '#group' => t('Administrative theme'),
   );
   // Change the timezone.
@@ -316,6 +323,7 @@ function domain_conf_domainbatch() {
     '#meta_description' => t('Set the default timezone for all domains.'),
     '#data_type' => 'string',
     '#weight' => -6,
+    '#update_all' => TRUE,
     '#group' => t('Timezone settings'),
   );
   // Change the caching mode.
@@ -332,6 +340,7 @@ function domain_conf_domainbatch() {
     '#meta_description' => t('Set the page cache options for all domains.'),
     '#data_type' => 'integer',
     '#weight' => -5,
+    '#update_all' => TRUE,
     '#group' => t('Performance'),
   );
   // Change the cache lifetime.
@@ -346,10 +355,11 @@ function domain_conf_domainbatch() {
     ),
     '#domain_action' => 'domain_conf',
     '#system_default' => variable_get('cache_lifetime', 0),
-    '#variable' => 'cache',
+    '#variable' => 'cache_lifetime',
     '#meta_description' => t('Set the minimum cache lifetime for all domains.'),
     '#data_type' => 'integer',
     '#weight' => -5,
+    '#update_all' => TRUE,
     '#group' => t('Performance'),
   );
   // Change the page compression settings.
@@ -362,10 +372,11 @@ function domain_conf_domainbatch() {
     ),
     '#domain_action' => 'domain_conf',
     '#system_default' => variable_get('page_compression', TRUE),
-    '#variable' => 'cache',
+    '#variable' => 'page_compression',
     '#meta_description' => t('Set the page compression status for all domains.'),
     '#data_type' => 'integer',
     '#weight' => -5,
+    '#update_all' => TRUE,
     '#group' => t('Performance'),
   );
   // Toggle the site offline status.
@@ -382,6 +393,7 @@ function domain_conf_domainbatch() {
     '#meta_description' => t('Set the online / offline status for all domains.'),
     '#data_type' => 'integer',
     '#weight' => -4,
+    '#update_all' => TRUE,
     '#group' => t('Site status'),
   );
   // Change the site offline message.
@@ -399,6 +411,7 @@ function domain_conf_domainbatch() {
     '#meta_description' => t('Set the site offline message for all domains.'),
     '#data_type' => 'string',
     '#weight' => -2,
+    '#update_all' => TRUE,
     '#group' => t('Site status'),
   );
   // Change the default language.
@@ -419,6 +432,7 @@ function domain_conf_domainbatch() {
       '#meta_description' => t('Set the default language for all domains.'),
       '#data_type' => 'string',
       '#weight' => 6,
+      '#update_all' => TRUE,
       '#group' => t('Language settings'),
       '#module' => t('Language'),
     );
@@ -439,6 +453,7 @@ function domain_conf_domainbatch() {
       '#meta_description' => t('Set the default menu options for the content authoring form in all domains.'),
       '#data_type' => 'string',
       '#weight' => 0,
+      '#update_all' => TRUE,
       '#group' => t('Menu settings'),
       '#module' => t('Menu'),
     );
@@ -456,6 +471,7 @@ function domain_conf_domainbatch() {
       '#meta_description' => t('Set the primary links menu in all domains.'),
       '#data_type' => 'string',
       '#weight' => 2,
+      '#update_all' => TRUE,
       '#group' => t('Menu settings'),
       '#module' => t('Menu'),
     );
@@ -472,6 +488,7 @@ function domain_conf_domainbatch() {
       '#meta_description' => t('Set the secondary links menu in all domains.'),
       '#data_type' => 'string',
       '#weight' => 4,
+      '#update_all' => TRUE,
       '#group' => t('Menu settings'),
       '#module' => t('Menu'),
     );
Index: domain_theme/domain_theme.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_theme/domain_theme.module,v
retrieving revision 1.18
diff -u -p -r1.18 domain_theme.module
--- domain_theme/domain_theme.module	24 Oct 2009 22:11:27 -0000	1.18
+++ domain_theme/domain_theme.module	1 Nov 2009 18:17:49 -0000
@@ -219,7 +219,8 @@ function domain_theme_domainbatch() {
     '#system_default' => variable_get('theme_default', 'garland'),
     '#variable' => 'theme_default',
     '#meta_description' => t('Change the themes for all domains.'),
-    '#data_type' => 'integer',
+    '#data_type' => 'string',
+    '#update_all' => TRUE,
     '#weight' => -9,
   );
   foreach ($batch as $key => $value) {
