mirror of
https://github.com/farmOS/farmOS.git
synced 2024-02-23 11:37:38 +01:00
55 lines
No EOL
1 KiB
Text
55 lines
No EOL
1 KiB
Text
<?php
|
|
/**
|
|
* @file
|
|
* Code for the Farm Livestock feature.
|
|
*/
|
|
|
|
include_once 'farm_livestock.features.inc';
|
|
|
|
/**
|
|
* Implements hook_farm_admin_actions().
|
|
*/
|
|
function farm_livestock_farm_admin_actions() {
|
|
|
|
// Define farm area actions.
|
|
$actions = array(
|
|
'animal' => array(
|
|
'title' => t('Add an animal'),
|
|
'href' => 'farm/asset/add/animal',
|
|
'views' => array(
|
|
'farm_animals',
|
|
),
|
|
),
|
|
);
|
|
return $actions;
|
|
}
|
|
|
|
/**
|
|
* Implements hook_farm_asset_view_views().
|
|
*/
|
|
function farm_livestock_farm_asset_view_views($farm_asset) {
|
|
|
|
// If the entity is not an animal, bail.
|
|
if ($farm_asset->type != 'animal') {
|
|
return;
|
|
}
|
|
|
|
// Return a list of Views to include on Animals.
|
|
return array(
|
|
'farm_log_activity',
|
|
'farm_log_observation',
|
|
'farm_log_movement',
|
|
);
|
|
}
|
|
|
|
/**
|
|
* Implements hook_farm_area_links().
|
|
*/
|
|
function farm_livestock_farm_area_links($id) {
|
|
return array(
|
|
array(
|
|
'title' => t('Animals'),
|
|
'href' => 'farm/area/' . $id . '/animals',
|
|
),
|
|
);
|
|
} |