Beispiel #1
0
function form_save()
{
    global $export_types, $export_errors;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_post("export_item_id"));
    /* ==================================================== */
    if (isset($_POST["save_component_export"])) {
        $export_errors = 0;
        $xml_data = get_item_xml($_POST["export_type"], $_POST["export_item_id"], (isset($_POST["include_deps"]) ? $_POST["include_deps"] : "") == "" ? false : true);
        if ($_POST["output_format"] == "1") {
            include_once "./include/top_header.php";
            print "<table width='100%' align='center'><tr><td><pre>" . htmlspecialchars($xml_data) . "</pre></td></tr></table>";
            include_once "./include/bottom_footer.php";
        } elseif ($_POST["output_format"] == "2") {
            header("Content-type: application/xml");
            if ($export_errors) {
                echo "WARNING: Export Errors Encountered.  Refresh Browser Window for Details!\n";
            }
            print $xml_data;
        } elseif ($_POST["output_format"] == "3") {
            if ($export_errors) {
                header("Location: templates_export.php");
            } else {
                header("Content-type: application/xml");
                header("Content-Disposition: attachment; filename=cacti_" . $_POST["export_type"] . "_" . strtolower(clean_up_file_name(db_fetch_cell(str_replace("|id|", $_POST["export_item_id"], $export_types[$_POST["export_type"]]["title_sql"])))) . ".xml");
                print $xml_data;
            }
        }
    }
}
Beispiel #2
0
function form_save()
{
    global $export_types, $export_errors;
    /* ================= input validation ================= */
    input_validate_input_number(get_request_var_post('export_item_id'));
    /* ==================================================== */
    if (isset($_POST['save_component_export'])) {
        $export_errors = 0;
        $xml_data = get_item_xml($_POST['export_type'], $_POST['export_item_id'], (isset($_POST['include_deps']) ? $_POST['include_deps'] : '') == '' ? false : true);
        if ($_POST['output_format'] == '1') {
            top_header();
            print "<table width='100%' align='center'><tr><td><pre>" . htmlspecialchars($xml_data) . '</pre></td></tr></table>';
            bottom_footer();
        } elseif ($_POST['output_format'] == '2') {
            header('Content-type: application/xml');
            if ($export_errors) {
                echo "WARNING: Export Errors Encountered.  Refresh Browser Window for Details!\n";
            }
            print $xml_data;
        } elseif ($_POST['output_format'] == '3') {
            if ($export_errors) {
                header('Location: templates_export.php');
            } else {
                header('Content-type: application/xml');
                header('Content-Disposition: attachment; filename=cacti_' . $_POST['export_type'] . '_' . strtolower(clean_up_file_name(db_fetch_cell(str_replace('|id|', $_POST['export_item_id'], $export_types[$_POST['export_type']]['title_sql'])))) . '.xml');
                print $xml_data;
            }
        }
    }
}
Beispiel #3
0
function form_save()
{
    global $export_types;
    if (isset($_POST["save_component_export"])) {
        $xml_data = get_item_xml($_POST["export_type"], $_POST["export_item_id"], (isset($_POST["include_deps"]) ? $_POST["include_deps"] : "") == "" ? false : true);
        if ($_POST["output_format"] == "1") {
            include_once "./include/top_header.php";
            print "<table width='98%' align='center'><tr><td><pre>" . htmlspecialchars($xml_data) . "</pre></td></tr></table>";
            include_once "./include/bottom_footer.php";
        } elseif ($_POST["output_format"] == "2") {
            header("Content-type: application/xml");
            print $xml_data;
        } elseif ($_POST["output_format"] == "3") {
            header("Content-type: application/xml");
            header("Content-Disposition: attachment; filename=cacti_" . $_POST["export_type"] . "_" . strtolower(clean_up_name(db_fetch_cell(str_replace("|id|", $_POST["export_item_id"], $export_types[$_POST["export_type"]]["title_sql"])))) . ".xml");
            print $xml_data;
        }
    }
}
Beispiel #4
0
function form_save() {
	global $export_types;

	if (isset($_POST["save_component_export"])) {
		$xml_data = get_item_xml($_POST["export_type"], $_POST["export_item_id"], (((isset($_POST["include_deps"]) ? $_POST["include_deps"] : "") == "") ? false : true));

		if (get_request_var_post("output_format") == "1") {
			include_once(CACTI_BASE_PATH . "/include/top_header.php");
			print "<table class='wp100 center'><tr><td><pre>" . htmlspecialchars($xml_data) . "</pre></td></tr></table>";
			include_once(CACTI_BASE_PATH . "/include/bottom_footer.php");
		}elseif (get_request_var_post("output_format") == "2") {
			header("Content-type: application/xml");
			print $xml_data;
		}elseif (get_request_var_post("output_format") == "3") {
			header("Content-type: application/xml");
			header("Content-Disposition: attachment; filename=cacti_" . $_POST["export_type"] . "_" . strtolower(clean_up_file_name(db_fetch_cell(str_replace("|id|", $_POST["export_item_id"], $export_types{$_POST["export_type"]}["title_sql"])))) . ".xml");
			print $xml_data;
		}
	}
}