You are here

function forena_report_delete_form in Forena Reports 7.4

Same name and namespace in other branches
  1. 8 forena.report.inc \forena_report_delete_form()
  2. 7.5 forena.report.inc \forena_report_delete_form()

Form to confirm the delete of a form.

Parameters

$form_state:

Return value

unknown_type

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

File

./forena.report.inc, line 182

Code

function forena_report_delete_form($form_state, $formid, $report_name) {

  // Parse names from url
  $name_in = $report_name;
  $desc = Frx::Menu()
    ->parseURL($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('Remove custom reports 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 remove %title?', array(
    '%title' => $report_name,
  )), isset($_GET['destination']) ? $_GET['destination'] : $link, t('This action cannot be undone.'), t('Remove'), t('Cancel'));
  return $form;
}