$tmpplugin was defined after use

This commit is contained in:
Frédéric FRANCE 2020-05-01 07:50:46 +02:00 committed by GitHub
parent 625c7216a9
commit fddbe7c929
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -6634,11 +6634,11 @@ class Form
// Add code for jquery to use multiselect // Add code for jquery to use multiselect
if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT'))
{ {
$out .= "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->
<script>'."\n";
if ($addjscombo == 1) if ($addjscombo == 1)
{ {
$tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT; $tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
$out .= "\n".'<!-- JS CODE TO ENABLE '.$tmpplugin.' for id '.$htmlname.' -->'."\n";
$out .= '<script>'."\n";
$out .= 'function formatResult(record) {'."\n"; $out .= 'function formatResult(record) {'."\n";
if ($elemtype == 'category') if ($elemtype == 'category')
{ {
@ -6676,6 +6676,8 @@ class Form
// Add other js lib // Add other js lib
// TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin // TODO external lib multiselect/jquery.multi-select.js must have been loaded to use this multiselect plugin
// ... // ...
$out .= "\n".'<!-- JS CODE TO ENABLE external lib for id '.$htmlname.' -->'."\n";
$out .= '<script>'."\n";
$out .= '$(document).ready(function () { $out .= '$(document).ready(function () {
$(\'#'.$htmlname.'\').multiSelect({ $(\'#'.$htmlname.'\').multiSelect({
containerHTML: \'<div class="multi-select-container">\', containerHTML: \'<div class="multi-select-container">\',