farmOS/modules/farm/farm_log/farm_log_sale/farm_log_sale.module

55 lines
971 B
Plaintext

<?php
/**
* @file
* Code for the Farm Log: Sale feature.
*/
include_once 'farm_log_sale.features.inc';
/**
* Implements hook_farm_ui_entities().
*/
function farm_log_sale_farm_ui_entities() {
return array(
'log' => array(
'farm_sale' => array(
'label' => t('Sale'),
'label_plural' => t('Sales'),
'view' => 'farm_log_sale',
),
),
);
}
/**
* Implements hook_farm_ui_actions().
*/
function farm_log_sale_farm_ui_actions() {
// Define farm area actions.
$actions = array(
'sale' => array(
'title' => t('Add a sale'),
'href' => 'log/add/farm_sale',
'assets' => array(
'all',
),
),
);
return $actions;
}
/**
* Implements hook_farm_asset_view_views().
*/
function farm_log_sale_farm_asset_view_views($farm_asset) {
// Show a list of sales at the top of all asset pages.
return array(
array(
'name' => 'farm_log_sale',
'weight' => 0,
),
);
}