function formdefaults_import in Form Defaults 7
Same name and namespace in other branches
- 5.3 formdefaults.admin.inc \formdefaults_import()
- 6.2 formdefaults.admin.inc \formdefaults_import()
1 string reference to 'formdefaults_import'
- formdefaults_menu in ./
formdefaults.module - Implements hook_menu.
File
- ./
formdefaults.admin.inc, line 180 - formdefaults.admin.inc Include for formdefaults administration screen.
Code
function formdefaults_import() {
$form_list = formdefaults_data();
$data = '';
if ($form_list) {
$data = base64_encode(serialize($form_list));
}
$form['data'] = array(
'#type' => 'textarea',
'#title' => 'Data',
'#default_value' => $data,
'#rows' => 20,
'#cols' => 80,
);
$form['list'] = array(
'#type' => 'fieldset',
'#title' => 'Forms',
);
if ($form_list) {
foreach ($form_list as $key => $formdata) {
$form['list'][] = array(
'#type' => 'markup',
'#markup' => "<p>{$key}</p>",
);
}
}
$form['validate'] = array(
'#type' => 'submit',
'#value' => 'Preview',
);
if ($data) {
$form['import'] = array(
'#type' => 'submit',
'#value' => 'Import',
);
}
return $form;
}