function forena_create_trans_form in Forena Reports 7.2
Same name and namespace in other branches
- 8 forena_ui/forena.admin.inc \forena_create_trans_form()
- 6.2 forena.admin.inc \forena_create_trans_form()
- 7.5 forena.admin.inc \forena_create_trans_form()
- 7.3 forena.admin.inc \forena_create_trans_form()
- 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 933
Code
function forena_create_trans_form($formid, $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['language'];
if ($lang) {
$language = $languages[$lang];
}
$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;
}