From b4c737a2a5ed9bf9905c91107f94e42df36f2c44 Mon Sep 17 00:00:00 2001 From: Angie Byron Date: Thu, 22 Jan 2009 03:11:54 +0000 Subject: #287178 by justinrandell: Break up various hook_form_alter()s to hook_form_FORM_ID_alters(). --- modules/update/update.module | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'modules/update/update.module') diff --git a/modules/update/update.module b/modules/update/update.module index 8952f6e55..d103f0431 100644 --- a/modules/update/update.module +++ b/modules/update/update.module @@ -286,17 +286,27 @@ function update_cron() { } /** - * Implementation of hook_form_alter(). + * Implementation of hook_form_FORM_ID_alter(). * * Adds a submit handler to the system modules and themes forms, so that if a * site admin saves either form, we invalidate the cache of available updates. * * @see update_invalidate_cache() */ -function update_form_alter(&$form, $form_state, $form_id) { - if ($form_id == 'system_modules' || $form_id == 'system_themes' ) { - $form['#submit'][] = 'update_invalidate_cache'; - } +function update_form_system_themes_alter(&$form, $form_state) { + $form['#submit'][] = 'update_invalidate_cache'; +} + +/** + * Implementation of hook_form_FORM_ID_alter(). + * + * Adds a submit handler to the system modules and themes forms, so that if a + * site admin saves either form, we invalidate the cache of available updates. + * + * @see update_invalidate_cache() + */ +function update_form_system_modules_alter(&$form, $form_state) { + $form['#submit'][] = 'update_invalidate_cache'; } /** -- cgit v1.2.3