Initial commit: a set of taxonomies for farms.

This commit is contained in:
Michael Stenta 2014-02-06 02:19:23 -05:00
commit 14fca69d18
4 changed files with 514 additions and 0 deletions

View File

@ -0,0 +1,425 @@
<?php
/**
* @file
* farm_taxonomy.features.field.inc
*/
/**
* Implements hook_field_default_fields().
*/
function farm_taxonomy_field_default_fields() {
$fields = array();
// Exported field: 'taxonomy_term-farm_areas-field_farm_areas'.
$fields['taxonomy_term-farm_areas-field_farm_areas'] = array(
'field_config' => array(
'active' => '1',
'cardinality' => '-1',
'deleted' => '0',
'entity_types' => array(),
'field_name' => 'field_farm_areas',
'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_areas',
'parent' => '0',
),
),
),
'translatable' => '0',
'type' => 'taxonomy_term_reference',
),
'field_instance' => array(
'bundle' => 'farm_areas',
'default_value' => NULL,
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'inline',
'module' => 'taxonomy',
'settings' => array(),
'type' => 'taxonomy_term_reference_link',
'weight' => '2',
),
),
'entity_type' => 'taxonomy_term',
'field_name' => 'field_farm_areas',
'label' => 'Adjacent areas',
'required' => 0,
'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',
),
),
);
// Exported field: 'taxonomy_term-farm_areas-field_farm_images'.
$fields['taxonomy_term-farm_areas-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_areas',
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'hidden',
'module' => 'image',
'settings' => array(
'image_link' => '',
'image_style' => 'large',
),
'type' => 'image',
'weight' => '0',
),
),
'entity_type' => 'taxonomy_term',
'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' => 'throbber',
),
'type' => 'image_image',
'weight' => '6',
),
),
);
// Exported field: 'taxonomy_term-farm_crops-field_farm_companions'.
$fields['taxonomy_term-farm_crops-field_farm_companions'] = array(
'field_config' => array(
'active' => '1',
'cardinality' => '-1',
'deleted' => '0',
'entity_types' => array(),
'field_name' => 'field_farm_companions',
'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_crops',
'parent' => '0',
),
),
),
'translatable' => '0',
'type' => 'taxonomy_term_reference',
),
'field_instance' => array(
'bundle' => 'farm_crops',
'default_value' => NULL,
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'module' => 'taxonomy',
'settings' => array(),
'type' => 'taxonomy_term_reference_link',
'weight' => '1',
),
),
'entity_type' => 'taxonomy_term',
'field_name' => 'field_farm_companions',
'label' => 'Companions',
'required' => 0,
'settings' => array(
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 0,
'module' => 'taxonomy',
'settings' => array(
'autocomplete_path' => 'taxonomy/autocomplete',
'size' => 60,
),
'type' => 'taxonomy_autocomplete',
'weight' => '2',
),
),
);
// Exported field: 'taxonomy_term-farm_crops-field_farm_crop_family'.
$fields['taxonomy_term-farm_crops-field_farm_crop_family'] = array(
'field_config' => array(
'active' => '1',
'cardinality' => '1',
'deleted' => '0',
'entity_types' => array(),
'field_name' => 'field_farm_crop_family',
'foreign keys' => array(
'format' => array(
'columns' => array(
'format' => 'format',
),
'table' => 'filter_format',
),
),
'indexes' => array(
'format' => array(
0 => 'format',
),
),
'locked' => '0',
'module' => 'text',
'settings' => array(
'max_length' => '255',
),
'translatable' => '0',
'type' => 'text',
),
'field_instance' => array(
'bundle' => 'farm_crops',
'default_value' => NULL,
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'module' => 'text',
'settings' => array(),
'type' => 'text_default',
'weight' => '0',
),
),
'entity_type' => 'taxonomy_term',
'field_name' => 'field_farm_crop_family',
'label' => 'Crop family',
'required' => 0,
'settings' => array(
'text_processing' => '0',
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 1,
'module' => 'text',
'settings' => array(
'size' => '60',
),
'type' => 'text_textfield',
'weight' => '1',
),
),
);
// Exported field: 'taxonomy_term-farm_crops-field_farm_images'.
$fields['taxonomy_term-farm_crops-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_crops',
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'hidden',
'module' => 'image',
'settings' => array(
'image_link' => '',
'image_style' => '',
),
'type' => 'image',
'weight' => '4',
),
),
'entity_type' => 'taxonomy_term',
'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' => 'throbber',
),
'type' => 'image_image',
'weight' => '5',
),
),
);
// Exported field: 'taxonomy_term-farm_crops-field_farm_maturity_days'.
$fields['taxonomy_term-farm_crops-field_farm_maturity_days'] = array(
'field_config' => array(
'active' => '1',
'cardinality' => '1',
'deleted' => '0',
'entity_types' => array(),
'field_name' => 'field_farm_maturity_days',
'foreign keys' => array(),
'indexes' => array(),
'locked' => '0',
'module' => 'number',
'settings' => array(),
'translatable' => '0',
'type' => 'number_integer',
),
'field_instance' => array(
'bundle' => 'farm_crops',
'default_value' => NULL,
'deleted' => '0',
'description' => '',
'display' => array(
'default' => array(
'label' => 'above',
'module' => 'number',
'settings' => array(
'decimal_separator' => '.',
'prefix_suffix' => TRUE,
'scale' => 0,
'thousand_separator' => ' ',
),
'type' => 'number_integer',
'weight' => '2',
),
),
'entity_type' => 'taxonomy_term',
'field_name' => 'field_farm_maturity_days',
'label' => 'Days to maturity',
'required' => 0,
'settings' => array(
'max' => '',
'min' => '',
'prefix' => '',
'suffix' => ' day| days',
'user_register_form' => FALSE,
),
'widget' => array(
'active' => 0,
'module' => 'number',
'settings' => array(),
'type' => 'number',
'weight' => '3',
),
),
);
// Translatables
// Included for use with string extractors like potx.
t('Adjacent areas');
t('Companions');
t('Crop family');
t('Days to maturity');
t('Images');
return $fields;
}

View File

@ -0,0 +1,61 @@
<?php
/**
* @file
* farm_taxonomy.features.taxonomy.inc
*/
/**
* Implements hook_taxonomy_default_vocabularies().
*/
function farm_taxonomy_taxonomy_default_vocabularies() {
return array(
'farm_areas' => array(
'name' => 'Fields+Beds',
'machine_name' => 'farm_areas',
'description' => 'Distinct fields or beds that crops are planted into.',
'hierarchy' => '0',
'module' => 'taxonomy',
'weight' => '0',
),
'farm_containers' => array(
'name' => 'Planting Containers',
'machine_name' => 'farm_containers',
'description' => 'Various types of containers used for planting into.',
'hierarchy' => '0',
'module' => 'taxonomy',
'weight' => '0',
),
'farm_crops' => array(
'name' => 'Crops',
'machine_name' => 'farm_crops',
'description' => 'A taxonomy of crop types and varieties.',
'hierarchy' => '0',
'module' => 'taxonomy',
'weight' => '0',
),
'farm_fertilizers' => array(
'name' => 'Fertilizers',
'machine_name' => 'farm_fertilizers',
'description' => 'Fertilizers that are used to nourish crops, fields, beds, etc.',
'hierarchy' => '0',
'module' => 'taxonomy',
'weight' => '0',
),
'farm_quantity_units' => array(
'name' => 'Quantity Units',
'machine_name' => 'farm_quantity_units',
'description' => 'A vocabulary of units for describing quantities.',
'hierarchy' => '0',
'module' => 'taxonomy',
'weight' => '0',
),
'farm_threats' => array(
'name' => 'Threats',
'machine_name' => 'farm_threats',
'description' => 'External forces that threaten your stuff.',
'hierarchy' => '0',
'module' => 'taxonomy',
'weight' => '0',
),
);
}

23
farm_taxonomy.info Normal file
View File

@ -0,0 +1,23 @@
name = Farm Taxonomy
description = Common taxonomies for farms.
core = 7.x
package = Farm Features
dependencies[] = features
dependencies[] = field_sql_storage
dependencies[] = image
dependencies[] = number
dependencies[] = taxonomy
dependencies[] = text
features[features_api][] = api:1
features[field][] = taxonomy_term-farm_areas-field_farm_areas
features[field][] = taxonomy_term-farm_areas-field_farm_images
features[field][] = taxonomy_term-farm_crops-field_farm_companions
features[field][] = taxonomy_term-farm_crops-field_farm_crop_family
features[field][] = taxonomy_term-farm_crops-field_farm_images
features[field][] = taxonomy_term-farm_crops-field_farm_maturity_days
features[taxonomy][] = farm_areas
features[taxonomy][] = farm_containers
features[taxonomy][] = farm_crops
features[taxonomy][] = farm_fertilizers
features[taxonomy][] = farm_quantity_units
features[taxonomy][] = farm_threats

5
farm_taxonomy.module Normal file
View File

@ -0,0 +1,5 @@
<?php
/**
* @file
* Drupal needs this blank file.
*/