Initial commit: soil sample log type, soil map, nrcs soil survey layer.
This commit is contained in:
commit
81ca7a019f
|
@ -0,0 +1,544 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* farm_soil.features.field.inc
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_field_default_fields().
|
||||
*/
|
||||
function farm_soil_field_default_fields() {
|
||||
$fields = array();
|
||||
|
||||
// Exported field: 'log-farm_soil_csha_request-field_farm_soil_sample'.
|
||||
$fields['log-farm_soil_csha_request-field_farm_soil_sample'] = array(
|
||||
'field_config' => array(
|
||||
'active' => '1',
|
||||
'cardinality' => '1',
|
||||
'deleted' => '0',
|
||||
'entity_types' => array(),
|
||||
'field_name' => 'field_farm_soil_sample',
|
||||
'foreign keys' => array(
|
||||
'log' => array(
|
||||
'columns' => array(
|
||||
'target_id' => 'id',
|
||||
),
|
||||
'table' => 'log',
|
||||
),
|
||||
),
|
||||
'indexes' => array(
|
||||
'target_id' => array(
|
||||
0 => 'target_id',
|
||||
),
|
||||
),
|
||||
'locked' => '0',
|
||||
'module' => 'entityreference',
|
||||
'settings' => array(
|
||||
'handler' => 'base',
|
||||
'handler_settings' => array(
|
||||
'sort' => array(
|
||||
'type' => 'none',
|
||||
),
|
||||
'target_bundles' => array(
|
||||
'farm_soil_sample' => 'farm_soil_sample',
|
||||
),
|
||||
),
|
||||
'target_type' => 'log',
|
||||
),
|
||||
'translatable' => '0',
|
||||
'type' => 'entityreference',
|
||||
),
|
||||
'field_instance' => array(
|
||||
'bundle' => 'farm_soil_csha_request',
|
||||
'default_value' => NULL,
|
||||
'deleted' => '0',
|
||||
'description' => '',
|
||||
'display' => array(
|
||||
'default' => array(
|
||||
'label' => 'above',
|
||||
'module' => 'entityreference',
|
||||
'settings' => array(
|
||||
'link' => FALSE,
|
||||
),
|
||||
'type' => 'entityreference_label',
|
||||
'weight' => 0,
|
||||
),
|
||||
),
|
||||
'entity_type' => 'log',
|
||||
'field_name' => 'field_farm_soil_sample',
|
||||
'label' => 'Soil Sample',
|
||||
'required' => 1,
|
||||
'settings' => array(
|
||||
'user_register_form' => FALSE,
|
||||
),
|
||||
'widget' => array(
|
||||
'active' => 1,
|
||||
'module' => 'options',
|
||||
'settings' => array(),
|
||||
'type' => 'options_select',
|
||||
'weight' => '1',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// Exported field: 'log-farm_soil_csha_results-field_farm_soil_csha_request'.
|
||||
$fields['log-farm_soil_csha_results-field_farm_soil_csha_request'] = array(
|
||||
'field_config' => array(
|
||||
'active' => '1',
|
||||
'cardinality' => '1',
|
||||
'deleted' => '0',
|
||||
'entity_types' => array(),
|
||||
'field_name' => 'field_farm_soil_csha_request',
|
||||
'foreign keys' => array(
|
||||
'log' => array(
|
||||
'columns' => array(
|
||||
'target_id' => 'id',
|
||||
),
|
||||
'table' => 'log',
|
||||
),
|
||||
),
|
||||
'indexes' => array(
|
||||
'target_id' => array(
|
||||
0 => 'target_id',
|
||||
),
|
||||
),
|
||||
'locked' => '0',
|
||||
'module' => 'entityreference',
|
||||
'settings' => array(
|
||||
'handler' => 'base',
|
||||
'handler_settings' => array(
|
||||
'sort' => array(
|
||||
'type' => 'none',
|
||||
),
|
||||
'target_bundles' => array(
|
||||
'farm_soil_csha_request' => 'farm_soil_csha_request',
|
||||
),
|
||||
),
|
||||
'target_type' => 'log',
|
||||
),
|
||||
'translatable' => '0',
|
||||
'type' => 'entityreference',
|
||||
),
|
||||
'field_instance' => array(
|
||||
'bundle' => 'farm_soil_csha_results',
|
||||
'default_value' => NULL,
|
||||
'deleted' => '0',
|
||||
'description' => '',
|
||||
'display' => array(
|
||||
'default' => array(
|
||||
'label' => 'above',
|
||||
'module' => 'entityreference',
|
||||
'settings' => array(
|
||||
'link' => FALSE,
|
||||
),
|
||||
'type' => 'entityreference_label',
|
||||
'weight' => 0,
|
||||
),
|
||||
),
|
||||
'entity_type' => 'log',
|
||||
'field_name' => 'field_farm_soil_csha_request',
|
||||
'label' => 'CSHA Request',
|
||||
'required' => 1,
|
||||
'settings' => array(
|
||||
'user_register_form' => FALSE,
|
||||
),
|
||||
'widget' => array(
|
||||
'active' => 1,
|
||||
'module' => 'options',
|
||||
'settings' => array(),
|
||||
'type' => 'options_select',
|
||||
'weight' => '1',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// Exported field: 'log-farm_soil_sample-field_farm_date'.
|
||||
$fields['log-farm_soil_sample-field_farm_date'] = array(
|
||||
'field_config' => array(
|
||||
'active' => '1',
|
||||
'cardinality' => '1',
|
||||
'deleted' => '0',
|
||||
'entity_types' => array(),
|
||||
'field_name' => 'field_farm_date',
|
||||
'foreign keys' => array(),
|
||||
'indexes' => array(),
|
||||
'locked' => '0',
|
||||
'module' => 'date',
|
||||
'settings' => array(
|
||||
'cache_count' => '4',
|
||||
'cache_enabled' => 0,
|
||||
'granularity' => array(
|
||||
'day' => 'day',
|
||||
'hour' => 0,
|
||||
'minute' => 0,
|
||||
'month' => 'month',
|
||||
'second' => 0,
|
||||
'year' => 'year',
|
||||
),
|
||||
'timezone_db' => '',
|
||||
'todate' => '',
|
||||
'tz_handling' => 'none',
|
||||
),
|
||||
'translatable' => '0',
|
||||
'type' => 'datestamp',
|
||||
),
|
||||
'field_instance' => array(
|
||||
'bundle' => 'farm_soil_sample',
|
||||
'deleted' => '0',
|
||||
'description' => 'Enter the date when this sample was taken (or will take place).',
|
||||
'display' => array(
|
||||
'default' => array(
|
||||
'label' => 'inline',
|
||||
'module' => 'date',
|
||||
'settings' => array(
|
||||
'format_type' => 'long',
|
||||
'fromto' => 'both',
|
||||
'multiple_from' => '',
|
||||
'multiple_number' => '',
|
||||
'multiple_to' => '',
|
||||
),
|
||||
'type' => 'date_default',
|
||||
'weight' => '0',
|
||||
),
|
||||
),
|
||||
'entity_type' => 'log',
|
||||
'field_name' => 'field_farm_date',
|
||||
'label' => 'Date',
|
||||
'required' => 1,
|
||||
'settings' => array(
|
||||
'default_value' => 'now',
|
||||
'default_value2' => 'same',
|
||||
'default_value_code' => '',
|
||||
'default_value_code2' => '',
|
||||
'user_register_form' => FALSE,
|
||||
),
|
||||
'widget' => array(
|
||||
'active' => 1,
|
||||
'module' => 'date',
|
||||
'settings' => array(
|
||||
'increment' => '15',
|
||||
'input_format' => 'm/d/Y - H:i:s',
|
||||
'input_format_custom' => '',
|
||||
'label_position' => 'above',
|
||||
'text_parts' => array(),
|
||||
'year_range' => '-3:+3',
|
||||
),
|
||||
'type' => 'date_popup',
|
||||
'weight' => '1',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// Exported field: 'log-farm_soil_sample-field_farm_images'.
|
||||
$fields['log-farm_soil_sample-field_farm_images'] = array(
|
||||
'field_config' => array(
|
||||
'active' => '1',
|
||||
'cardinality' => '-1',
|
||||
'deleted' => '0',
|
||||
'entity_types' => array(),
|
||||
'field_name' => 'field_farm_images',
|
||||
'foreign keys' => array(
|
||||
'fid' => array(
|
||||
'columns' => array(
|
||||
'fid' => 'fid',
|
||||
),
|
||||
'table' => 'file_managed',
|
||||
),
|
||||
),
|
||||
'indexes' => array(
|
||||
'fid' => array(
|
||||
0 => 'fid',
|
||||
),
|
||||
),
|
||||
'locked' => '0',
|
||||
'module' => 'image',
|
||||
'settings' => array(
|
||||
'default_image' => 0,
|
||||
'uri_scheme' => 'public',
|
||||
),
|
||||
'translatable' => '0',
|
||||
'type' => 'image',
|
||||
),
|
||||
'field_instance' => array(
|
||||
'bundle' => 'farm_soil_sample',
|
||||
'deleted' => '0',
|
||||
'description' => 'Use this field to attach photos or other image files to this soil sample record.',
|
||||
'display' => array(
|
||||
'default' => array(
|
||||
'label' => 'above',
|
||||
'module' => 'image',
|
||||
'settings' => array(
|
||||
'image_link' => 'file',
|
||||
'image_style' => 'large',
|
||||
),
|
||||
'type' => 'image',
|
||||
'weight' => '4',
|
||||
),
|
||||
),
|
||||
'entity_type' => 'log',
|
||||
'field_name' => 'field_farm_images',
|
||||
'label' => 'Images',
|
||||
'required' => 0,
|
||||
'settings' => array(
|
||||
'alt_field' => 0,
|
||||
'default_image' => 0,
|
||||
'file_directory' => '',
|
||||
'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' => '5',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// Exported field: 'log-farm_soil_sample-field_farm_notes'.
|
||||
$fields['log-farm_soil_sample-field_farm_notes'] = array(
|
||||
'field_config' => array(
|
||||
'active' => '1',
|
||||
'cardinality' => '1',
|
||||
'deleted' => '0',
|
||||
'entity_types' => array(),
|
||||
'field_name' => 'field_farm_notes',
|
||||
'foreign keys' => array(
|
||||
'format' => array(
|
||||
'columns' => array(
|
||||
'format' => 'format',
|
||||
),
|
||||
'table' => 'filter_format',
|
||||
),
|
||||
),
|
||||
'indexes' => array(
|
||||
'format' => array(
|
||||
0 => 'format',
|
||||
),
|
||||
),
|
||||
'locked' => '0',
|
||||
'module' => 'text',
|
||||
'settings' => array(),
|
||||
'translatable' => '0',
|
||||
'type' => 'text_long',
|
||||
),
|
||||
'field_instance' => array(
|
||||
'bundle' => 'farm_soil_sample',
|
||||
'default_value' => NULL,
|
||||
'deleted' => '0',
|
||||
'description' => '',
|
||||
'display' => array(
|
||||
'default' => array(
|
||||
'label' => 'above',
|
||||
'module' => 'text',
|
||||
'settings' => array(),
|
||||
'type' => 'text_default',
|
||||
'weight' => '5',
|
||||
),
|
||||
),
|
||||
'entity_type' => 'log',
|
||||
'field_name' => 'field_farm_notes',
|
||||
'label' => 'Notes',
|
||||
'required' => 0,
|
||||
'settings' => array(
|
||||
'text_processing' => '0',
|
||||
'user_register_form' => FALSE,
|
||||
),
|
||||
'widget' => array(
|
||||
'active' => 1,
|
||||
'module' => 'text',
|
||||
'settings' => array(
|
||||
'rows' => '5',
|
||||
),
|
||||
'type' => 'text_textarea',
|
||||
'weight' => '6',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// Exported field: 'log-farm_soil_sample-field_farm_soil_sample_points'.
|
||||
$fields['log-farm_soil_sample-field_farm_soil_sample_points'] = array(
|
||||
'field_config' => array(
|
||||
'active' => '1',
|
||||
'cardinality' => '-1',
|
||||
'deleted' => '0',
|
||||
'entity_types' => array(),
|
||||
'field_name' => 'field_farm_soil_sample_points',
|
||||
'foreign keys' => array(),
|
||||
'indexes' => array(
|
||||
'bbox' => array(
|
||||
0 => 'top',
|
||||
1 => 'bottom',
|
||||
2 => 'left',
|
||||
3 => 'right',
|
||||
),
|
||||
'bottom' => array(
|
||||
0 => 'bottom',
|
||||
),
|
||||
'centroid' => array(
|
||||
0 => 'lat',
|
||||
1 => 'lon',
|
||||
),
|
||||
'geohash' => array(
|
||||
0 => 'geohash',
|
||||
),
|
||||
'lat' => array(
|
||||
0 => 'lat',
|
||||
),
|
||||
'left' => array(
|
||||
0 => 'left',
|
||||
),
|
||||
'lon' => array(
|
||||
0 => 'lon',
|
||||
),
|
||||
'right' => array(
|
||||
0 => 'right',
|
||||
),
|
||||
'top' => array(
|
||||
0 => 'top',
|
||||
),
|
||||
),
|
||||
'locked' => '0',
|
||||
'module' => 'geofield',
|
||||
'settings' => array(
|
||||
'backend' => 'default',
|
||||
'srid' => '4326',
|
||||
),
|
||||
'translatable' => '0',
|
||||
'type' => 'geofield',
|
||||
),
|
||||
'field_instance' => array(
|
||||
'bundle' => 'farm_soil_sample',
|
||||
'default_value' => NULL,
|
||||
'deleted' => '0',
|
||||
'description' => 'Use the map to pinpoint the location(s) from which this sample is taken. If you are preparing a soil test, you may be sampling multiple points within a given area. All the points that comprise this sample should be included.',
|
||||
'display' => array(
|
||||
'default' => array(
|
||||
'label' => 'above',
|
||||
'module' => 'geofield',
|
||||
'settings' => array(
|
||||
'data' => 'full',
|
||||
'map_preset' => 'farm_soil_map',
|
||||
),
|
||||
'type' => 'geofield_openlayers',
|
||||
'weight' => '2',
|
||||
),
|
||||
),
|
||||
'entity_type' => 'log',
|
||||
'field_name' => 'field_farm_soil_sample_points',
|
||||
'label' => 'Sample Points',
|
||||
'required' => 0,
|
||||
'settings' => array(
|
||||
'user_register_form' => FALSE,
|
||||
),
|
||||
'widget' => array(
|
||||
'active' => 1,
|
||||
'module' => 'openlayers',
|
||||
'settings' => array(
|
||||
'allow_edit' => 1,
|
||||
'data_storage' => 'single',
|
||||
'feature_types' => array(
|
||||
'path' => 0,
|
||||
'point' => 'point',
|
||||
'polygon' => 0,
|
||||
),
|
||||
'openlayers_map' => 'farm_map_geolocate',
|
||||
),
|
||||
'type' => 'geofield_openlayers',
|
||||
'weight' => '3',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// Exported field: 'log-farm_soil_sample-field_farm_soil_types'.
|
||||
$fields['log-farm_soil_sample-field_farm_soil_types'] = array(
|
||||
'field_config' => array(
|
||||
'active' => '1',
|
||||
'cardinality' => '-1',
|
||||
'deleted' => '0',
|
||||
'entity_types' => array(),
|
||||
'field_name' => 'field_farm_soil_types',
|
||||
'foreign keys' => array(
|
||||
'tid' => array(
|
||||
'columns' => array(
|
||||
'tid' => 'tid',
|
||||
),
|
||||
'table' => 'taxonomy_term_data',
|
||||
),
|
||||
),
|
||||
'indexes' => array(
|
||||
'tid' => array(
|
||||
0 => 'tid',
|
||||
),
|
||||
),
|
||||
'locked' => '0',
|
||||
'module' => 'taxonomy',
|
||||
'settings' => array(
|
||||
'allowed_values' => array(
|
||||
0 => array(
|
||||
'vocabulary' => 'farm_soil_types',
|
||||
'parent' => '0',
|
||||
),
|
||||
),
|
||||
),
|
||||
'translatable' => '0',
|
||||
'type' => 'taxonomy_term_reference',
|
||||
),
|
||||
'field_instance' => array(
|
||||
'bundle' => 'farm_soil_sample',
|
||||
'default_value' => NULL,
|
||||
'deleted' => '0',
|
||||
'description' => 'List the types of soils that are included in this sample. For soil maps and soil names, visit http://websoilsurvey.nrcs.usda.gov/app',
|
||||
'display' => array(
|
||||
'default' => array(
|
||||
'label' => 'inline',
|
||||
'module' => 'taxonomy',
|
||||
'settings' => array(),
|
||||
'type' => 'taxonomy_term_reference_link',
|
||||
'weight' => '3',
|
||||
),
|
||||
),
|
||||
'entity_type' => 'log',
|
||||
'field_name' => 'field_farm_soil_types',
|
||||
'label' => 'Soil Types',
|
||||
'required' => 1,
|
||||
'settings' => array(
|
||||
'user_register_form' => FALSE,
|
||||
),
|
||||
'widget' => array(
|
||||
'active' => 0,
|
||||
'module' => 'taxonomy',
|
||||
'settings' => array(
|
||||
'autocomplete_path' => 'taxonomy/autocomplete',
|
||||
'size' => 60,
|
||||
),
|
||||
'type' => 'taxonomy_autocomplete',
|
||||
'weight' => '4',
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
// Translatables
|
||||
// Included for use with string extractors like potx.
|
||||
t('CSHA Request');
|
||||
t('Date');
|
||||
t('Enter the date when this sample was taken (or will take place).');
|
||||
t('Images');
|
||||
t('List the types of soils that are included in this sample. For soil maps and soil names, visit http://websoilsurvey.nrcs.usda.gov/app');
|
||||
t('Notes');
|
||||
t('Sample Points');
|
||||
t('Soil Sample');
|
||||
t('Soil Types');
|
||||
t('Use the map to pinpoint the location(s) from which this sample is taken. If you are preparing a soil test, you may be sampling multiple points within a given area. All the points that comprise this sample should be included.');
|
||||
t('Use this field to attach photos or other image files to this soil sample record.');
|
||||
|
||||
return $fields;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* farm_soil.features.inc
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_ctools_plugin_api().
|
||||
*/
|
||||
function farm_soil_ctools_plugin_api() {
|
||||
list($module, $api) = func_get_args();
|
||||
if ($module == "strongarm" && $api == "strongarm") {
|
||||
return array("version" => "1");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implements hook_default_log_type().
|
||||
*/
|
||||
function farm_soil_default_log_type() {
|
||||
$items = array();
|
||||
$items['farm_soil_sample'] = entity_import('log_type', '{
|
||||
"type" : "farm_soil_sample",
|
||||
"label" : "Soil Sample",
|
||||
"weight" : 0,
|
||||
"name_pattern" : "Sample [log:id] [field:heyo]",
|
||||
"rdf_mapping" : []
|
||||
}');
|
||||
return $items;
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* farm_soil.features.taxonomy.inc
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_taxonomy_default_vocabularies().
|
||||
*/
|
||||
function farm_soil_taxonomy_default_vocabularies() {
|
||||
return array(
|
||||
'farm_soil_types' => array(
|
||||
'name' => 'Soil Types',
|
||||
'machine_name' => 'farm_soil_types',
|
||||
'description' => 'A vocabulary of soil types.',
|
||||
'hierarchy' => '0',
|
||||
'module' => 'taxonomy',
|
||||
'weight' => '0',
|
||||
'rdf_mapping' => array(
|
||||
'rdftype' => array(
|
||||
0 => 'skos:ConceptScheme',
|
||||
),
|
||||
'name' => array(
|
||||
'predicates' => array(
|
||||
0 => 'dc:title',
|
||||
),
|
||||
),
|
||||
'description' => array(
|
||||
'predicates' => array(
|
||||
0 => 'rdfs:comment',
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
name = Farm Soil
|
||||
description = Provides features for soil health management.
|
||||
core = 7.x
|
||||
package = Farm
|
||||
dependencies[] = date
|
||||
dependencies[] = entityreference
|
||||
dependencies[] = farm_map
|
||||
dependencies[] = features
|
||||
dependencies[] = geofield
|
||||
dependencies[] = log
|
||||
dependencies[] = openlayers
|
||||
dependencies[] = strongarm
|
||||
dependencies[] = taxonomy
|
||||
features[ctools][] = strongarm:strongarm:1
|
||||
features[features_api][] = api:1
|
||||
features[field][] = log-farm_soil_csha_request-field_farm_soil_sample
|
||||
features[field][] = log-farm_soil_csha_results-field_farm_soil_csha_request
|
||||
features[field][] = log-farm_soil_sample-field_farm_date
|
||||
features[field][] = log-farm_soil_sample-field_farm_images
|
||||
features[field][] = log-farm_soil_sample-field_farm_notes
|
||||
features[field][] = log-farm_soil_sample-field_farm_soil_sample_points
|
||||
features[field][] = log-farm_soil_sample-field_farm_soil_types
|
||||
features[log_type][] = farm_soil_sample
|
||||
features[taxonomy][] = farm_soil_types
|
||||
features[variable][] = field_bundle_settings_log__farm_soil_sample
|
|
@ -0,0 +1,7 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* Code for the Farm Soil feature.
|
||||
*/
|
||||
|
||||
include_once 'farm_soil.features.inc';
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
/**
|
||||
* @file
|
||||
* farm_soil.strongarm.inc
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_strongarm().
|
||||
*/
|
||||
function farm_soil_strongarm() {
|
||||
$export = array();
|
||||
|
||||
$strongarm = new stdClass();
|
||||
$strongarm->disabled = FALSE; /* Edit this to true to make a default strongarm disabled initially */
|
||||
$strongarm->api_version = 1;
|
||||
$strongarm->name = 'field_bundle_settings_log__farm_soil_sample';
|
||||
$strongarm->value = array(
|
||||
'view_modes' => array(
|
||||
'full' => array(
|
||||
'custom_settings' => FALSE,
|
||||
),
|
||||
'token' => array(
|
||||
'custom_settings' => FALSE,
|
||||
),
|
||||
),
|
||||
'extra_fields' => array(
|
||||
'form' => array(),
|
||||
'display' => array(),
|
||||
),
|
||||
);
|
||||
$export['field_bundle_settings_log__farm_soil_sample'] = $strongarm;
|
||||
|
||||
return $export;
|
||||
}
|
Loading…
Reference in New Issue