You are here

function farm_asset_add in farmOS 7

Add new asset page callback.

Parameters

string $type: The farm asset type.

Return value

array Returns a form array.

1 string reference to 'farm_asset_add'
farm_asset_menu in modules/farm/farm_asset/farm_asset.module
Implements hook_menu().

File

modules/farm/farm_asset/farm_asset.pages.inc, line 57
Farm asset pages.

Code

function farm_asset_add($type) {
  $farm_asset_type = farm_asset_types($type);
  $farm_asset = entity_create('farm_asset', array(
    'type' => $type,
  ));
  drupal_set_title(t('Add @name', array(
    '@name' => entity_label('farm_asset_type', $farm_asset_type),
  )));
  $output = drupal_get_form('farm_asset_form', $farm_asset);
  return $output;
}