<body> <?php if (POST('insert') && empty($data['data']['id'])) { if ($data['status'] == 'error') { $txt_error = "<div>" . _("The following errors occurred") . ":</div>\n\t\t\t\t\t <div style='padding: 2px 10px 5px 10px;'>" . implode("<br/>", $validation_errors) . "</div>"; $config_nt = array('content' => $txt_error, 'options' => array('type' => 'nf_error', 'cancel_button' => false), 'style' => 'width: 80%; margin: 20px auto; text-align: left;'); $nt = new Notification('nt_1', $config_nt); $nt->show(); Util::make_form("POST", "newportgroupform.php?id={$id}"); die; } $db = new ossim_db(); $conn = $db->connect(); $actives_ports = Port_group::expand_ports($actives_ports); Port_group::update($conn, $id, $pgname, $actives_ports, $descr, $ctx); Util::memcacheFlush(); $db->close(); ?> <script type='text/javascript'> if (!parent.is_lightbox_loaded(window.name)) { document.location.href="portgroup.php?msg=updated"; } else { document.location.href="newportgroupform.php?id=<?php echo $id; ?> &update=1"; }
if (POST('withoutmenu') != "1") { include "../hmenu.php"; $get_param = "portname={$pgname}"; } else { $get_param = "portname={$pgname}&withoutmenu=1"; } if (POST('insert') && !empty($pgname)) { if ($error == true) { $txt_error = "<div>" . _("We Found the following errors") . ":</div><div style='padding:10px;'>" . implode("<br/>", $message_error) . "</div>"; Util::print_error($txt_error); Util::make_form("POST", "newportform.php?" . $get_param); die; } $db = new ossim_db(); $conn = $db->connect(); Port_group::update($conn, $pgname, $actives_ports, $descr); Util::clean_json_cache_files("ports"); $db->close($conn); } if (isset($_SESSION['_portgroup'])) { unset($_SESSION['_portgroup']); } if ($_SESSION["menu_sopc"] == "Ports" && POST('withoutmenu') != "1") { ?> <p> <?php echo gettext("Port group succesfully updated"); ?> </p> <script type='text/javascript'>document.location.href="port.php"</script> <?php } else {