function forena_create_trans_form in Forena Reports 7.5
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.2 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 295
Code
function forena_create_trans_form($formid, $form_state, $report_name) {
$name = '';
$filename = '';
$format = '';
$desc = Frx::Menu()
->parseURL($report_name);
$form = array();
global $language;
$languages = language_list();
//determine if this is an add new report request
$r = Frx::Editor($report_name, FALSE);
$base_name = $r->desc['base_name'];
$title = (string) $r->title;
$lang = @$_GET['target_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;
}