@@ -35,19 +35,25 @@ require('./header.inc.phtml'); ?>
35
35
<? } ?>
36
36
<? if ($ error != 'NOT_FOUND ' ) { ?>
37
37
<form method="POST" action="?id=<?= $ packet_id?> ">
38
- <div class="form-group">
39
- <label class="font-weight-bold">Flags:</label>
40
- <div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="deprecated" name="deprecated" value="1"<?= ($ this ->getContext ()->deprecated ?' checked="checked" ' :'' )?> tabindex="6"/><label class="custom-control-label" for="deprecated">Deprecated</label></div>
41
- <div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="research" name="research" value="1"<?= ($ this ->getContext ()->research ?' checked="checked" ' :'' )?> tabindex="7"/> <label class="custom-control-label" for="research">In Research</label></div>
42
- <div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="published" name="published" value="1"<?= ($ this ->getContext ()->published ?' checked="checked" ' :'' )?> tabindex="8"/> <label class="custom-control-label" for="published">Published</label></div>
43
- </div>
44
- <div class="form-group">
45
- <label class="font-weight-bold" for="id">Id:</label>
46
- <input class="bg-dark border border-primary form-control text-light" type="text" name="id" id="id" placeholder="Enter the decimal (base-10) formatted id here" tabindex="1" required autofocus="autofocus" value="<?= $ id?> "/>
47
- </div>
48
- <div class="form-group">
49
- <label class="font-weight-bold" for="name">Name:</label>
50
- <input class="bg-dark border border-primary form-control text-light" type="text" name="name" id="name" tabindex="2" required value="<?= $ packet_name?> "/>
38
+ <div class="row">
39
+ <div class="col-md-3">
40
+ <div class="form-group">
41
+ <label class="font-weight-bold" for="id">Id:</label>
42
+ <input class="bg-dark border border-primary form-control text-light" type="text" name="id" id="id" placeholder="Enter the message id here" tabindex="1" required autofocus="autofocus" value="<?= $ id?> "/>
43
+ </div>
44
+ </div><div class="col-md-6">
45
+ <div class="form-group">
46
+ <label class="font-weight-bold" for="name">Name:</label>
47
+ <input class="bg-dark border border-primary form-control text-light" type="text" name="name" id="name" placeholder="Enter the message name here" tabindex="2" required value="<?= $ packet_name?> "/>
48
+ </div>
49
+ </div><div class="col-md-3">
50
+ <div class="form-group">
51
+ <label class="font-weight-bold">Options:</label>
52
+ <div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="deprecated" name="deprecated" value="1"<?= ($ this ->getContext ()->deprecated ?' checked="checked" ' :'' )?> tabindex="6"/><label class="custom-control-label text-danger" for="deprecated">Deprecated</label></div>
53
+ <div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="research" name="research" value="1"<?= ($ this ->getContext ()->research ?' checked="checked" ' :'' )?> tabindex="7"/> <label class="custom-control-label text-warning" for="research">In Research</label></div>
54
+ <div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="published" name="published" value="1"<?= ($ this ->getContext ()->published ?' checked="checked" ' :'' )?> tabindex="8"/> <label class="custom-control-label text-success" for="published">Published</label></div>
55
+ </div>
56
+ </div>
51
57
</div>
52
58
<div class="form-group">
53
59
<label class="font-weight-bold" for="format">Format:</label>
@@ -59,20 +65,17 @@ require('./header.inc.phtml'); ?>
59
65
<thead></thead><tbody>
60
66
<? function add_product_checkbox ($ id , $ name , $ checked )
61
67
{
62
- printf ( ' <td><div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="used_by_%s" name="used_by[]" value="%s"%s/><label class="custom-control-label" for="used_by_%s">%s</label></td> ' , $ id , $ id , ( $ checked ? ' checked="checked" ' : '' ), $ id , $ name ) ;
68
+ ;
63
69
}
64
70
$ product_ubound = count ($ products );
65
71
for ($ product_i = 0 ; $ product_i < $ product_ubound ; ++$ product_i )
66
72
{
67
- echo '<tr> ' ;
73
+ if ( $ product_i % 2 === 0 ) echo '<tr> ' ;
68
74
$ p = $ products [$ product_i ];
69
- add_product_checkbox ($ p ->getBnetProductId (), $ p ->getLabel (), in_array ($ p , $ packet_used_by ));
70
- if ($ product_i + 1 < $ product_ubound )
71
- {
72
- $ p = $ products [++$ product_i ];
73
- add_product_checkbox ($ p ->getBnetProductId (), $ p ->getLabel (), in_array ($ p , $ packet_used_by ));
74
- }
75
- echo '</tr> ' ;
75
+ $ p_id = $ p ->getBnetProductId ();
76
+ $ p_label = $ p ->getLabel ();
77
+ printf ('<td><div class="custom-control custom-switch"><input class="custom-control-input" type="checkbox" id="used_by_%s" name="used_by[]" value="%s"%s/><label class="custom-control-label" for="used_by_%s">%s</label></div></td> ' , $ p_id , $ p_id , (in_array ($ p , $ packet_used_by ) ? ' checked="checked" ' : '' ), $ p_id , $ p_label );
78
+ if ($ product_i % 2 === 1 ) echo '</tr> ' ;
76
79
} ?>
77
80
</tbody>
78
81
</table>
0 commit comments