? 540584-domain-source.patch
? 548140-source-validate.patch
? 561282-views-filtering.patch
? 576444-select-list-format.patch
? 597654-theme.patch
Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/CHANGELOG.txt,v
retrieving revision 1.233
diff -u -p -r1.233 CHANGELOG.txt
--- CHANGELOG.txt 8 Oct 2009 17:04:17 -0000 1.233
+++ CHANGELOG.txt 11 Oct 2009 14:07:37 -0000
@@ -24,7 +24,7 @@
24-AUG-2009
--- #557702 by TCRobbert. Missing retrun in update 6202.
+-- #557702 by TCRobbert. Missing return in update 6202.
23-AUG-2009
Index: README.txt
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/README.txt,v
retrieving revision 1.65
diff -u -p -r1.65 README.txt
--- README.txt 4 Oct 2009 21:11:54 -0000 1.65
+++ README.txt 11 Oct 2009 14:07:38 -0000
@@ -41,6 +41,7 @@ CONTENTS
4.2.1 New Content Settings
4.2.2 Debugging Status
4.2.3 Sort Domain Lists
+4.2.4 Domain Selection Format
4.3 Advanced Settings
4.3.1 Search Settings
4.3.2 Search Engine Optimization
@@ -463,9 +464,9 @@ The Domain Access module has the followi
-- 'publish to any assigned domain'
The node editing form is shown normally, and the user is presented a
- list of checkboxes. These options represent the affiliate domains that
- the user is allowed to publish content to, according to the domains
- assigned to their user account.
+ list of checkboxes or a multiple select list. These options represent the
+ affiliate domains that the user is allowed to publish content to, according
+ to the domains assigned to their user account.
Note that if this option is selected, users will also be shown a list of
affiliates to which the node is assigned. This list shows only the
@@ -616,6 +617,17 @@ end-user visible list of domains. The d
these lists are generated and presented to the user.
----
+4.2.4 Domain Selection Format
+
+Controls the form element display when choosing a list of domains. By
+default, Domain Access shows checkboxes, but if your site has a large
+number of domains, checkboxes hinder usability. You may use this setting
+to force domain lists to be displayed as multiple select lists instead.
+
+By default, if you have more than 25 domains, a select list will be used
+for your forms, but you may use this setting to alter that behavior.
+
+----
4.3 Advanced Settings
These settings control advanced features for the module. Some of these
@@ -1043,7 +1055,8 @@ is assigned to that domain or to all dom
Users who have the 'set domain access' permission can assign any node to any or
all registered sites. During node editing, a series of options will be
-displayed as checkboxes under the heading "Domain access options":
+displayed as checkboxes or a multiple select list under the heading
+"Domain access options":
Publishing options:
[] Send to all affiliates
Index: domain.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.admin.inc,v
retrieving revision 1.36
diff -u -p -r1.36 domain.admin.inc
--- domain.admin.inc 9 Sep 2009 02:31:44 -0000 1.36
+++ domain.admin.inc 11 Oct 2009 14:07:40 -0000
@@ -213,6 +213,14 @@ function domain_configure_form($form_sta
'#options' => drupal_map_assoc(array(5, 10, 20, 25, 30, 40, 50, 75, 100, 150, 200, 250, 500, 750, 1000)),
'#description' => t('Sets a break point for the size of domain lists shown to users. After this point, user interfaces will use tables, pagination, and select lists to prevent too many domains from appearing in a list. Note: setting this value higher than 200 may cause memory and display issues for your site.')
);
+ $form['domain_behavior']['domain_select_format'] = array(
+ '#type' => 'select',
+ '#title' => t('Domain selection format'),
+ '#required' => TRUE,
+ '#default_value' => domain_select_format(),
+ '#options' => array(t('Checkboxes'), t('Select list')),
+ '#description' => t('Determines the display format of form elements that display domain lists.')
+ );
$form['domain_advanced'] = array(
'#type' => 'fieldset',
Index: domain.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain.module,v
retrieving revision 1.118
diff -u -p -r1.118 domain.module
--- domain.module 4 Oct 2009 21:35:46 -0000 1.118
+++ domain.module 11 Oct 2009 14:07:42 -0000
@@ -358,6 +358,7 @@ function domain_user($op, &$edit, &$acco
}
// Replace the zero record to -1.
unset($options[0]);
+ $format = domain_select_format();
if (user_access('assign domain editors')) {
$form['domain_user'] = array(
'#type' => 'fieldset',
@@ -367,12 +368,16 @@ function domain_user($op, &$edit, &$acco
'#weight' => 1
);
$form['domain_user']['domain_user'] = array(
- '#type' => 'checkboxes',
+ '#type' => empty($format) ? 'checkboxes' : 'select',
'#options' => $options,
'#title' => t('Domain access settings'),
'#description' => t('Select the affiliates that this user belongs to. Used to grant editing permissions for users with the "edit domain nodes" permission.'),
'#default_value' => $default
);
+ if ($format) {
+ $form['domain_user']['domain_user']['#multiple'] = TRUE;
+ $form['domain_user']['domain_user']['#size'] = count($options) > 10 ? 10 : count($options);
+ }
}
else {
$form['domain_user'] = array(
@@ -467,12 +472,14 @@ function domain_form_user_admin_account_
return;
}
$options = array();
+ $format = domain_select_format();
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']);
+ // Filter checkbox output but not select list.
+ $options[$key] = empty($format) ? check_plain($data['sitename']) : $data['sitename'];
}
}
$form['domain'] = array(
@@ -484,13 +491,17 @@ function domain_form_user_admin_account_
'#weight' => -1,
);
$form['domain']['domains'] = array(
- '#type' => 'checkboxes',
+ '#type' => empty($format) ? 'checkboxes' : 'select',
'#title' => t('Assign to'),
'#options' => $options,
'#required' => FALSE,
'#description' => t('Select which affiliates these users should belong to. Note: this will erase any current assignment for the selsected users.'),
'#default_value' => array(($_domain['domain_id'] == 0) ? -1 : $_domain['domain_id']), // Can't use 0 as a checkbox value.
);
+ if ($format) {
+ $form['domain']['domains']['#multiple'] = TRUE;
+ $form['domain']['domains']['#size'] = count($options) > 10 ? 10 : count($options);
+ }
// Add our domain elements.
foreach (array_keys($form['name']) as $uid) {
$form['user_domains'][$uid][0] = array('#value' => theme('item_list', _domain_user_list($uid)));
@@ -764,6 +775,18 @@ function _domain_rurl_sort($a, $b) {
}
/**
+ * Determine the default format for domain list forms.
+ */
+function domain_select_format() {
+ $domains = domain_domains();
+ $format = 0;
+ if (count($domains) > variable_get('domain_list_size', DOMAIN_LIST_SIZE)) {
+ $format = 1;
+ }
+ return variable_get('domain_select_format', $format);
+}
+
+/**
* Validates a domain string.
* @param string $subdomain
* The string to check for domain validity
@@ -1422,12 +1445,15 @@ function domain_form_alter(&$form, &$for
}
$options = array();
+ // Get the display format of the form element.
+ $format = domain_select_format();
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']);
+ // Checkboxes must be filtered, select listts should not.
+ $options[$key] = empty($format) ? check_plain($data['sitename']) : $data['sitename'];
}
}
// This lets CCK adjust the weight of our element using domain_content_extra_fields().
@@ -1451,13 +1477,17 @@ function domain_form_alter(&$form, &$for
'#default_value' => (isset($form['#node']->nid)) ? $form['#node']->domain_site : variable_get('domain_node_'. $form['#node']->type, $behavior),
);
$form['domain']['domains'] = array(
- '#type' => 'checkboxes',
+ '#type' => empty($format) ? 'checkboxes' : 'select',
'#title' => t('Publish to'),
'#options' => $options,
'#required' => TRUE,
'#description' => t('Select which affiliates can access this content.'),
'#default_value' => (isset($form['#node']->nid)) ? $form['#node']->domains : $default,
);
+ if ($format) {
+ $form['domain']['domains']['#multiple'] = TRUE;
+ $form['domain']['domains']['#size'] = count($options) > 10 ? 10 : count($options);
+ }
}
// If the user has limited permissions, show that form or obey the settings.
else {
@@ -1538,14 +1568,17 @@ function domain_form_alter(&$form, &$for
(empty($raw)) ? $required = TRUE : $required = FALSE;
$form['domain']['domains'] = array(
- '#type' => 'checkboxes',
+ '#type' => empty($format) ? 'checkboxes' : 'select',
'#title' => t('Publish to'),
'#options' => $user_options,
'#required' => $required,
'#description' => t('Select which affiliates can access this content.'),
'#default_value' => (isset($form['#node']->nid)) ? $form['#node']->domains : $default_options,
);
-
+ if ($format) {
+ $form['domain']['domains']['#multiple'] = TRUE;
+ $form['domain']['domains']['#size'] = count($user_options) > 10 ? 10 : count($user_options);
+ }
// Show the options that cannot be changed.
$list = array();
if ($form['#node']->domain_site) {
Index: domain_content/domain_content.admin.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_content/domain_content.admin.inc,v
retrieving revision 1.12
diff -u -p -r1.12 domain_content.admin.inc
--- domain_content/domain_content.admin.inc 22 Aug 2009 21:56:25 -0000 1.12
+++ domain_content/domain_content.admin.inc 11 Oct 2009 14:07:43 -0000
@@ -255,12 +255,14 @@ function domain_content_form($form_state
// Privileged users can make global changes to Domain Access permissions.
if (user_access('set domain access')) {
$options = array();
+ $format = domain_select_format();
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']);
+ // Filter checkboxes but not select lists.
+ $options[$key] = empty($format) ? check_plain($data['sitename']) : $data['sitename'];
}
}
// If the user is a site admin, show the form, otherwise pass it silently.
@@ -282,13 +284,17 @@ function domain_content_form($form_state
'#default_value' => variable_get('domain_behavior', DOMAIN_INSTALL_RULE),
);
$form['domain']['domains'] = array(
- '#type' => 'checkboxes',
+ '#type' => empty($format) ? 'checkboxes' : 'select',
'#title' => t('Publish to'),
'#options' => $options,
'#required' => FALSE,
'#description' => t('Select which affiliates can access this content.'),
'#default_value' => array(($_domain['domain_id'] == 0) ? -1 : $_domain['domain_id']), // Can't use 0 as a checkbox value.
);
+ if ($format) {
+ $form['domain']['domains']['#multiple'] = TRUE;
+ $form['domain']['domains']['#size'] = count($options) > 10 ? 10 : count($options);
+ }
}
}
// Users must have passed at least one access check to have batch options.
Index: domain_views/includes/domain_views_plugin_access.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/domain/domain_views/includes/domain_views_plugin_access.inc,v
retrieving revision 1.1
diff -u -p -r1.1 domain_views_plugin_access.inc
--- domain_views/includes/domain_views_plugin_access.inc 1 May 2009 19:45:21 -0000 1.1
+++ domain_views/includes/domain_views_plugin_access.inc 11 Oct 2009 14:07:43 -0000
@@ -39,24 +39,29 @@ class domain_views_plugin_access extends
function options_form(&$form, &$form_state) {
$domains = domain_domains();
$options = array();
+ $format = domain_select_format();
foreach ($domains as $domain) {
// Checkboxes cannot handles zeros.
if ($domain['domain_id'] == 0) {
$domain['domain_id'] = -1;
}
- $options[$domain['domain_id']] = check_plain($domain['sitename']);
- }
- $type = 'checkboxes';
- if (count($options) > 20) {
- $type = 'select';
+ // The domain must be valid.
+ if ($domain['valid'] || user_access('administer domains')) {
+ // Filter checkboxes but not select lists.
+ $options[$domain['domain_id']] = empty($format) ? check_plain($domain['sitename']) : $domain['sitename'];
+ }
}
$form['domains'] = array(
- '#type' => $type,
+ '#type' => empty($format) ? 'checkboxes' : 'select',
'#multiple' => TRUE,
'#options' => $options,
'#title' => t('Domains'),
'#default_value' => $this->options['domains'],
'#description' => t('Only users with the selected permission flag will be able to access this display. Note that users with "access all views" can see any view, regardless of other permissions.'),
);
+ if ($format) {
+ $form['domains']['#multiple'] = TRUE;
+ $form['domains']['#size'] = count($options) > 10 ? 10 : count($options);
+ }
}
}