farmOS/modules/farm/farm_asset/farm_asset.api.php

60 lines
1.2 KiB
PHP

<?php
/**
* @file
* Hooks provided by farm_asset.
*
* This file contains no working PHP code; it exists to provide additional
* documentation for doxygen as well as to document hooks in the standard
* Drupal manner.
*/
/**
* @defgroup farm_asset Farm asset module integrations.
*
* Module integrations with the farm_asset module.
*/
/**
* @defgroup farm_asset_hooks Farm asset's hooks
* @{
* Hooks that can be implemented by other modules in order to extend farm_asset.
*/
/**
* Attach Views to asset view pages.
*
* @param FarmAsset $farm_asset
* The farm asset entity.
*
* @return array
* Returns an array of View names to attach to farm asset pages.
*/
function hook_farm_asset_view_views(FarmAsset $farm_asset) {
// If the entity is not a planting, bail.
if ($farm_asset->type != 'planting') {
return array();
}
// Return a list of Views to include on Plantings.
return array(
// Example 1: simple View machine name.
'farm_activity',
// Example 2: explicitly set details like display, argument position,
// and weight.
array(
'name' => 'farm_log_input',
'display' => 'block',
'arg' => 2,
'weight' => 10,
),
);
}
/**
* @}
*/