function _media_gallery_controlled_fields in Media Gallery 7
Same name and namespace in other branches
- 7.2 media_gallery.install \_media_gallery_controlled_fields()
Returns definitions for fields this module both creates and deletes.
3 calls to _media_gallery_controlled_fields()
- media_gallery_install in ./
media_gallery.install - Implements hook_install().
- media_gallery_requirements in ./
media_gallery.install - Implements hook_requirements().
- media_gallery_uninstall in ./
media_gallery.install - Implements hook_uninstall().
File
- ./
media_gallery.install, line 179 - Install file for media_gallery. Includes field and instance definitions.
Code
function _media_gallery_controlled_fields() {
$fields = array(
// The media items that make up the gallery.
'media_gallery_media' => array(
'field_name' => 'media_gallery_media',
'cardinality' => FIELD_CARDINALITY_UNLIMITED,
'locked' => TRUE,
'type' => 'media',
),
// The gallery description.
'media_gallery_description' => array(
'field_name' => 'media_gallery_description',
'cardinality' => 1,
'locked' => TRUE,
'type' => 'text_long',
),
// How to format the gallery (if links go to lightbox or node display).
'media_gallery_format' => array(
'field_name' => 'media_gallery_format',
'cardinality' => 1,
'locked' => TRUE,
'type' => 'list_text',
'settings' => array(
'allowed_values_function' => '_media_gallery_get_format_values',
),
),
// Whether or not the lightbox should show extra fields.
'media_gallery_lightbox_extras' => array(
'field_name' => 'media_gallery_lightbox_extras',
'cardinality' => 1,
'locked' => TRUE,
'type' => 'list_boolean',
'settings' => array(
'allowed_values_function' => '_media_gallery_get_lightbox_extras_values',
),
),
// How many columns of thumbnails to show.
'media_gallery_columns' => array(
'field_name' => 'media_gallery_columns',
'cardinality' => 1,
'locked' => TRUE,
'type' => 'list_float',
'settings' => array(
'allowed_values_function' => '_media_gallery_get_columns_values',
),
),
// How many rows of thumbnails to show.
'media_gallery_rows' => array(
'field_name' => 'media_gallery_rows',
'cardinality' => 1,
'locked' => TRUE,
'type' => 'number_integer',
),
// Whether to show title/license on hover or below thumbnail.
'media_gallery_image_info_where' => array(
'field_name' => 'media_gallery_image_info_where',
'cardinality' => 1,
'locked' => TRUE,
'type' => 'list_text',
'settings' => array(
'allowed_values_function' => '_media_gallery_get_image_info_placement_values',
),
),
// Whether to show a "Download original image" checkbox.
'media_gallery_allow_download' => array(
'field_name' => 'media_gallery_allow_download',
'cardinality' => 1,
'locked' => TRUE,
'type' => 'list_boolean',
'settings' => array(
'allowed_values_function' => '_media_gallery_get_allow_download_values',
),
),
// Whether to expose a block for this gallery.
'media_gallery_expose_block' => array(
'field_name' => 'media_gallery_expose_block',
'cardinality' => 1,
'locked' => TRUE,
'type' => 'list_boolean',
'settings' => array(
'allowed_values_function' => '_media_gallery_get_expose_block_values',
),
),
// How many columns of thumbnails to show in the block.
'media_gallery_block_columns' => array(
'field_name' => 'media_gallery_block_columns',
'cardinality' => 1,
'locked' => TRUE,
'type' => 'list_float',
'settings' => array(
'allowed_values_function' => '_media_gallery_get_block_columns_values',
),
),
// How many rows of thumbnails to show in the block.
'media_gallery_block_rows' => array(
'field_name' => 'media_gallery_block_rows',
'cardinality' => 1,
'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',
'locked' => TRUE,
'type' => 'text_long',
),
'media_title' => array(
'field_name' => 'media_title',
'locked' => TRUE,
'type' => 'text',
),
'field_license' => array(
'field_name' => 'field_license',
'locked' => TRUE,
'settings' => array(
'allowed_values_function' => '_media_gallery_get_field_license_values',
),
'type' => 'list_text',
'active' => TRUE,
'cardinality' => 1,
),
);
return $fields;
}