Index: acidfree.module
===================================================================
--- acidfree.module	(revision 251)
+++ acidfree.module	(working copy)
@@ -177,39 +177,20 @@
                 'title' => t('Acidfree albums'),
                 'access' => user_access('access content'),
                 'type' => MENU_SUGGESTED_ITEM);
-    } else {
         // acidfree_init stuff
-        $acidfree_base = drupal_get_path('module', 'acidfree');
-        foreach (glob($acidfree_base.DIRECTORY_SEPARATOR.'class_*.inc') as $classfile) {
-            require_once($classfile);
-            $type = acidfree_call(basename($classfile, ".inc") . "_register");
-            if ($type->class)
-                $acidfree_types[$type->class] = $type;
-        }
-        global $theme;
-        $theme = init_theme();
-        $themes = list_themes();
-        $stylesheet = dirname($themes[$theme]->filename).'/acidfree.css';
-        if (file_exists($stylesheet)) {
-            theme_add_style($stylesheet);
-        } else {
-            theme_add_style("$acidfree_base/acidfree.css");
-        }
-
-        $path = explode('/', $_GET['q']);
-        if ($path[0] == 'node' && is_numeric($path[1])) {
-            $node = acidfree_get_node_by_id($path[1]);
-            $is_mine = ($node->uid == $user->uid);
-            if ($node->class == 'album') {
-                $items[] = Array('path' => "node/{$path[1]}/contents",
-                        'title' => t('album contents'),
-                        'access' => node_access('update', $node),
-                        'callback' => 'acidfree_page',
-                        'type' => MENU_LOCAL_TASK);
+        $create_acidfree_elements = false;
+        $have_default = false;
+        $acidfree_types = variable_get('acidfree_types', array());
+        if (!$acidfree_types) {
+            $acidfree_base = drupal_get_path('module', 'acidfree');
+            foreach (glob($acidfree_base.DIRECTORY_SEPARATOR.'class_*.inc') as $classfile) {
+                require_once($classfile);
+                $type = acidfree_call(basename($classfile, ".inc") . "_register");
+                if ($type->class)
+                    $acidfree_types[$type->class] = $type;
             }
+            variable_set('acidfree_types', $acidfree_types);
         }
-        $create_acidfree_elements = false;
-        $have_default = false;
         foreach ($acidfree_types as $type => $class) {
             $class_access = user_access($class->access);
             $create_acidfree_elements |= $class_access;
@@ -231,6 +212,37 @@
                 'access' => user_access('acidfree mass import'),
                 'callback' => 'acidfree_page',
                 'type' => MENU_LOCAL_TASK);
+    } else {
+        global $theme;
+        init_theme();
+        $themes = list_themes();
+        $stylesheet = dirname($themes[$theme]->filename).'/acidfree.css';
+        if (file_exists($stylesheet)) {
+            theme_add_style($stylesheet);
+        } else {
+            theme_add_style("$acidfree_base/acidfree.css");
+        }
+
+        $acidfree_types = variable_get('acidfree_types', array());
+        if ($acidfree_types) {
+            $acidfree_base = drupal_get_path('module', 'acidfree');
+            foreach ($acidfree_types as $name => $class) {
+                require_once($acidfree_base.DIRECTORY_SEPARATOR."class_{$name}.inc");
+            }
+        }
+
+        $path = explode('/', $_GET['q']);
+        if ($path[0] == 'node' && is_numeric($path[1])) {
+            $node = acidfree_get_node_by_id($path[1]);
+            $is_mine = ($node->uid == $user->uid);
+            if ($node->class == 'album') {
+                $items[] = Array('path' => "node/{$path[1]}/contents",
+                        'title' => t('album contents'),
+                        'access' => node_access('update', $node),
+                        'callback' => 'acidfree_page',
+                        'type' => MENU_LOCAL_TASK);
+            }
+        }
     }
     return $items;
 }
