Added callback to print forms

Former-commit-id: e8f113710158278cb61f494a6c0111e1615ab877
This commit is contained in:
fermin831 2019-02-19 18:23:20 +01:00
parent 2c3357ac64
commit 86d57f2654
1 changed files with 13 additions and 0 deletions

View File

@ -473,6 +473,8 @@ class Wizard
$form = $data['form'];
$inputs = $data['inputs'];
$js = $data['js'];
$cb_function = $data['cb_function'];
$cb_args = $data['cb_args'];
$output = '<form enctype="'.$form['enctype'].'" action="'.$form['action'].'" method="'.$form['method'];
$output .= '" '.$form['extra'].'>';
@ -483,6 +485,17 @@ class Wizard
$output .= $this->printBlock($input, true);
}
try {
if (isset($cb_function) === true) {
call_user_func(
$cb_function,
(isset($cb_args) === true) ? $cb_args : []
);
}
} catch (Exception $e) {
error_log('Error executing wizard callback: ', $e->getMessage());
}
$output .= '</ul>';
$output .= '</form>';
$output .= '<script>'.$js.'</script>';