diff --git a/islandora_basic_image/islandora_basic_image.install b/islandora_basic_image/islandora_basic_image.install index 02b96efc..3d15d069 100644 --- a/islandora_basic_image/islandora_basic_image.install +++ b/islandora_basic_image/islandora_basic_image.install @@ -9,6 +9,8 @@ * Implements hook_install(). */ function islandora_basic_image_install() { + module_load_include('inc', 'islandora', 'include/fields.inc'); + // Ensure the basic image node type is available. node_types_rebuild(); @@ -35,16 +37,5 @@ function islandora_basic_image_install() { drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_BASIC_IMAGE_MEDIUM_SIZE_FIELD))); } - if (field_info_field(ISLANDORA_TN_FIELD)) { - $tn_field_instance = array( - 'field_name' => ISLANDORA_TN_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_BASIC_IMAGE_CONTENT_TYPE, - 'label' => $t("Thumbnail"), - 'description' => $t("A thumbnail for the Fedora resource"), - 'required' => FALSE, - ); - field_create_instance($tn_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_TN_FIELD))); - } + islandora_add_fields_to_bundle(ISLANDORA_BASIC_IMAGE_CONTENT_TYPE); } diff --git a/islandora_collection/include/fields.inc b/islandora_collection/include/fields.inc deleted file mode 100644 index ecb48875..00000000 --- a/islandora_collection/include/fields.inc +++ /dev/null @@ -1,41 +0,0 @@ - ISLANDORA_TN_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_COLLECTION_CONTENT_TYPE, - 'label' => $t("Thumbnail"), - 'description' => $t("A thumbnail for the Fedora resource"), - 'required' => FALSE, - ); - field_create_instance($tn_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_TN_FIELD))); - } - - // Add MODS field. - if (field_info_field(ISLANDORA_MODS_FIELD)) { - $mods_field_instance = array( - 'field_name' => ISLANDORA_MODS_FIELD, - 'entity_type' => 'node', - 'bundle' => ISLANDORA_COLLECTION_CONTENT_TYPE, - 'label' => $t("MODS"), - 'description' => $t("A MODS record for the Fedora resource"), - 'required' => FALSE, - ); - field_create_instance($mods_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_MODS_FIELD))); - } -} diff --git a/islandora_collection/islandora_collection.install b/islandora_collection/islandora_collection.install index cc11b709..29c9af7f 100644 --- a/islandora_collection/islandora_collection.install +++ b/islandora_collection/islandora_collection.install @@ -9,14 +9,14 @@ * Implements hook_install(). */ function islandora_collection_install() { - module_load_include('inc', 'islandora_collection', 'include/fields'); + module_load_include('inc', 'islandora', 'include/fields.inc'); module_load_include('inc', 'islandora_collection', 'include/relations'); // Ensure the collection node type is available. node_types_rebuild(); - // Create the islandora:collection content type. - islandora_collection_attach_default_fields(); + // Add default Islandora fields. + islandora_add_fields_to_bundle(ISLANDORA_BASIC_IMAGE_CONTENT_TYPE); // Create the pcdm:hasMember relation. islandora_collection_define_relations();