diff options
author | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-07-30 18:48:00 +0000 |
---|---|---|
committer | Steven Wittens <steven@10.no-reply.drupal.org> | 2005-07-30 18:48:00 +0000 |
commit | 36f6cdc74a4a4fe944eb2d06003729bdab511bac (patch) | |
tree | 9e0291e87b34ab701dd55ee4aefa609fc890a4bf /modules/system/system.module | |
parent | 897aae3e31d4bf0a3890fafab6322adf53f738da (diff) | |
download | brdo-36f6cdc74a4a4fe944eb2d06003729bdab511bac.tar.gz brdo-36f6cdc74a4a4fe944eb2d06003729bdab511bac.tar.bz2 |
- #23310: Gray out picture theme settings if pictures are disabled.
Diffstat (limited to 'modules/system/system.module')
-rw-r--r-- | modules/system/system.module | 32 |
1 files changed, 22 insertions, 10 deletions
diff --git a/modules/system/system.module b/modules/system/system.module index b2919e28e..277dd7081 100644 --- a/modules/system/system.module +++ b/modules/system/system.module @@ -721,20 +721,32 @@ function system_theme_settings($key = '') { $group = ''; // Toggle settings - $toggles = array('toggle_name' => t('Site name'), - 'toggle_slogan' => t('Site slogan'), - 'toggle_mission' => t('Mission statement'), - 'toggle_primary_links' => t('Primary links'), - 'toggle_secondary_links' => t('Secondary links'), - 'toggle_node_user_picture' => t('User pictures in posts'), - 'toggle_comment_user_picture' => t('User pictures in comments'), - 'toggle_search' => t('Search box'), - 'toggle_favicon' => t('Shortcut icon')); + $toggles = array( + 'toggle_name' => t('Site name'), + 'toggle_slogan' => t('Site slogan'), + 'toggle_mission' => t('Mission statement'), + 'toggle_primary_links' => t('Primary links'), + 'toggle_secondary_links' => t('Secondary links'), + 'toggle_node_user_picture' => t('User pictures in posts'), + 'toggle_comment_user_picture' => t('User pictures in comments'), + 'toggle_search' => t('Search box'), + 'toggle_favicon' => t('Shortcut icon') + ); + + // Some features are not always available + $disabled = array(); + if (!variable_get('user_pictures', 0)) { + $disabled['toggle_node_user_picture'] = true; + $disabled['toggle_comment_user_picture'] = true; + } + if (!module_exist('search')) { + $disabled['toggle_search'] = true; + } foreach ($toggles as $name => $title) { if ((!$key) || in_array($name, $features)) { // disable search box if search.module is disabled - $group .= form_checkbox($title, "$var][$name", 1, $settings[$name], NULL, (!module_exist('search') && $name == 'toggle_search') ? array('disabled' => 'disabled') : NULL); + $group .= form_checkbox($title, "$var][$name", 1, $settings[$name], NULL, isset($disabled[$name]) ? array('disabled' => 'disabled') : NULL); } } if ($group) { |