You are here

function farm_quantity_measure_options in farmOS 7

Define available options for the Measure field.

2 calls to farm_quantity_measure_options()
farm_crop_planting_quick_form in modules/farm/farm_crop/farm_crop.farm_quick.planting.inc
Planting quick form.
farm_quantity_log_query_add_filters in modules/farm/farm_quantity/farm_quantity_log/farm_quantity_log.module
Helper function for adding joins and filters to a quantity log query.
1 string reference to 'farm_quantity_measure_options'
farm_quantity_field_default_field_bases in modules/farm/farm_quantity/farm_quantity.features.field_base.inc
Implements hook_field_default_field_bases().

File

modules/farm/farm_quantity/farm_quantity.module, line 205
Farm quantity module.

Code

function farm_quantity_measure_options() {

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

  // Load information about measures.
  $measures = farm_quantity_measures();

  // Iterate through the measures and build a list of options.
  foreach ($measures as $measure => $data) {
    $options[$measure] = $data['label'];
  }

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