You are here

function forena_delete_form in Forena Reports 6.2

Same name and namespace in other branches
  1. 6 forena.admin.inc \forena_delete_form()
  2. 7 forena.admin.inc \forena_delete_form()
  3. 7.2 forena.admin.inc \forena_delete_form()
  4. 7.3 forena.admin.inc \forena_delete_form()

Form to confirm the delete of a form.

Parameters

$form_state:

Return value

unknown_type

1 string reference to 'forena_delete_form'
forena_menu in ./forena.module
Implementation of hook_menu.

File

./forena.admin.inc, line 2171

Code

function forena_delete_form($form_state, $name_in) {

  // Parse names from url
  $report_name = $name_in;
  $desc = forena_report_desc($report_name);
  $report_name = $desc['name'];
  global $language;
  $link = $desc['link'];
  $form['report_name'] = array(
    '#type' => 'value',
    '#value' => $report_name,
  );
  if (module_exists('locale')) {
    $options = array(
      'all' => t('All Languages'),
      'single' => t('Only %lang', array(
        '%lang' => $language->native,
      )),
    );
    $form['delete_all_languages'] = array(
      '#type' => 'radios',
      '#title' => t('Delete report in all languages?'),
      '#options' => $options,
      '#default_value' => 'single',
    );
    $form['base_name'] = array(
      '#type' => 'value',
      '#value' => $desc['base_name'],
    );
  }
  return confirm_form($form, t('Are you sure you want to delete %title?', array(
    '%title' => $report_name,
  )), isset($_GET['destination']) ? $_GET['destination'] : $link, t('This action cannot be undone.'), t('Delete'), t('Cancel'));
  return $form;
}