diff --git a/islandora/include/fields.inc b/islandora/include/fields.inc index ad4c8d4c..6e3382dc 100644 --- a/islandora/include/fields.inc +++ b/islandora/include/fields.inc @@ -22,6 +22,10 @@ function islandora_add_fields_to_bundle($bundle_name) { 'label' => 'Thumbnail', 'description' => 'Thumbnail image', ), + ISLANDORA_FEDORA_PATH_FIELD => array( + 'label' => 'Fedora Path', + 'description' => 'Path to resource in Fedora 4', + ), ISLANDORA_FEDORA_HAS_PARENT_FIELD => array( 'label' => 'fedora:hasParent', 'description' => 'Parent resource in Fedora 4', @@ -29,6 +33,7 @@ function islandora_add_fields_to_bundle($bundle_name) { ISLANDORA_PCDM_HAS_MEMBER_FIELD => array( 'label' => 'pcdm:hasMember', 'description' => 'Child resources in Fedora 4', + 'cardinality' => FIELD_CARDINALITY_UNLIMITED, ), ); @@ -42,15 +47,15 @@ function islandora_add_fields_to_bundle($bundle_name) { 'field_name' => $field_name, 'entity_type' => 'node', 'bundle' => $bundle_name, - 'label' => $t("%label", array("%description" => $field_label)), - 'description' => $t("%description", array("%description" => $field_description)), + 'label' => $t("@label", array("@label" => $field_label)), + 'description' => $t("@description", array("@description" => $field_description)), 'required' => FALSE, ); field_create_instance($field_instance); - $message = $t('Field %name was added to %bundle successfully', + $message = $t('Field @name was added to @bundle successfully', array( - '%name' => $field_name, - '%bundle' => $bundle_name, + '@name' => $field_name, + '@bundle' => $bundle_name, )); drupal_set_message($message); } diff --git a/islandora/include/rdf_mapping.inc b/islandora/include/rdf_mapping.inc index b3da5584..ed50d13d 100644 --- a/islandora/include/rdf_mapping.inc +++ b/islandora/include/rdf_mapping.inc @@ -27,11 +27,11 @@ function islandora_get_default_rdf_mapping($bundle, $rdf_type) { 'predicates' => array('dc11:identifier'), 'datatype' => 'xsd:ID', ), - ISLANDORA_FEDORA_HAS_PARENT => array( + ISLANDORA_FEDORA_HAS_PARENT_FIELD => array( 'predicates' => array('fedora:hasParent'), 'datatype' => 'xsd:string', ), - ISLANDORA_PCDM_HAS_MEMBER => array( + ISLANDORA_PCDM_HAS_MEMBER_FIELD => array( 'predicates' => array('pcdm:hasMember'), 'datatype' => 'xsd:string', ), diff --git a/islandora/islandora.info b/islandora/islandora.info index f74d65d8..24fa1e7a 100644 --- a/islandora/islandora.info +++ b/islandora/islandora.info @@ -11,3 +11,5 @@ dependencies[] = views_ui dependencies[] = rdfui dependencies[] = xml_field dependencies[] = xpath_field +dependencies[] = islandora_dc +dependencies[] = islandora_mods diff --git a/islandora/islandora.install b/islandora/islandora.install index 6735ddd4..5d560636 100644 --- a/islandora/islandora.install +++ b/islandora/islandora.install @@ -11,27 +11,37 @@ * Defines common fields for various bundles. */ function islandora_install() { + $t = get_t(); + $tn_field = array( 'field_name' => ISLANDORA_TN_FIELD, 'type' => 'image', ); field_create_field($tn_field); + drupal_set_message($t("Created field @field", + array("@field" => ISLANDORA_TN_FIELD))); $fedora_path_field = array( 'field_name' => ISLANDORA_FEDORA_PATH_FIELD, 'type' => 'text', ); field_create_field($fedora_path_field); + drupal_set_message($t("Created field @field", + array("@field" => ISLANDORA_FEDORA_PATH_FIELD))); $fedora_has_parent_field = array( 'field_name' => ISLANDORA_FEDORA_HAS_PARENT_FIELD, 'type' => 'text', ); field_create_field($fedora_has_parent_field); + drupal_set_message($t("Created field @field", + array("@field" => ISLANDORA_FEDORA_HAS_PARENT_FIELD))); $pcdm_has_member_field = array( 'field_name' => ISLANDORA_PCDM_HAS_MEMBER_FIELD, 'type' => 'text', ); field_create_field($pcdm_has_member_field); + drupal_set_message($t("Created field @field", + array("@field" => ISLANDORA_PCDM_HAS_MEMBER_FIELD))); } diff --git a/islandora/islandora.module b/islandora/islandora.module index 018e7f77..7a10c315 100644 --- a/islandora/islandora.module +++ b/islandora/islandora.module @@ -9,6 +9,7 @@ define('ISLANDORA_NAMESPACE', 'http://islandora.ca/ontology/v2/'); define('ISLANDORA_FEDORA_NAMESPACE', 'http://fedora.info/definitions/v4/repository#'); define('ISLANDORA_PCDM_NAMESPACE', 'http://pcdm.org/models#'); define('ISLANDORA_TN_FIELD', 'field_tn'); +define('ISLANDORA_FEDORA_PATH_FIELD', 'field_fedora_path'); define('ISLANDORA_FEDORA_HAS_PARENT_FIELD', 'field_fedora_has_parent'); define('ISLANDORA_PCDM_HAS_MEMBER_FIELD', 'field_pcdm_has_member'); diff --git a/islandora_basic_image/islandora_basic_image.install b/islandora_basic_image/islandora_basic_image.install index 3d15d069..c87589f9 100644 --- a/islandora_basic_image/islandora_basic_image.install +++ b/islandora_basic_image/islandora_basic_image.install @@ -9,7 +9,7 @@ * Implements hook_install(). */ function islandora_basic_image_install() { - module_load_include('inc', 'islandora', 'include/fields.inc'); + module_load_include('inc', 'islandora', 'include/fields'); // Ensure the basic image node type is available. node_types_rebuild(); @@ -22,6 +22,8 @@ function islandora_basic_image_install() { 'type' => 'image', ); field_create_field($medium_size_field); + drupal_set_message($t("Created field @field", + array("@field" => ISLANDORA_BASIC_IMAGE_MEDIUM_SIZE_FIELD))); // Add fields instances to bundle. if (field_info_field(ISLANDORA_BASIC_IMAGE_MEDIUM_SIZE_FIELD)) { @@ -34,7 +36,11 @@ function islandora_basic_image_install() { 'required' => FALSE, ); field_create_instance($medium_size_field_instance); - drupal_set_message($t('Field %name was created successfully', array('%name' => ISLANDORA_BASIC_IMAGE_MEDIUM_SIZE_FIELD))); + drupal_set_message($t('Field @name was successfully added to @bundle', + array( + '@name' => ISLANDORA_BASIC_IMAGE_MEDIUM_SIZE_FIELD, + '@bundle' => ISLANDORA_BASIC_IMAGE_CONTENT_TYPE, + ))); } islandora_add_fields_to_bundle(ISLANDORA_BASIC_IMAGE_CONTENT_TYPE); diff --git a/islandora_collection/islandora_collection.install b/islandora_collection/islandora_collection.install index 29c9af7f..995b1437 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', 'include/fields.inc'); + module_load_include('inc', 'islandora', 'include/fields'); module_load_include('inc', 'islandora_collection', 'include/relations'); // Ensure the collection node type is available. node_types_rebuild(); // Add default Islandora fields. - islandora_add_fields_to_bundle(ISLANDORA_BASIC_IMAGE_CONTENT_TYPE); + islandora_add_fields_to_bundle(ISLANDORA_COLLECTION_CONTENT_TYPE); // Create the pcdm:hasMember relation. islandora_collection_define_relations(); diff --git a/islandora_dc/include/fields.inc b/islandora_dc/include/fields.inc index 28952381..13c970e5 100644 --- a/islandora_dc/include/fields.inc +++ b/islandora_dc/include/fields.inc @@ -91,15 +91,15 @@ function islandora_dc_add_fields_to_bundle($bundle_name) { 'field_name' => $field_name, 'entity_type' => 'node', 'bundle' => $bundle_name, - 'label' => $t("%label", array("%description" => $field_label)), - 'description' => $t("%description", array("%description" => $field_description)), + 'label' => $t("@label", array("@description" => $field_label)), + 'description' => $t("@description", array("@description" => $field_description)), 'required' => FALSE, ); field_create_instance($field_instance); - $message = $t('Field %name was added to %bundle successfully', + $message = $t('Field @name was successfully added to @bundle', array( - '%name' => $field_name, - '%bundle' => $bundle_name, + '@name' => $field_name, + '@bundle' => $bundle_name, )); drupal_set_message($message); } diff --git a/islandora_dc/islandora_dc.install b/islandora_dc/islandora_dc.install index 3a7d22d3..b751821c 100644 --- a/islandora_dc/islandora_dc.install +++ b/islandora_dc/islandora_dc.install @@ -11,6 +11,8 @@ * Creates shared fields for content types using DC metadata. */ function islandora_dc_install() { + $t = get_t(); + $field_names = array( ISLANDORA_DC_CONTRIBUTOR_FIELD, ISLANDORA_DC_COVERAGE_FIELD, @@ -36,5 +38,7 @@ function islandora_dc_install() { 'cardinality' => FIELD_CARDINALITY_UNLIMITED, ); field_create_field($field); + drupal_set_message($t("Created field @field", + array("@field" => $field_name))); } } diff --git a/islandora_mods/include/fields.inc b/islandora_mods/include/fields.inc index 2ccfd631..eb63f11c 100644 --- a/islandora_mods/include/fields.inc +++ b/islandora_mods/include/fields.inc @@ -26,10 +26,10 @@ function islandora_mods_add_fields_to_bundle($bundle_name) { 'required' => FALSE, ); field_create_instance($mods_field_instance); - $message = $t('Field %name was successfully added to %bundle', + $message = $t('Field @name was successfully added to @bundle', array( - '%name' => ISLANDORA_MODS_FIELD, - '%bundle' => $bundle_name, + '@name' => ISLANDORA_MODS_FIELD, + '@bundle' => $bundle_name, )); drupal_set_message($message); } diff --git a/islandora_mods/islandora_mods.install b/islandora_mods/islandora_mods.install index 46f4412d..0419f373 100644 --- a/islandora_mods/islandora_mods.install +++ b/islandora_mods/islandora_mods.install @@ -10,10 +10,14 @@ * * Creates shared fields for content types using MODS metadata. */ -function islandora_dc_install() { +function islandora_mods_install() { + $t = get_t(); + $mods_field = array( 'field_name' => ISLANDORA_MODS_FIELD, 'type' => 'xml_field_xml', ); field_create_field($mods_field); + drupal_set_message($t("Created field @field", + array("@field" => ISLANDORA_MODS_FIELD))); }