You are here

function farm_area_type_options in farmOS 7

Get an array of available farm area type options.

Return value

array Returns an array of farm area type options provided by modules, for use in a form select element.

3 calls to farm_area_type_options()
farm_area_generate_form in modules/farm/farm_area/farm_area_generate/farm_area_generate.module
Area generator form.
farm_area_generate_form_submit in modules/farm/farm_area/farm_area_generate/farm_area_generate.module
Farm area generate form submit.
farm_area_import_form in modules/farm/farm_area/farm_area_import/farm_area_import.module
Area import form.
2 string references to 'farm_area_type_options'
farm_area_field_default_field_bases in modules/farm/farm_area/farm_area.features.field_base.inc
Implements hook_field_default_field_bases().
farm_area_update_7000 in modules/farm/farm_area/farm_area.install
Update allowed values in the farm area types field.

File

modules/farm/farm_area/farm_area.module, line 115

Code

function farm_area_type_options() {

  // Start with an empty options array.
  $options = array();

  // Get available area types.
  $area_types = farm_area_types();

  // Iterate through the area types to build an options list.
  foreach ($area_types as $key => $type) {
    if (!empty($type['label'])) {
      $options[$key] = $type['label'];
    }
  }

  // Return the list of options.
  return $options;
}