diff --git a/jquery_update.module b/jquery_update.module index 7329525..cb94f0f 100644 --- a/jquery_update.module +++ b/jquery_update.module @@ -70,13 +70,13 @@ function jquery_update_library_alter(&$javascript, $module) { return; } - // Ignore admin theme - $ignore_admin_theme = variable_get('jquery_update_ignore_admin_theme', '0'); - if ($ignore_admin_theme) { - global $theme_key; - $admin_theme_key = variable_get('admin_theme', '0'); - if ($theme_key === $admin_theme_key) { - return; + // Check if we are updating the admin theme. + if ($admin_theme_key = variable_get('admin_theme')) { + if (!variable_get('jquery_update_admin_theme', '0')) { + global $theme_key; + if ($theme_key === $admin_theme_key) { + return; + } } } @@ -138,6 +138,15 @@ function jquery_update_settings_form() { '#default_value' => variable_get('jquery_update_jquery_version', '1.5'), '#description' => t('Select which jQuery version branch to use.'), ); + // Only show this setting if a separate administration theme is in use. + if (variable_get('admin_theme')) { + $form['jquery_update_admin_theme'] = array( + '#type' => 'checkbox', + '#title' => t('Update administration theme pages'), + '#default_value' => variable_get('jquery_update_admin_theme', '0'), + '#description' => t("For all pages using the administration theme, update jQuery to the version selected above."), + ); + } $form['jquery_update_compression_type'] = array( '#type' => 'radios', '#title' => t('jQuery compression level'), @@ -160,13 +169,6 @@ function jquery_update_settings_form() { '#description' => t('Use jQuery and jQuery UI from a CDN. If the CDN is not available the local version of jQuery and jQuery UI will be used.'), ); - $form['jquery_update_ignore_admin_theme'] = array( - '#type' => 'checkbox', - '#title' => t('Ignore Admin Theme'), - '#default_value' => variable_get('jquery_update_ignore_admin_theme', '0'), - '#description' => t('Ignores the admin theme. It defaults to Drupal’s jQuery version for all administration pages.'), - ); - return system_settings_form($form); }