0) { foreach (array_keys($settings_graphs) as $setting) { db_execute("replace into settings_graphs (user_id,name,value) values (" . $_SESSION["sess_user_id"]. ",'$setting', '" . $_POST[$setting] . "')"); } } /* reset local settings cache so the user sees the new settings */ session_unregister("sess_graph_config_array"); header ("Location: " . $_POST["referer"]); } /* -------------------------- Graph Settings Functions -------------------------- */ function settings() { global $colors, $tabs_graphs, $settings_graphs, $current_user, $graph_views; print "
\n"; start_box("", "98%", $colors["header"], "3", "center", ""); if (sizeof($tabs_graphs) > 0) { foreach (array_keys($tabs_graphs) as $tab_short_name) { ?> "> [user: ] 0) { foreach (array_keys($settings_graphs) as $setting) { /* make sure to skip group members here; only parents are allowed */ if (($settings_graphs[$setting]["method"] != "internal") && ($settings_graphs[$setting]["tab"] == $tab_short_name)) { ++$i; form_alternate_row_color($colors["form_alternate1"],$colors["form_alternate2"],$i); /* draw the acual header and textbox on the form */ form_item_label($settings_graphs[$setting]["friendly_name"],$settings_graphs[$setting]["description"]); $current_value = db_fetch_cell("select value from settings_graphs where name='$setting' and user_id=" . $_SESSION["sess_user_id"]); /* choose what kind of item this is */ switch ($settings_graphs[$setting]["method"]) { case 'textbox': form_text_box($setting,$current_value,$settings_graphs[$setting]["default"],""); break; case 'drop_sql': form_dropdown($setting,db_fetch_assoc($settings_graphs[$setting]["sql"]),"name","id",$current_value,"",$settings_graphs[$setting]["default"]); break; case 'drop_array': form_dropdown($setting,${$settings_graphs[$setting]["array_name"]},"","",$current_value,"",$settings_graphs[$setting]["default"]); break; } print "\n"; } } } } } end_box(); form_hidden_box("referer",$_SERVER["HTTP_REFERER"],""); form_hidden_box("save_component_graph_config","1",""); form_save_button("graph_settings.php"); } ?>