You are here

function farm_log_asset_action in farmOS 7

Action function for farm_log_asset_action.

Sends the user to a new log form with the selected assets referenced.

Parameters

array $assets: An array of asset entities.

array $context: Array with parameters for this action.

File

modules/farm/farm_log/farm_log.module, line 166
Code for the Farm Log feature.

Code

function farm_log_asset_action(array $assets, $context = array()) {

  // Redirect to the log creation form for the selected type, with the asset
  // IDs passed as query parameters.
  $options = array(
    'query' => array(
      'farm_asset' => array_keys($assets),
    ),
  );
  drupal_goto('log/add/' . $context['log_type'], $options);
}