fix modulebuilder boxes showboxes

This commit is contained in:
Florian HENRY 2021-03-10 11:56:44 +01:00
parent 9a13ebfdb8
commit ccf71cd980
2 changed files with 4 additions and 2 deletions

View File

@ -1076,7 +1076,7 @@ class FormOther
{ {
if (empty($user->conf->$confuserzone) || $box->fk_user == $user->id) $boxidactivatedforuser[$box->id] = $box->id; // We keep only boxes to show for user if (empty($user->conf->$confuserzone) || $box->fk_user == $user->id) $boxidactivatedforuser[$box->id] = $box->id; // We keep only boxes to show for user
} }
//var_dump($boxidactivatedforuser);
// Define selectboxlist // Define selectboxlist
$arrayboxtoactivatelabel = array(); $arrayboxtoactivatelabel = array();
if (!empty($user->conf->$confuserzone)) if (!empty($user->conf->$confuserzone))
@ -1209,6 +1209,7 @@ class FormOther
if (!empty($conf->global->MAIN_BOXES_MAXLINES)) $box_max_lines = $conf->global->MAIN_BOXES_MAXLINES; if (!empty($conf->global->MAIN_BOXES_MAXLINES)) $box_max_lines = $conf->global->MAIN_BOXES_MAXLINES;
$ii = 0; $ii = 0;
foreach ($boxactivated as $key => $box) foreach ($boxactivated as $key => $box)
{ {
if ((!empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue; if ((!empty($user->conf->$confuserzone) && $box->fk_user == 0) || (empty($user->conf->$confuserzone) && $box->fk_user != 0)) continue;
@ -1220,6 +1221,7 @@ class FormOther
//print 'box_order '.$boxactivated[$ii]->box_order.'<br>'; //print 'box_order '.$boxactivated[$ii]->box_order.'<br>';
// Show box // Show box
$box->loadBox($box_max_lines); $box->loadBox($box_max_lines);
//var_dump($key,$box);
$boxlista .= $box->showBox(null, null, 1); $boxlista .= $box->showBox(null, null, 1);
} }
} }

View File

@ -206,6 +206,6 @@ class mymodulewidget1 extends ModeleBoxes
{ {
// You may make your own code here… // You may make your own code here…
// … or use the parent's class function using the provided head and contents templates // … or use the parent's class function using the provided head and contents templates
parent::showBox($this->info_box_head, $this->info_box_contents); return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
} }
} }