You are here

function slickgrid_delete_form in Slickgrid 7.2

Delete entities form.

1 call to slickgrid_delete_form()
slickgrid_clone_form in includes/slickgrid.form.inc
Clone entities form.
1 string reference to 'slickgrid_delete_form'
slickgrid_get_form in includes/slickgrid.form.inc
Returns a form to the browser which can then be submitted - avoiding CSRF!

File

includes/slickgrid.form.inc, line 167

Code

function slickgrid_delete_form($form, $form_state, $entity_type, $entity_ids) {
  return array(
    'entity_type' => array(
      '#type' => 'hidden',
      '#value' => $entity_type,
    ),
    'entity_ids' => array(
      '#type' => 'hidden',
      '#value' => $entity_ids,
    ),
    'description_text' => array(
      '#markup' => '<p>' . format_plural(count($entity_ids), t('Do you want to delete the selected row'), t('Do you want to delete the @num selected rows', array(
        '@num' => count($entity_ids),
      ))) . '</p>',
    ),
    'actions' => array(
      'cancel' => array(
        '#type' => 'submit',
        '#value' => t('Cancel'),
        '#ajax' => array(
          // We need an empty callback, as all the logic is handled in the submit
          // function.
          'callback' => 'slickgrid_return_commands_from_form',
        ),
      ),
      'do' => array(
        '#type' => 'submit',
        '#value' => t('Delete'),
        '#ajax' => array(
          'callback' => 'slickgrid_return_commands_from_form',
        ),
      ),
    ),
  );
}