Move default crop area types to new farm_crop_area_types module.

This commit is contained in:
Michael Stenta 2018-12-04 15:16:27 -05:00
parent 74c99b0479
commit 026e90e3a6
6 changed files with 47 additions and 19 deletions

View File

@ -71,6 +71,7 @@ function farm_install_configure_form($form, &$form_state) {
'farm_area_generate' => st('Area generator (for generating parallel beds within an area)'),
'farm_area_import' => st('Import areas in bulk from a single KML file'),
'farm_area_types' => t('Default area types: Property, Field, Building, etc'),
'farm_crop_area_types' => t('Crop area types: Bed and Greenhouse'),
'farm_access' => st('Default roles: Manager, Worker, Viewer'),
'farm_help' => st('farmOS Help Pages'),
'farm_tour' => st('farmOS Tours'),

View File

@ -82,3 +82,13 @@ function farm_crop_update_7002(&$sandbox) {
function farm_crop_update_7003(&$sandbox) {
features_revert(array('farm_crop' => array('field_instance')));
}
/**
* Install the Farm Crop Area Types module.
*/
function farm_crop_update_7004(&$sandbox) {
$module = 'farm_crop_area_types';
if (!module_exists($module)) {
module_enable(array($module));
}
}

View File

@ -134,25 +134,6 @@ function farm_crop_planting_plan_submit(array $form, array &$form_state) {
}
}
/**
* Implements hook_farm_area_type_info().
*/
function farm_crop_farm_area_type_info() {
return array(
'greenhouse' => array(
'label' => t('Greenhouse'),
'style' => 'farm_map_style_green',
'weight' => 0,
),
'bed' => array(
'label' => t('Bed'),
'style' => 'farm_map_style_green',
'zoom_levels' => array(18, 19, 20, 21, 22, 23, 24),
'weight' => -5,
),
);
}
/**
* Implements hook_farm_ui_entities().
*/

View File

@ -0,0 +1,25 @@
<?php
/**
* @file
* Farm Area hooks implemented by the Farm Crop Area Types module.
*/
/**
* Implements hook_farm_area_type_info().
*/
function farm_crop_area_types_farm_area_type_info() {
return array(
'bed' => array(
'label' => t('Bed'),
'style' => 'farm_map_style_green',
'zoom_levels' => array(18, 19, 20, 21, 22, 23, 24),
'weight' => -5,
),
'greenhouse' => array(
'label' => t('Greenhouse'),
'style' => 'farm_map_style_green',
'weight' => 0,
),
);
}

View File

@ -0,0 +1,5 @@
name = Farm Crop Area Types
description = Provides default area types for crop management: Bed, Greenhouse.
core = 7.x
package = farmOS
dependencies[] = farm_area

View File

@ -0,0 +1,6 @@
<?php
/**
* @file
* Farm crop area types module.
*/