function draw_edit_control($field_name, &$field_array) { switch ($field_array["method"]) { case 'textbox': form_text_box($field_name, $field_array["value"], isset($field_array["default"]) ? $field_array["default"] : "", $field_array["max_length"], isset($field_array["size"]) ? $field_array["size"] : "40", "text", isset($field_array["form_id"]) ? $field_array["form_id"] : ""); break; case 'filepath': form_filepath_box($field_name, $field_array["value"], isset($field_array["default"]) ? $field_array["default"] : "", $field_array["max_length"], isset($field_array["size"]) ? $field_array["size"] : "40", "text", isset($field_array["form_id"]) ? $field_array["form_id"] : ""); break; case 'dirpath': form_dirpath_box($field_name, $field_array["value"], isset($field_array["default"]) ? $field_array["default"] : "", $field_array["max_length"], isset($field_array["size"]) ? $field_array["size"] : "40", "text", isset($field_array["form_id"]) ? $field_array["form_id"] : ""); break; case 'textbox_password': form_text_box($field_name, $field_array["value"], isset($field_array["default"]) ? $field_array["default"] : "", $field_array["max_length"], isset($field_array["size"]) ? $field_array["size"] : "40", "password"); print "<br>"; form_text_box($field_name . "_confirm", $field_array["value"], isset($field_array["default"]) ? $field_array["default"] : "", $field_array["max_length"], isset($field_array["size"]) ? $field_array["size"] : "40", "password"); break; case 'textarea': form_text_area($field_name, $field_array["value"], $field_array["textarea_rows"], $field_array["textarea_cols"], isset($field_array["default"]) ? $field_array["default"] : "", isset($field_array["class"]) ? $field_array["class"] : "", isset($field_array["on_change"]) ? $field_array["on_change"] : ""); break; case 'drop_array': form_dropdown($field_name, $field_array["array"], "", "", $field_array["value"], isset($field_array["none_value"]) ? $field_array["none_value"] : "", isset($field_array["default"]) ? $field_array["default"] : "", isset($field_array["class"]) ? $field_array["class"] : "", isset($field_array["on_change"]) ? $field_array["on_change"] : ""); break; case 'drop_sql': form_dropdown($field_name, db_fetch_assoc($field_array["sql"]), "name", "id", $field_array["value"], isset($field_array["none_value"]) ? $field_array["none_value"] : "", isset($field_array["default"]) ? $field_array["default"] : "", isset($field_array["class"]) ? $field_array["class"] : "", isset($field_array["on_change"]) ? $field_array["on_change"] : ""); break; case 'drop_multi': form_multi_dropdown($field_name, $field_array["array"], db_fetch_assoc($field_array["sql"]), "id", isset($field_array["class"]) ? $field_array["class"] : "", isset($field_array["on_change"]) ? $field_array["on_change"] : ""); break; case 'drop_multi_rra': form_multi_dropdown($field_name, array_rekey(db_fetch_assoc("select id,name from rra order by timespan"), "id", "name"), empty($field_array["form_id"]) ? db_fetch_assoc($field_array["sql_all"]) : db_fetch_assoc($field_array["sql"]), "id", isset($field_array["class"]) ? $field_array["class"] : "", isset($field_array["on_change"]) ? $field_array["on_change"] : ""); break; case 'drop_tree': grow_dropdown_tree($field_array["tree_id"], $field_name, $field_array["value"]); break; case 'drop_color': form_color_dropdown($field_name, $field_array["value"], "None", isset($field_array["default"]) ? $field_array["default"] : "", isset($field_array["class"]) ? $field_array["class"] : "", isset($field_array["on_change"]) ? $field_array["on_change"] : ""); break; case 'checkbox': form_checkbox($field_name, $field_array["value"], $field_array["friendly_name"], isset($field_array["default"]) ? $field_array["default"] : "", isset($field_array["form_id"]) ? $field_array["form_id"] : "", isset($field_array["class"]) ? $field_array["class"] : "", isset($field_array["on_change"]) ? $field_array["on_change"] : ""); break; case 'checkbox_group': while (list($check_name, $check_array) = each($field_array["items"])) { form_checkbox($check_name, $check_array["value"], $check_array["friendly_name"], isset($check_array["default"]) ? $check_array["default"] : "", isset($check_array["form_id"]) ? $check_array["form_id"] : "", isset($field_array["class"]) ? $field_array["class"] : "", isset($check_array["on_change"]) ? $check_array["on_change"] : (isset($field_array["on_change"]) ? $field_array["on_change"] : "")); print "<br>"; } break; case 'radio': while (list($radio_index, $radio_array) = each($field_array["items"])) { form_radio_button($field_name, $field_array["value"], $radio_array["radio_value"], $radio_array["radio_caption"], isset($field_array["default"]) ? $field_array["default"] : "", isset($field_array["class"]) ? $field_array["class"] : "", isset($field_array["on_change"]) ? $field_array["on_change"] : ""); print "<br>"; } break; case 'custom': print $field_array["value"]; break; case 'template_checkbox': print "<em>" . html_boolean_friendly($field_array["value"]) . "</em>"; form_hidden_box($field_name, $field_array["value"], ""); break; case 'template_drop_array': print "<em>" . $field_array["array"][$field_array["value"]] . "</em>"; form_hidden_box($field_name, $field_array["value"], ""); break; case 'template_drop_multi_rra': $items = db_fetch_assoc($field_array["sql_print"]); if (sizeof($items) > 0) { foreach ($items as $item) { print htmlspecialchars($item["name"], ENT_QUOTES) . "<br>"; } } break; case 'font': form_font_box($field_name, $field_array["value"], isset($field_array["default"]) ? $field_array["default"] : "", $field_array["max_length"], isset($field_array["size"]) ? $field_array["size"] : "40", "text", isset($field_array["form_id"]) ? $field_array["form_id"] : ""); break; case 'file': form_file($field_name, isset($field_array["size"]) ? $field_array["size"] : "40"); break; default: print "<em>" . htmlspecialchars($field_array["value"], ENT_QUOTES) . "</em>"; form_hidden_box($field_name, $field_array["value"], ""); break; } }
print "<p><strong>" . $form_check_string . $array["friendly_name"] . "</strong>"; if (!empty($array["friendly_name"])) { print ": " . $array["description"]; }else{ print "<strong>" . $array["description"] . "</strong>"; } print "<br>"; switch ($array["method"]) { case 'textbox': form_text_box($name, $current_value, "", "", "40", "text"); break; case 'filepath': form_filepath_box($name, $current_value, "", "", "40", "text"); break; case 'drop_array': form_dropdown($name, $array["array"], "", "", $current_value, "", ""); break; } print "<br></p>"; } $i++; }?> <p><strong><font color="#FF0000">NOTE:</font></strong> Once you click "Finish", all of your settings will be saved and your database will be upgraded if this is an upgrade. You can change any of the settings on this screen at a later