summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDries Buytaert <dries@buytaert.net>2008-11-22 10:27:25 +0000
committerDries Buytaert <dries@buytaert.net>2008-11-22 10:27:25 +0000
commite53859bcea19ee30fe2216aac4b4a7ba3989c51a (patch)
tree3e147dadf626cce0c1b09e4b5b0b7318cf74473a
parent8a4fbfc87b608bb3b7d7bb9fbb2e1b3040f99f43 (diff)
downloadbrdo-e53859bcea19ee30fe2216aac4b4a7ba3989c51a.tar.gz
brdo-e53859bcea19ee30fe2216aac4b4a7ba3989c51a.tar.bz2
- Patch #202183 by maartenvg: usability - shorten block configuration page.
-rw-r--r--modules/block/block.admin.inc87
1 files changed, 45 insertions, 42 deletions
diff --git a/modules/block/block.admin.inc b/modules/block/block.admin.inc
index 10d5e7257..505cc255a 100644
--- a/modules/block/block.admin.inc
+++ b/modules/block/block.admin.inc
@@ -177,52 +177,11 @@ function block_admin_configure(&$form_state, $module = NULL, $delta = 0) {
drupal_set_title(t("'%name' block", array('%name' => $info[$delta]['info'])), PASS_THROUGH);
}
- // Standard block configurations.
- $form['user_vis_settings'] = array(
- '#type' => 'fieldset',
- '#title' => t('User specific visibility settings'),
- '#collapsible' => TRUE,
- );
- $form['user_vis_settings']['custom'] = array(
- '#type' => 'radios',
- '#title' => t('Custom visibility settings'),
- '#options' => array(
- t('Users cannot control whether or not they see this block.'),
- t('Show this block by default, but let individual users hide it.'),
- t('Hide this block by default but let individual users show it.')
- ),
- '#description' => t('Allow individual users to customize the visibility of this block in their account settings.'),
- '#default_value' => $edit['custom'],
- );
-
- // Role-based visibility settings.
- $default_role_options = array();
- $result = db_query("SELECT rid FROM {block_role} WHERE module = '%s' AND delta = '%s'", $module, $delta);
- while ($role = db_fetch_object($result)) {
- $default_role_options[] = $role->rid;
- }
- $result = db_query('SELECT rid, name FROM {role} ORDER BY name');
- $role_options = array();
- while ($role = db_fetch_object($result)) {
- $role_options[$role->rid] = $role->name;
- }
- $form['role_vis_settings'] = array(
- '#type' => 'fieldset',
- '#title' => t('Role specific visibility settings'),
- '#collapsible' => TRUE,
- );
- $form['role_vis_settings']['roles'] = array(
- '#type' => 'checkboxes',
- '#title' => t('Show block for specific roles'),
- '#default_value' => $default_role_options,
- '#options' => $role_options,
- '#description' => t('Show this block only for the selected role(s). If you select no roles, the block will be visible to all users.'),
- );
-
$form['page_vis_settings'] = array(
'#type' => 'fieldset',
'#title' => t('Page specific visibility settings'),
'#collapsible' => TRUE,
+ '#collapsed' => TRUE,
);
$access = user_access('use PHP for block visibility');
@@ -253,6 +212,50 @@ function block_admin_configure(&$form_state, $module = NULL, $delta = 0) {
);
}
+ // Role-based visibility settings.
+ $default_role_options = array();
+ $result = db_query("SELECT rid FROM {block_role} WHERE module = '%s' AND delta = '%s'", $module, $delta);
+ while ($role = db_fetch_object($result)) {
+ $default_role_options[] = $role->rid;
+ }
+ $result = db_query('SELECT rid, name FROM {role} ORDER BY name');
+ $role_options = array();
+ while ($role = db_fetch_object($result)) {
+ $role_options[$role->rid] = $role->name;
+ }
+ $form['role_vis_settings'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Role specific visibility settings'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ );
+ $form['role_vis_settings']['roles'] = array(
+ '#type' => 'checkboxes',
+ '#title' => t('Show block for specific roles'),
+ '#default_value' => $default_role_options,
+ '#options' => $role_options,
+ '#description' => t('Show this block only for the selected role(s). If you select no roles, the block will be visible to all users.'),
+ );
+
+ // Standard block configurations.
+ $form['user_vis_settings'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('User specific visibility settings'),
+ '#collapsible' => TRUE,
+ '#collapsed' => TRUE,
+ );
+ $form['user_vis_settings']['custom'] = array(
+ '#type' => 'radios',
+ '#title' => t('Custom visibility settings'),
+ '#options' => array(
+ t('Users cannot control whether or not they see this block.'),
+ t('Show this block by default, but let individual users hide it.'),
+ t('Hide this block by default but let individual users show it.')
+ ),
+ '#description' => t('Allow individual users to customize the visibility of this block in their account settings.'),
+ '#default_value' => $edit['custom'],
+ );
+
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Save block'),