2 require_once './libraries/common.inc.php';
4 require_once './libraries/header_http.inc.php';
5 require_once './libraries/header_meta_style.inc.php';
11 <form action
="enum_editor.php" method
="get">
12 <div id
="enum_editor_no_js">
13 <h3
>Values
for the column
"<?php echo $_GET['field']; ?>"</h3
>
14 <p
>Enter each value in a separate field
.</p
>
17 // Get the new values from the submitted form or the old ones from tbl_alter.php
19 for($i = 1; $i <= $_GET['num_fields']; $i++
) {
20 $input_name = "field" . $i;
21 $values .= $_GET[$input_name] . ',';
23 if (isset($_GET['values'])) {
24 $values = urldecode($_GET['values']);
26 // Display the input fields containing each of the values, removing the empty ones
28 $stripped_values = array();
29 foreach(split(",", $values) as $value) {
30 if(trim($value) != "") {
32 echo '<input type="text" size="30" value=' . $value . ' name="field' . $field_counter . '" />';
33 $stripped_values[] = $value;
36 // If extra fields are added, display them
37 if($_GET['add_extra_fields']) {
38 $extra_fields = $_GET['extra_fields'];
39 $total_fields = $extra_fields +
$field_counter;
40 for($i = ($field_counter+
1); $i <= $total_fields; $i++
) {
41 echo '<input type="text" size="30" name="field' . $i . '"/>';
44 $total_fields = $field_counter;
49 <input type
="checkbox" name
="add_extra_fields"> Add
<input type
="text" value
="1" name
="extra_fields" size
="2"/> more values
51 <input type
="hidden" name
="token" value
="<?php echo $_GET['token']; ?>" />
52 <input type
="hidden" name
="num_fields" value
="<?php echo $total_fields; ?>" />
53 <input type
="hidden" name
="field" value
="<?php echo $_GET['field']; ?>" />
54 <input type
="submit" value
="Go" />
57 <div id
="enum_editor_output">
59 <p
>Copy
and paste the joined values into the
"Length/Values" field
</p
>
60 <textarea id
="joined_values" cols
="95" rows
="5"><?php
echo join(",", $stripped_values); ?
></textarea
>