This commit is contained in:
MatteoPistorello 2022-03-09 10:33:58 +01:00
commit 1d61a4042e
1 changed files with 17 additions and 1 deletions

View File

@ -502,12 +502,28 @@ if (Auth::check()) {
</li>'; </li>';
// Tab dei plugin // Tab dei plugin
$plugins = $dbo->fetchArray('SELECT id, title FROM zz_plugins WHERE idmodule_to='.prepare($id_module)." AND position='tab' AND enabled = 1 ORDER BY zz_plugins.order DESC"); $plugins = $dbo->fetchArray('SELECT id, title, options, options2 FROM zz_plugins WHERE idmodule_to='.prepare($id_module)." AND position='tab' AND enabled = 1 ORDER BY zz_plugins.order DESC");
foreach ($plugins as $plugin) { foreach ($plugins as $plugin) {
//Badge count per record plugin
$count = 0;
if (!empty($plugin['options2'])){
$opt = json_decode($plugin['options2'], true);
}else{
$opt = json_decode($plugin['options'], true);
}
if (!empty($opt)){
$q = str_replace('|id_parent|', $id_record, $opt['main_query'][0]['query']);
$count = $dbo->fetchNum($q);
}
echo ' echo '
<li data-toggle="control-sidebar"> <li data-toggle="control-sidebar">
<a data-toggle="tab" href="#tab_'.$plugin['id'].'" id="link-tab_'.$plugin['id'].'"> <a data-toggle="tab" href="#tab_'.$plugin['id'].'" id="link-tab_'.$plugin['id'].'">
'.$plugin['title'].' '.$plugin['title'].'
<span class="badge">'.($count>0 ? $count: '').'</span>
</a> </a>
</li>'; </li>';
} }