You are here

function forena_create_trans_form in Forena Reports 6.2

Same name and namespace in other branches
  1. 8 forena_ui/forena.admin.inc \forena_create_trans_form()
  2. 7.5 forena.admin.inc \forena_create_trans_form()
  3. 7.2 forena.admin.inc \forena_create_trans_form()
  4. 7.3 forena.admin.inc \forena_create_trans_form()
  5. 7.4 forena.admin.inc \forena_create_trans_form()
1 string reference to 'forena_create_trans_form'
forena_menu in ./forena.module
Implementation of hook_menu.

File

./forena.admin.inc, line 898

Code

function forena_create_trans_form(&$form_state, $report_name) {
  $name = '';
  $filename = '';
  $format = '';
  $desc = forena_report_desc($report_name);
  $name = $desc['name'];
  $filename = $desc['filename'];
  $base_name = $desc['base_name'];
  $format = @$desc['format'];
  $form = array();
  global $language;
  $languages = language_list();

  //determine if this is an add new report request
  $r = forena_get_report_editor($name);
  $title = (string) $r->title;
  $lang = @$_GET['new_language'];
  $form['base_name'] = array(
    '#type' => 'value',
    '#value' => $base_name,
  );
  $form['report_name'] = array(
    '#type' => 'value',
    '#value' => $name,
  );
  foreach ($languages as $key => $obj) {
    $languages[$key] = $obj->native;
  }
  $form['report_lang'] = array(
    '#type' => 'value',
    '#value' => $lang,
  );
  $def_lang = $lang ? $lang : 'en';
  $form['save_report_language'] = array(
    '#type' => 'select',
    '#title' => t('Language'),
    '#options' => $languages,
    '#default_value' => $def_lang,
  );
  $form['title'] = array(
    '#type' => 'textfield',
    '#title' => t('Title'),
    '#default_value' => $title,
    '#required' => true,
  );
  $form['save'] = array(
    '#type' => 'submit',
    '#value' => 'Create',
  );
  return $form;
}