You are here

farm_area.install in farmOS 7

Farm area install.

File

modules/farm/farm_area/farm_area.install
View source
<?php

/**
 * @file
 * Farm area install.
 */

/**
 * Update allowed values in the farm area types field.
 */
function farm_area_update_7000() {

  // Load the farm area type field info.
  $area_type_field = field_info_field('field_farm_area_type');

  // Set the allowed values to an empty array.
  $area_type_field['settings']['allowed_values'] = array();

  // Point to the new allowed values function.
  $area_type_field['settings']['allowed_values_function'] = 'farm_area_type_options';

  // Update the field.
  field_update_field($area_type_field);
}

/**
 * Install the Farm Area Types and Farm Water modules.
 */
function farm_area_update_7001(&$sandbox) {
  $modules = array(
    'farm_area_types',
    'farm_water',
  );
  foreach ($modules as $module) {
    if (!module_exists($module)) {
      module_enable(array(
        $module,
      ));
    }
  }
}

Functions

Namesort descending Description
farm_area_update_7000 Update allowed values in the farm area types field.
farm_area_update_7001 Install the Farm Area Types and Farm Water modules.