You are here

function asset_base_form in Asset 7

Base form builder.

2 calls to asset_base_form()
AssetInlineEntityFormController::entityForm in includes/asset.inline_entity_form.inc
Returns the entity form to be shown through the IEF widget.
assets_wysiwyg_form in includes/asset.admin.inc
Page callback for wysiwyg form.
3 string references to 'asset_base_form'
AssetsUIController::hook_forms in includes/asset.controllers.inc
Provides definitions for implementing hook_forms().
assets_override_form in includes/asset.admin.inc
Page callback for asset override form in wysiwyg.
assets_wysiwyg_form in includes/asset.admin.inc
Page callback for wysiwyg form.

File

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

Code

function asset_base_form($form, &$form_state, $asset, $op = 'edit') {
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => t('Title'),
    '#required' => TRUE,
    '#default_value' => $asset->title,
    '#maxlength' => 255,
    '#weight' => -5,
    '#description' => t('Title of asset'),
  );
  field_attach_form('asset', $asset, $form, $form_state);
  $form['#submit'] = array(
    'asset_base_form_submit',
  );
  unset($form['#validate']);
  $form['actions'] = array(
    '#type' => 'actions',
  );
  $form['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save'),
    '#weight' => 5,
  );
  if (!empty($asset->aid) && asset_delete_access($asset->type)) {
    $form['actions']['delete'] = array(
      '#type' => 'submit',
      '#value' => t('Delete'),
      '#weight' => 15,
      '#submit' => array(
        'asset_base_form_submit_delete',
      ),
    );
  }
  return $form;
}