You are here

function forena_report_add_parameter_form in Forena Reports 8

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

File

./forena.report.inc, line 1380

Code

function forena_report_add_parameter_form($form, &$form_state, $report_name) {
  $r = Frx::Editor($report_name);

  //drupal_set_title($r->title);
  $form = array();
  $form['report_name'] = array(
    '#type' => 'value',
    '#value' => $report_name,
  );
  $form['parameters'] = array(
    '#tree' => TRUE,
  );
  $form['parameters']['label'] = array(
    '#type' => 'textfield',
    '#title' => t("Label"),
    '#description' => t('The Label to display to the user. '),
  );
  $form['parameters']['id'] = array(
    '#type' => 'forena_machine_name',
    '#title' => t('id'),
    '#required' => TRUE,
    '#description' => t('The machine friendly name of the as used in queries or reports.'),
  );
  $form['add'] = array(
    '#type' => 'submit',
    '#value' => t('Add'),
  );
  $form['cancel'] = array(
    '#type' => 'submit',
    '#value' => t('Cancel'),
    '#submit' => array(
      'forena_update_cancel',
    ),
  );
  return $form;
}