Skip to content

Commit 39fb8b0

Browse files
committed
Optional configure CHECKBOXARRAY to be inline or one per line, default inline
1 parent dd22c2e commit 39fb8b0

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

interface/lib/classes/tform_base.inc.php

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,13 @@ function getHTML($record, $tab, $action = 'NEW') {
560560
if(trim($tvl) == trim($k)) $checked = ' CHECKED';
561561
}
562562
// $out .= "<label for=\"".$key."[]\" class=\"inlineLabel\"><input name=\"".$key."[]\" id=\"".$key."[]\" value=\"$k\" type=\"checkbox\" $checked /> $v</label>\r\n";
563-
$out .= "<label for=\"".$key.$elementNo."\" class=\"inlineLabel\"><input name=\"".$key."[]\" id=\"".$key.$elementNo."\" value=\"$k\" type=\"checkbox\" $checked /> $v</label><br/>\r\n";
563+
$out .= "<label for=\"".$key.$elementNo."\" class=\"inlineLabel\"><input name=\"".$key."[]\" id=\"".$key.$elementNo."\" value=\"$k\" type=\"checkbox\" $checked /> $v</label>";
564+
if (isset($field['render_inline']) && $field['render_inline'] == 'n') {
565+
$out .= "<br/>\r\n";
566+
}
567+
else {
568+
$out .= "&nbsp;\r\n";
569+
}
564570
$elementNo++;
565571
}
566572
}
@@ -697,7 +703,13 @@ function getHTML($record, $tab, $action = 'NEW') {
697703
if(trim($tvl) == trim($k)) $checked = ' CHECKED';
698704
}
699705
// $out .= "<label for=\"".$key."[]\" class=\"inlineLabel\"><input name=\"".$key."[]\" id=\"".$key."[]\" value=\"$k\" type=\"checkbox\" $checked /> $v</label>\r\n";
700-
$out .= "<label for=\"".$key.$elementNo."\" class=\"inlineLabel\"><input name=\"".$key."[]\" id=\"".$key.$elementNo."\" value=\"$k\" type=\"checkbox\" $checked /> $v</label><br/>\r\n";
706+
$out .= "<label for=\"".$key.$elementNo."\" class=\"inlineLabel\"><input name=\"".$key."[]\" id=\"".$key.$elementNo."\" value=\"$k\" type=\"checkbox\" $checked /> $v</label>";
707+
if (isset($field['render_inline']) && $field['render_inline'] == 'n') {
708+
$out .= "<br/>\r\n";
709+
}
710+
else {
711+
$out .= "&nbsp;\r\n";
712+
}
701713
$elementNo++;
702714
}
703715
}

interface/web/admin/form/remote_user.tform.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@
146146
'separator' => ';',
147147
'width' => '',
148148
'maxlength' => '',
149+
'render_inline' => 'n',
149150
'rows' => '5',
150151
'cols' => '30'
151152
)

0 commit comments

Comments
 (0)