diff --git a/jquery_update.info b/jquery_update.info index 2970d87..ff5e239 100644 --- a/jquery_update.info +++ b/jquery_update.info @@ -5,4 +5,4 @@ core = 7.x files[] = jquery_update.module files[] = jquery_update.install -configure = admin/config/development/performance +configure = admin/config/development/jquery_update diff --git a/jquery_update.module b/jquery_update.module index 5f70465..c98e023 100644 --- a/jquery_update.module +++ b/jquery_update.module @@ -81,10 +81,36 @@ function jquery_update_library_alter(&$javascript, $module) { } /** + * Implements hook_permission(). + */ +function jquery_update_permission() { + return array( + 'access jQuery update' => array( + 'title' => t('administer jQuery update configuration'), + ), + ); +} + +/** + * Implements hook_menu(). + */ +function jquery_update_menu() { + $items['admin/config/development/jquery_update'] = array( + 'title' => 'jQuery update', + 'description' => 'Upgrades the version of jQuery in Drupal core to a newer version of jQuery.', + 'page callback' => 'drupal_get_form', + 'page arguments' => array('jquery_update_settings'), + 'access arguments' => array('access jQuery update'), + ); + + return $items; +} + +/** * Implementation of hook_form_FORM_ID_alter(). */ -function jquery_update_form_system_performance_settings_alter(&$form, &$form_state) { - $form['bandwidth_optimization']['jquery_update_jquery_version'] = array( +function jquery_update_settings() { + $form['jquery_update_jquery_version'] = array( '#type' => 'select', '#title' => t('jQuery Version'), '#options' => array( @@ -94,7 +120,7 @@ function jquery_update_form_system_performance_settings_alter(&$form, &$form_sta '#default_value' => variable_get('jquery_update_jquery_version', '1.5'), '#description' => t('Select which jQuery version branch to use.'), ); - $form['bandwidth_optimization']['jquery_update_compression_type'] = array( + $form['jquery_update_compression_type'] = array( '#type' => 'radios', '#title' => t('jQuery compression level'), '#options' => array( @@ -103,7 +129,7 @@ function jquery_update_form_system_performance_settings_alter(&$form, &$form_sta ), '#default_value' => variable_get('jquery_update_compression_type', 'min'), ); - $form['bandwidth_optimization']['jquery_update_jquery_cdn'] = array( + $form['jquery_update_jquery_cdn'] = array( '#type' => 'select', '#title' => t('jQuery and jQuery UI CDN'), '#options' => array( @@ -115,6 +141,8 @@ function jquery_update_form_system_performance_settings_alter(&$form, &$form_sta '#default_value' => variable_get('jquery_update_jquery_cdn', 'none'), '#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.'), ); + + return system_settings_form($form); } /**