Move all default area types (except 'other') to new farm_area_types module.
This commit is contained in:
parent
1e69b31bd1
commit
74c99b0479
|
@ -70,6 +70,7 @@ function farm_install_configure_form($form, &$form_state) {
|
|||
'farm_soil_test' => st('Soil test logs'),
|
||||
'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_access' => st('Default roles: Manager, Worker, Viewer'),
|
||||
'farm_help' => st('farmOS Help Pages'),
|
||||
'farm_tour' => st('farmOS Tours'),
|
||||
|
|
|
@ -9,26 +9,6 @@
|
|||
*/
|
||||
function farm_area_farm_area_type_info() {
|
||||
return array(
|
||||
'building' => array(
|
||||
'label' => t('Building'),
|
||||
'style' => 'farm_map_style_red',
|
||||
'weight' => 0,
|
||||
),
|
||||
'field' => array(
|
||||
'label' => t('Field'),
|
||||
'style' => 'farm_map_style_yellow',
|
||||
'weight' => 10,
|
||||
),
|
||||
'landmark' => array(
|
||||
'label' => t('Landmark'),
|
||||
'style' => 'farm_map_style_orange',
|
||||
'weight' => 50,
|
||||
),
|
||||
'property' => array(
|
||||
'label' => t('Property'),
|
||||
'style' => 'farm_map_style_purple',
|
||||
'weight' => 100,
|
||||
),
|
||||
'other' => array(
|
||||
'label' => t('Other'),
|
||||
'style' => 'farm_map_style_blue',
|
||||
|
|
|
@ -21,3 +21,13 @@ function farm_area_update_7000() {
|
|||
// Update the field.
|
||||
field_update_field($area_type_field);
|
||||
}
|
||||
|
||||
/**
|
||||
* Install the Farm Area Types module.
|
||||
*/
|
||||
function farm_area_update_7001(&$sandbox) {
|
||||
$module = 'farm_area_types';
|
||||
if (!module_exists($module)) {
|
||||
module_enable(array($module));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Farm Area hooks implemented by the Farm Area Types module.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Implements hook_farm_area_type_info().
|
||||
*/
|
||||
function farm_area_types_farm_area_type_info() {
|
||||
return array(
|
||||
'building' => array(
|
||||
'label' => t('Building'),
|
||||
'style' => 'farm_map_style_red',
|
||||
'weight' => 0,
|
||||
),
|
||||
'field' => array(
|
||||
'label' => t('Field'),
|
||||
'style' => 'farm_map_style_yellow',
|
||||
'weight' => 10,
|
||||
),
|
||||
'landmark' => array(
|
||||
'label' => t('Landmark'),
|
||||
'style' => 'farm_map_style_orange',
|
||||
'weight' => 50,
|
||||
),
|
||||
'property' => array(
|
||||
'label' => t('Property'),
|
||||
'style' => 'farm_map_style_purple',
|
||||
'weight' => 100,
|
||||
),
|
||||
);
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
name = Farm Area Types
|
||||
description = Provides some default area types.
|
||||
core = 7.x
|
||||
package = farmOS
|
||||
dependencies[] = farm_area
|
|
@ -0,0 +1,6 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* @file
|
||||
* Farm area types module.
|
||||
*/
|
Loading…
Reference in New Issue