summaryrefslogtreecommitdiff
path: root/modules/color
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-12-16 13:05:21 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-12-16 13:05:21 +0000
commit4f38ed0b29e86242ce0aee64f9ccab02e8c243d7 (patch)
tree5d5c09b0f5bea63222137b7d047f6871893b371e /modules/color
parenta859f4a0e8b3469e0e6bbc5f4f9246acd641137b (diff)
downloadbrdo-4f38ed0b29e86242ce0aee64f9ccab02e8c243d7.tar.gz
brdo-4f38ed0b29e86242ce0aee64f9ccab02e8c243d7.tar.bz2
#103528 by Heine and gpk: note why the color settings are not available if private file handling is used
Diffstat (limited to 'modules/color')
-rw-r--r--modules/color/color.module28
1 files changed, 17 insertions, 11 deletions
diff --git a/modules/color/color.module b/modules/color/color.module
index 22e174fbb..98f670b98 100644
--- a/modules/color/color.module
+++ b/modules/color/color.module
@@ -30,17 +30,23 @@ function color_theme() {
*/
function color_form_alter(&$form, $form_state, $form_id) {
// Insert the color changer into the theme settings page.
- // TODO: Last condition in the following if disables color changer when private files are used. This should be solved in a different way. See issue #92059.
- if ($form_id == 'system_theme_settings' && color_get_info(arg(4)) && function_exists('gd_info') && variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) == FILE_DOWNLOADS_PUBLIC) {
- $form['color'] = array(
- '#type' => 'fieldset',
- '#title' => t('Color scheme'),
- '#weight' => -1,
- '#attributes' => array('id' => 'color_scheme_form'),
- '#theme' => 'color_scheme_form',
- );
- $form['color'] += color_scheme_form($form_state, arg(4));
- $form['#submit'][] = 'color_scheme_form_submit';
+ if ($form_id == 'system_theme_settings' && color_get_info(arg(4)) && function_exists('gd_info')) {
+ if (variable_get('file_downloads', FILE_DOWNLOADS_PUBLIC) != FILE_DOWNLOADS_PUBLIC) {
+ // Disables the color changer when the private download method is used.
+ // TODO: This should be solved in a different way. See issue #181003.
+ drupal_set_message(t('The color picker only works if the <a href="@url">download method</a> is set to public.', array('@url' => url('admin/settings/file-system'))), 'warning');
+ }
+ else {
+ $form['color'] = array(
+ '#type' => 'fieldset',
+ '#title' => t('Color scheme'),
+ '#weight' => -1,
+ '#attributes' => array('id' => 'color_scheme_form'),
+ '#theme' => 'color_scheme_form',
+ );
+ $form['color'] += color_scheme_form($form_state, arg(4));
+ $form['#submit'][] = 'color_scheme_form_submit';
+ }
}
// Use the generated screenshot in the theme list.