|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @file
|
|
|
|
* Install hooks for this module.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Implements hook_install().
|
|
|
|
*
|
|
|
|
* 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,
|
|
|
|
ISLANDORA_DC_CREATOR_FIELD,
|
|
|
|
ISLANDORA_DC_DATE_FIELD,
|
|
|
|
ISLANDORA_DC_DESCRIPTION_FIELD,
|
|
|
|
ISLANDORA_DC_FORMAT_FIELD,
|
|
|
|
ISLANDORA_DC_IDENTIFIER_FIELD,
|
|
|
|
ISLANDORA_DC_LANGUAGE_FIELD,
|
|
|
|
ISLANDORA_DC_PUBLISHER_FIELD,
|
|
|
|
ISLANDORA_DC_RELATION_FIELD,
|
|
|
|
ISLANDORA_DC_RIGHTS_FIELD,
|
|
|
|
ISLANDORA_DC_SOURCE_FIELD,
|
|
|
|
ISLANDORA_DC_SUBJECT_FIELD,
|
|
|
|
ISLANDORA_DC_TITLE_FIELD,
|
|
|
|
ISLANDORA_DC_TYPE_FIELD,
|
|
|
|
);
|
|
|
|
|
|
|
|
foreach ($field_names as $field_name) {
|
|
|
|
$field = array(
|
|
|
|
'field_name' => $field_name,
|
|
|
|
'type' => 'text_long',
|
|
|
|
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
|
|
|
|
);
|
|
|
|
field_create_field($field);
|
|
|
|
drupal_set_message($t("Created field @field",
|
|
|
|
array("@field" => $field_name)));
|
|
|
|
}
|
|
|
|
}
|