farmOS/modules/farm/farm_water/farm_water_test/farm_water_test.module

45 lines
1.0 KiB
Plaintext

<?php
/**
* @file
* Code for the Farm Water Test feature.
*/
include_once 'farm_water_test.features.inc';
/**
* Implements hook_farm_ui_entities().
*/
function farm_water_test_farm_ui_entities() {
return array(
'log' => array(
'farm_water_test' => array(
'label' => t('Water test'),
'label_plural' => t('Water test'),
'view' => 'farm_water_test',
'farm_asset' => 'none',
'areas' => TRUE,
),
),
);
}
/**
* Implements hook_feeds_importer_default_alter().
*/
function farm_water_test_feeds_importer_default_alter(&$importers) {
// Add extra field mappings to water tests.
$name = 'log_farm_water_test';
if (!empty($importers[$name])) {
$mappings = array(
array(
'source' => 'Laboratory',
'target' => 'field_farm_water_lab',
'unique' => FALSE,
),
);
$importer_mappings =& $importers[$name]->config['processor']['config']['mappings'];
$importer_mappings = array_merge($importer_mappings, $mappings);
}
}