You are here

function hook_farm_metrics in farmOS 7

Defines farm metrics.

Return value

array Returns an array of farm metrics. The key should be a unique metric name, and each should be an array of metric values including the following keys:

  • label: Translated metric label.
  • value: The metric's value.
  • link: A path to link the value to.
  • weight: Weight for ordering (optional - defaults to alphabetical).

Related topics

2 functions implement hook_farm_metrics()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

farm_area_farm_metrics in modules/farm/farm_area/farm_area.farm_metrics.inc
Implements hook_farm_metrics().
farm_ui_farm_metrics in modules/farm/farm_ui/farm_ui.farm_metrics.inc
Implements hook_farm_metrics().
1 invocation of hook_farm_metrics()
farm_metrics in modules/farm/farm_metrics/farm_metrics.module
Returns a sorted array of all metrics.

File

modules/farm/farm_metrics/farm_metrics.api.php, line 36
Hooks provided by farm_metrics.

Code

function hook_farm_metrics() {
  $metrics = array();
  $metrics['example'] = array(
    'label' => t('Example'),
    'value' => '100',
    'link' => 'farm/example',
    'weight' => -10,
  );
  return $metrics;
}