farmOS/modules/farm/farm_log/farm_log_input/farm_log_input.module

43 lines
869 B
Plaintext

<?php
/**
* @file
* Code for the Farm Log: Input feature.
*/
// Include Features code.
include_once 'farm_log_input.features.inc';
/**
* Implements hook_farm_ui_entities().
*/
function farm_log_input_farm_ui_entities() {
return array(
'log' => array(
'farm_input' => array(
'label' => t('Input'),
'label_plural' => t('Inputs'),
'view' => 'farm_log_input',
'areas' => TRUE,
'weight' => 0,
),
),
);
}
/**
* Implements hook_farm_ui_entity_views().
*/
function farm_log_input_farm_ui_entity_views($entity_type, $bundle, $entity) {
$views = array();
// Return a list of Views to include on Areas.
if ($entity_type == 'taxonomy_term' && $entity->vocabulary_machine_name == 'farm_areas') {
$views[] = array(
'name' => 'farm_log_input',
'arg' => 2,
);
}
return $views;
}