示例#1
0
function delete_form($pDB, $smarty, $module_name, $local_templates_dir, $formCampos, $oForm)
{
    if (!isset($_POST['id_formulario']) || !is_numeric($_POST['id_formulario'])) {
        return false;
    }
    $oDataForm = new paloSantoDataForm($pDB);
    if ($oDataForm->delete_form($_POST['id_formulario'])) {
        if ($oDataForm->errMsg != "") {
            $smarty->assign("mb_title", _tr('Validation Error'));
            $smarty->assign("mb_message", $oDataForm->errMsg);
        } else {
            header("Location: ?menu={$module_name}");
        }
    } else {
        $msg_error = $oDataForm->errMsg != "" ? "<br>" . $oDataForm->errMsg : "";
        $smarty->assign("mb_title", _tr('Delete Error'));
        $smarty->assign("mb_message", _tr('Error when deleting the Form') . $msg_error);
    }
    $sContenido = view_form($pDB, $smarty, $module_name, $local_templates_dir, $formCampos, $oForm);
    return $sContenido;
}