0) { foreach ($tree_items as $item) { db_execute("update graph_tree_items set sort_children_type = '" . $_POST["sort_children_type"] . "' where id = '" . $item["id"] . "'"); if ($_POST["sort_children_type"] != TREE_ORDERING_NONE) { sort_branch($item["id"], $_POST["sort_children_type"]); } } } } }else{ raise_message(2); } } if (is_error_message()) { header("Location: tree.php?action=item_edit&tree_item_id=" . (empty($tree_item_id) ? $_POST["id"] : $tree_item_id) . "&tree_id=" . $_POST["graph_tree_id"] . "&parent_id=" . $_POST["parent_item_id"]); }else{ header("Location: tree.php?action=edit&id=" . $_POST["graph_tree_id"]); } } } /* ----------------------- Tree Item Functions ----------------------- */ function item_edit() { global $colors; $tree_item_types = array( 1 => "Header", 2 => "Graph", 3 => "Host" ); $host_group_types = array( 1 => "Graph Template", 2 => "Data Query Index" ); $item_sort_types = array( 1 => "Manual Ordering (No Sorting)", 2 => "Alphabetic Ordering", 3 => "Numeric Ordering" ); if (!empty($_GET["id"])) { $tree_item = db_fetch_row("select * from graph_tree_items where id=" . $_GET["id"]); if ($tree_item["local_graph_id"] > 0) { $db_type = 2; } if ($tree_item["title"] != "") { $db_type = 1; } if ($tree_item["host_id"] > 0) { $db_type = 3; } } if (isset($_GET["type_select"])) { $current_type = $_GET["type_select"]; }elseif (isset($db_type)) { $current_type = $db_type; }else{ $current_type = "1"; } start_box("Tree Items", "98%", $colors["header"], "3", "center", ""); print "