function _media_required_instances in Media Gallery 7
Same name and namespace in other branches
- 7.2 media_gallery.install \_media_required_instances()
Returns definitions for instances this module requires on media bundles.
1 call to _media_required_instances()
- _media_gallery_ensure_media_instances in ./
media_gallery.install - Makes sure media entities have the fields media gallery requires.
File
- ./
media_gallery.install, line 754 - Install file for media_gallery. Includes field and instance definitions.
Code
function _media_required_instances() {
$t = get_t();
$media_instances = array(
'media_title' => array(
'field_name' => 'media_title',
'label' => $t('Title'),
'display' => array(
'default' => array(
'type' => 'hidden',
),
'media_gallery_thumbnail' => array(
'type' => 'text_default',
'label' => 'hidden',
),
'media_gallery_lightbox' => array(
'type' => 'text_default',
'label' => 'hidden',
),
'media_gallery_detail' => array(
'type' => 'text_default',
'label' => 'hidden',
),
),
),
'media_description' => array(
'field_name' => 'media_description',
'label' => $t('Description'),
'widget' => array(
'type' => 'text_textarea',
'settings' => array(
'rows' => 4,
),
),
'settings' => array(
'text_processing' => 1,
),
'display' => array(
'default' => array(
'type' => 'text_default',
'label' => 'above',
),
'media_gallery_thumbnail' => array(
'type' => 'text_default',
'label' => 'above',
),
'media_gallery_lightbox' => array(
'type' => 'text_default',
'label' => 'above',
),
'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'),
'required' => TRUE,
'default_value' => array(
array(
'value' => 'nothing',
),
),
'description' => $t('Select a <a href="http://creativecommons.org" target="_new">Creative Commons</a> license for others who use this media.'),
'display' => array(
'default' => array(
'type' => 'hidden',
),
'media_gallery_thumbnail' => array(
'type' => 'list_default',
'label' => 'hidden',
),
'media_gallery_lightbox' => array(
'type' => 'list_default',
'label' => 'hidden',
),
'media_gallery_detail' => array(
'type' => 'list_default',
'label' => 'hidden',
),
),
),
);
return $media_instances;
}