X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetlab%2Fsites%2Fsite_form.php;h=e77d78173200f9efb42b35a1beacb8930c8e3f26;hb=05411893eee11af861e93000f4064d9a6ea23455;hp=bc54821640100ebc4b66e513964583ac9aacc3d3;hpb=178fb63ebac46a5e4a4eeeaf95f30a297029abbc;p=plewww.git diff --git a/planetlab/sites/site_form.php b/planetlab/sites/site_form.php index bc54821..e77d781 100644 --- a/planetlab/sites/site_form.php +++ b/planetlab/sites/site_form.php @@ -180,16 +180,16 @@ function form_check_required ($form, $input) { // if $outline_missing is set, missing required fields are outlined // fields typed as 'password' are displayed differently // expected to be embedded in a table with 2 columns -function form_render_table2 ($form, $input, $outline_missing) { +function form_render_details ($details, $site_form, $input, $outline_missing) { - foreach ($form as $fullname => $item) { + foreach ($site_form as $fullname => $item) { list($objname,$field) = split(":",$fullname); // render the comment field if ( ! empty($item['comment'])) { - $comment=$item['comment']; - print " $comment "; + $details->space(); + $details->tr ($item['comment'] . ":"); } // compute line attributes @@ -201,10 +201,7 @@ function form_render_table2 ($form, $input, $outline_missing) { } // Label part - print ""; - print << \n -EOF; + $left_part = ""; // input part if ($item['type'] == 'boolean') { @@ -221,25 +218,23 @@ EOF; $checkedyes = ""; $checkedno = "checked='checked'"; } - print <<< EOF - + $right_part = << Yes No -\n EOF; } else { $type = ($item['type'] == 'password') ? "password" : "text"; $value = !empty($input[$objname][$field]) ? $input[$objname][$field] : ""; $maxlength = $item['maxlength']; $size = $item['size']; - print << \n +class="form-text $class" /> EOF; } - print "\n"; + $details->th_td($left_part,$right_part); } }