diff --git a/media_gallery.install b/media_gallery.install index 4d468fc..995f549 100644 --- a/media_gallery.install +++ b/media_gallery.install @@ -64,25 +64,11 @@ function media_gallery_install() { styles_style_flush(); } - // Add the taxonomy vocabulary for media gallery collections. - $vocabulary = media_gallery_create_taxonomy_vocab(); - - // Make sure the standard 'field_tags' field exists. - _media_gallery_ensure_field_tags(); - // Create fields (but not instances yet) for media_gallery nodes and // for the gallery collection vocabulary. foreach (_media_gallery_controlled_fields() as $field) { _media_gallery_ensure_field($field); } - // Attach fields to gallery_collection taxonomy terms. - foreach (_media_gallery_controlled_instances('taxonomy_term') as $instance) { - _media_gallery_ensure_instance($instance); - } - - // Now that the gallery_collection vocabulary exists and has fields attached, - // create an "All galleries" term for galleries to belong to by default. - media_gallery_create_taxonomy_term($vocabulary); // Attach fields to the media gallery node type (including a term reference // for the default collection). @@ -117,7 +103,6 @@ function media_gallery_requirements() { $required_fields = _media_gallery_controlled_fields(); // In addition to the fields we control, we also need the standard field_tags // that most sites will have gotten from their install profile. - $required_fields['field_tags'] = array('type' => 'taxonomy_term_reference'); foreach ($required_fields as $field_name => $field_definition) { $field = field_info_field($field_name); @@ -275,18 +260,6 @@ function _media_gallery_controlled_fields() { 'locked' => TRUE, 'type' => 'number_integer', ), - 'media_gallery_collection' => array( - 'field_name' => 'media_gallery_collection', - 'type' => 'taxonomy_term_reference', - 'settings' => array( - 'allowed_values' => array( - array( - 'vocabulary' => 'gallery_collections', - 'parent' => 0, - ), - ), - ), - ), // Fields to create on media items. 'media_description' => array( 'field_name' => 'media_description', @@ -655,26 +628,6 @@ function _media_gallery_controlled_instances($group = NULL) { ), ), ), - // The 'collection' tag field on media gallery nodes. - 'media_gallery_collection' => array( - 'field_name' => 'media_gallery_collection', - 'label' => $t('Gallery collection'), - 'default_value' => array( - array( - 'tid' => variable_get('media_gallery_default_collection_tid'), - ), - ), - 'display' => array( - 'default' => array( - 'type' => 'hidden', - 'label' => 'hidden', - ), - 'teaser' => array( - 'type' => 'hidden', - 'label' => 'hidden', - ), - ), - ), ); foreach ($node_instances as &$instance) { $instance['entity_type'] = 'node'; @@ -705,23 +658,7 @@ function _media_gallery_controlled_instances($group = NULL) { ), ); - foreach ($instances as $key => $instance) { - // Since we are re-using fields which are defined for the node, we need to - // remove any additional view modes which don't belong to avoid E_NOTICE errors. - $instance['display'] = array_intersect_key($instance['display'], array_flip(array('default', 'full'))); - $instance['entity_type'] = 'taxonomy_term'; - $instance['bundle'] = 'gallery_collections'; - $taxonomy_instances['taxo_term_' . $key] = $instance; - } - - switch ($group) { - case 'node': - return $node_instances; - case 'taxonomy_term': - return $taxonomy_instances; - default: - return $node_instances + $taxonomy_instances; - } + return $node_instances; } /** @@ -780,16 +717,6 @@ function _media_required_instances() { 'media_gallery_detail' => array('type' => 'text_default', 'label' => 'above'), ), ), - 'field_tags' => array( - 'field_name' => 'field_tags', - 'label' => $t('Tags'), - 'widget' => array( - 'type' => 'taxonomy_autocomplete', - ), - 'display' => array( - 'default' => array('type' => 'hidden'), - ), - ), 'field_license' => array( 'field_name' => 'field_license', 'label' => $t('License settings for this media'), diff --git a/media_gallery.module b/media_gallery.module index 0ec5541..6e0848c 100644 --- a/media_gallery.module +++ b/media_gallery.module @@ -27,7 +27,6 @@ function media_gallery_file_view_modes() { 'media_gallery_lightbox' => t('Gallery lightbox'), 'media_gallery_detail' => t('Gallery detail'), 'media_gallery_block_thumbnail' => t('Gallery block thumbnail'), - 'media_gallery_collection_thumbnail' => t('Gallery collection thumbnail'), ); }