You are here

function nd_field_delete_form in Node displays 6

Field delete form.

Parameters

string $key The key of the field.:

array $field The field with title and code keys.:

1 string reference to 'nd_field_delete_form'
nd_fields in includes/nd.fields.inc
Fields overview.

File

includes/nd.fields.inc, line 338
Manage fields.

Code

function nd_field_delete_form($form_state, $key, $field) {
  $form = array();
  $action = $field['type'] == ND_FIELD_OVERRIDDEN ? t('reset') : t('delete');
  $form['question'] = array(
    '#type' => 'markup',
    '#value' => '<p>' . t('Are you sure you want to !action the field %field ?', array(
      '!action' => $action,
      '%field' => $field['title'],
    )) . '</p>',
  );
  $form['field'] = array(
    '#type' => 'value',
    '#value' => $key,
  );
  $form['button']['submit'] = array(
    '#prefix' => '<div>',
    '#type' => 'submit',
    '#value' => $field['type'] == ND_FIELD_OVERRIDDEN ? t('Reset') : t('Delete'),
  );
  $form['buttons']['cancel'] = array(
    '#suffix' => '</div>',
    '#type' => 'markup',
    '#value' => l('cancel', 'admin/content/types/nd/fields'),
  );
  return $form;
}