You are here

function assets_add in Asset 7

Returns an asset submission form.

1 string reference to 'assets_add'
asset_menu in ./asset.module
Implements hook_menu().

File

includes/asset.admin.inc, line 234
Asset admin page callbacks.

Code

function assets_add($type) {

  // @todo: We need to remove any direct creation of Asset class instances and use entity_create() instead.
  $asset = new Asset(array(
    'type' => $type,
  ));
  $form = entity_ui_get_form('asset', $asset, 'add');

  // Due to dummy  usage of entity->label instead of entity_label() in entity API.
  $label = drupal_strtolower(entity_label('asset', $asset));
  drupal_set_title(t("Add {$label}"), PASS_THROUGH);
  return $form;
}