Added callback to print forms

Former-commit-id: 8e95ba3ae518a750d421fcce41238ca7f47b46c2
This commit is contained in:
fermin831 2019-02-19 18:29:59 +01:00
parent 86d57f2654
commit 819910923f
1 changed files with 11 additions and 7 deletions

View File

@ -476,13 +476,11 @@ class Wizard
$cb_function = $data['cb_function'];
$cb_args = $data['cb_args'];
$output = '<form enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
$output .= '" '.$form['extra'].'>';
$output_head = '<form enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
$output_head .= '" '.$form['extra'].'>';
$output .= '<ul class="wizard">';
foreach ($inputs as $input) {
$output .= $this->printBlock($input, true);
if ($return === false) {
echo $output_head;
}
try {
@ -496,6 +494,12 @@ class Wizard
error_log('Error executing wizard callback: ', $e->getMessage());
}
$output = '<ul class="wizard">';
foreach ($inputs as $input) {
$output .= $this->printBlock($input, true);
}
$output .= '</ul>';
$output .= '</form>';
$output .= '<script>'.$js.'</script>';
@ -504,7 +508,7 @@ class Wizard
echo $output;
}
return $output;
return $output_head.$output;
}