Check for context in addition

This fix is made to make Virtualmin/Edit Users/Edit User page, and Other user permissions tab and its multi-selects work. The underlying problem, is that `ui_multi_select_javascript` being called beforehand by `virtual_feature` from `virtualmin-htpasswd::mailbox_inputs`, leaving the actual page without needed JS function, making it fail in all themes. Perhaps, it shouldn't be done by `virtual_feature` and this patch is just a work-around of the actual problem.
This commit is contained in:
Ilia Rostovtsev
2020-05-23 13:51:34 +03:00
parent 9d7d13b4d9
commit f1d7deb307

View File

@ -1013,8 +1013,8 @@ if (!defined($width)) {
$width = "200";
}
my $wstyle = $width ? "style='width:$width'" : "";
if (!$main::ui_multi_select_donejs++) {
my ($caller_package, $caller_file) = caller;
if ($caller_file eq $0 && !$main::ui_multi_select_donejs++) {
$rv .= &ui_multi_select_javascript();
}
$rv .= "<table cellpadding=0 cellspacing=0 class='ui_multi_select'>";