? 486370-language-bug.patch ? 490846-admin.patch ? 490846-user-enable.patch ? domain_views/485762-views.patch Index: domain.admin.inc =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.admin.inc,v retrieving revision 1.29 diff -u -p -r1.29 domain.admin.inc --- domain.admin.inc 13 Jun 2009 20:02:39 -0000 1.29 +++ domain.admin.inc 14 Jun 2009 19:11:03 -0000 @@ -818,6 +818,50 @@ function domain_batch_form($form_state, /** * FormsAPI */ +function theme_domain_admin_users_form($form) { + // Overview table: + $header = array( + theme('table_select_header_cell'), + array('data' => t('Username'), 'field' => 'u.name'), + array('data' => t('Status'), 'field' => 'u.status'), + t('Roles'), + t('Domains'), + array('data' => t('Member for'), 'field' => 'u.created', 'sort' => 'desc'), + array('data' => t('Last access'), 'field' => 'u.access'), + t('Operations') + ); + + $output = drupal_render($form['options']); + $output .= drupal_render($form['domain']); + if (isset($form['name']) && is_array($form['name'])) { + foreach (element_children($form['name']) as $key) { + $rows[] = array( + drupal_render($form['accounts'][$key]), + drupal_render($form['name'][$key]), + drupal_render($form['status'][$key]), + drupal_render($form['roles'][$key]), + drupal_render($form['user_domains'][$key]), + drupal_render($form['member_for'][$key]), + drupal_render($form['last_access'][$key]), + drupal_render($form['operations'][$key]), + ); + } + } + else { + $rows[] = array(array('data' => t('No users available.'), 'colspan' => '7')); + } + + $output .= theme('table', $header, $rows); + if ($form['pager']['#value']) { + $output .= drupal_render($form['pager']); + } + + $output .= drupal_render($form); + + return $output;} +/** + * FormsAPI + */ function theme_domain_batch_form($form) { $output = ''; $output = drupal_render($form['message']); Index: domain.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.module,v retrieving revision 1.110 diff -u -p -r1.110 domain.module --- domain.module 13 Jun 2009 20:02:39 -0000 1.110 +++ domain.module 14 Jun 2009 19:11:05 -0000 @@ -211,6 +211,10 @@ function domain_perm() { */ function domain_theme() { $themes = array( + 'domain_admin_users_form' => array( + 'arguments' => array('form' => array()), + 'file' => 'domain.admin.inc', + ), 'domain_batch_form' => array( 'arguments' => array('form' => array()), 'file' => 'domain.admin.inc', @@ -426,6 +430,112 @@ function domain_user($op, &$edit, &$acco } /** + * Implement hook_user_operations(). + */ +function domain_user_operations() { + if (!user_access('assign domain editors')) { + return; + } + return array( + 'domain' => array( + 'label' => t('Assign users to domains'), + 'callback' => 'domain_user_operation_assign', + ), + ); +} + +/** + * Implement hook_form_alter(). + */ +function domain_form_user_admin_account_alter(&$form, $form_state) { + if (!user_access('assign domain editors')) { + return; + } + $options = array(); + foreach (domain_domains() as $data) { + // Cannot pass zero in checkboxes. + ($data['domain_id'] == 0) ? $key = -1 : $key = $data['domain_id']; + // The domain must be valid. + if ($data['valid'] || user_access('administer domains')) { + $options[$key] = check_plain($data['sitename']); + } + } + $form['domain'] = array( + '#type' => 'fieldset', + '#title' => t('Affiliate editor options'), + '#collapsible' => TRUE, + '#collapsed' => TRUE, + '#prefix' => '