summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--imagecache.module21
1 files changed, 21 insertions, 0 deletions
diff --git a/imagecache.module b/imagecache.module
index 1eccf3e..f3654f3 100644
--- a/imagecache.module
+++ b/imagecache.module
@@ -83,6 +83,8 @@ function imagecache_menu() {
}
/**
+ * Implementation of hook_form_FORM_ID_alter.
+ *
* Clear imagecache presets cache on admin/build/modules form.
*/
function imagecache_form_system_modules_alter(&$form, $form_state) {
@@ -90,6 +92,24 @@ function imagecache_form_system_modules_alter(&$form, $form_state) {
}
/**
+ * Implementation of hook_form_FORM_ID_alter.
+ *
+ * The file system form is modified to include an extra submit handler, so
+ * that imagecache can rebuild the menu after the filesystem path is changed.
+ */
+function imagecache_form_system_file_system_settings_alter(&$form, &$form_state) {
+ $form['#submit'][] = 'imagecache_system_file_system_submit';
+}
+
+/**
+ * Rebuild menus to ensure we've got the right files directory callback.
+ */
+function imagecache_system_file_system_submit($form, &$form_state) {
+ menu_rebuild();
+}
+
+
+/**
* Implementation of hook_theme().
*/
function imagecache_theme() {
@@ -1291,3 +1311,4 @@ function imagecache_get_images_in_node(&$node) {
}
return $files;
}
+