mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
200 lines
5.9 KiB
PHP
200 lines
5.9 KiB
PHP
<?php
|
|
/**
|
|
* @file
|
|
* farm_area.features.field_instance.inc
|
|
*/
|
|
|
|
/**
|
|
* Implements hook_field_default_field_instances().
|
|
*/
|
|
function farm_area_field_default_field_instances() {
|
|
$field_instances = array();
|
|
|
|
// Exported field_instance: 'taxonomy_term-farm_areas-field_farm_area_type'.
|
|
$field_instances['taxonomy_term-farm_areas-field_farm_area_type'] = array(
|
|
'bundle' => 'farm_areas',
|
|
'default_value' => NULL,
|
|
'deleted' => 0,
|
|
'description' => 'What type of area is this? Area types will be color coded on maps. If left blank, the area will not appear on maps.',
|
|
'display' => array(
|
|
'default' => array(
|
|
'label' => 'inline',
|
|
'module' => 'list',
|
|
'settings' => array(),
|
|
'type' => 'list_default',
|
|
'weight' => 2,
|
|
),
|
|
),
|
|
'entity_type' => 'taxonomy_term',
|
|
'field_name' => 'field_farm_area_type',
|
|
'label' => 'Area type',
|
|
'required' => 0,
|
|
'settings' => array(
|
|
'user_register_form' => FALSE,
|
|
),
|
|
'widget' => array(
|
|
'active' => 1,
|
|
'module' => 'options',
|
|
'settings' => array(),
|
|
'type' => 'options_select',
|
|
'weight' => 1,
|
|
),
|
|
);
|
|
|
|
// Exported field_instance: 'taxonomy_term-farm_areas-field_farm_files'.
|
|
$field_instances['taxonomy_term-farm_areas-field_farm_files'] = array(
|
|
'bundle' => 'farm_areas',
|
|
'deleted' => 0,
|
|
'description' => '',
|
|
'display' => array(
|
|
'default' => array(
|
|
'label' => 'above',
|
|
'module' => 'file',
|
|
'settings' => array(),
|
|
'type' => 'file_table',
|
|
'weight' => 4,
|
|
),
|
|
),
|
|
'entity_type' => 'taxonomy_term',
|
|
'field_name' => 'field_farm_files',
|
|
'label' => 'Files',
|
|
'required' => 0,
|
|
'settings' => array(
|
|
'description_field' => 1,
|
|
'file_directory' => 'farm/area',
|
|
'file_extensions' => 'csv doc docx odt odp ods pdf ppt pptx txt xls xlsx kml kmz zip tar gz',
|
|
'max_filesize' => '',
|
|
'user_register_form' => FALSE,
|
|
),
|
|
'widget' => array(
|
|
'active' => 1,
|
|
'module' => 'file',
|
|
'settings' => array(
|
|
'progress_indicator' => 'throbber',
|
|
),
|
|
'type' => 'file_generic',
|
|
'weight' => 5,
|
|
),
|
|
);
|
|
|
|
// Exported field_instance: 'taxonomy_term-farm_areas-field_farm_geofield'.
|
|
$field_instances['taxonomy_term-farm_areas-field_farm_geofield'] = array(
|
|
'bundle' => 'farm_areas',
|
|
'default_value' => NULL,
|
|
'deleted' => 0,
|
|
'description' => 'Use this field to define the geometry of this area on a map. Points, lines, and polygons can be drawn using the controls below.',
|
|
'display' => array(
|
|
'default' => array(
|
|
'label' => 'hidden',
|
|
'module' => 'openlayers_geofield',
|
|
'settings' => array(
|
|
'data' => 'full',
|
|
'map_layer_preset' => 'farm_map_geofield_formatter:openlayers_geofield_layer_formatter',
|
|
),
|
|
'type' => 'openlayers_geofield',
|
|
'weight' => 0,
|
|
),
|
|
),
|
|
'entity_type' => 'taxonomy_term',
|
|
'field_name' => 'field_farm_geofield',
|
|
'label' => 'Geometry',
|
|
'required' => 0,
|
|
'settings' => array(
|
|
'user_register_form' => FALSE,
|
|
),
|
|
'widget' => array(
|
|
'active' => 1,
|
|
'module' => 'openlayers_geofield',
|
|
'settings' => array(
|
|
'allow_edit' => 1,
|
|
'data_storage' => 'collection',
|
|
'delta_handling' => 'default',
|
|
'feature_types' => array(
|
|
'path' => 'path',
|
|
'point' => 'point',
|
|
'polygon' => 'polygon',
|
|
),
|
|
'geocoder_field' => 'field_farm_files',
|
|
'geocoder_handler' => 'kml',
|
|
'handler_settings' => array(
|
|
'google' => array(
|
|
'all_results' => 0,
|
|
'geometry_type' => 'point',
|
|
'reject_results' => array(
|
|
'APPROXIMATE' => 0,
|
|
'GEOMETRIC_CENTER' => 0,
|
|
'RANGE_INTERPOLATED' => 0,
|
|
'ROOFTOP' => 0,
|
|
),
|
|
),
|
|
),
|
|
'openlayers_map' => 'farm_map_geofield',
|
|
'showInputField' => 1,
|
|
'use_geocoder' => 1,
|
|
),
|
|
'type' => 'openlayers_geofield',
|
|
'weight' => 2,
|
|
),
|
|
);
|
|
|
|
// Exported field_instance: 'taxonomy_term-farm_areas-field_farm_images'.
|
|
$field_instances['taxonomy_term-farm_areas-field_farm_images'] = array(
|
|
'bundle' => 'farm_areas',
|
|
'deleted' => 0,
|
|
'description' => '',
|
|
'display' => array(
|
|
'default' => array(
|
|
'label' => 'above',
|
|
'module' => 'colorbox',
|
|
'settings' => array(
|
|
'colorbox_caption' => 'auto',
|
|
'colorbox_caption_custom' => '',
|
|
'colorbox_gallery' => 'post',
|
|
'colorbox_gallery_custom' => '',
|
|
'colorbox_image_style' => '',
|
|
'colorbox_multivalue_index' => NULL,
|
|
'colorbox_node_style' => 'thumbnail',
|
|
'colorbox_node_style_first' => 'large',
|
|
),
|
|
'type' => 'colorbox',
|
|
'weight' => 1,
|
|
),
|
|
),
|
|
'entity_type' => 'taxonomy_term',
|
|
'field_name' => 'field_farm_images',
|
|
'label' => 'Photo(s)',
|
|
'required' => 0,
|
|
'settings' => array(
|
|
'alt_field' => 0,
|
|
'default_image' => 0,
|
|
'file_directory' => 'farm/area',
|
|
'file_extensions' => 'png gif jpg jpeg',
|
|
'max_filesize' => '',
|
|
'max_resolution' => '',
|
|
'min_resolution' => '',
|
|
'title_field' => 0,
|
|
'user_register_form' => FALSE,
|
|
),
|
|
'widget' => array(
|
|
'active' => 1,
|
|
'module' => 'image',
|
|
'settings' => array(
|
|
'preview_image_style' => 'thumbnail',
|
|
'progress_indicator' => 'bar',
|
|
),
|
|
'type' => 'image_image',
|
|
'weight' => 4,
|
|
),
|
|
);
|
|
|
|
// Translatables
|
|
// Included for use with string extractors like potx.
|
|
t('Area type');
|
|
t('Files');
|
|
t('Geometry');
|
|
t('Photo(s)');
|
|
t('Use this field to define the geometry of this area on a map. Points, lines, and polygons can be drawn using the controls below.');
|
|
t('What type of area is this? Area types will be color coded on maps. If left blank, the area will not appear on maps.');
|
|
|
|
return $field_instances;
|
|
}
|