$query = "SELECT * FROM glpi_plugin_custom_tabs WHERE itemtype = '{$itemtype}'"; $res = $DB->query($query); while ($data = $DB->fetch_array($res)) { $color = $data['color']; $tab = PluginCustomTab::escapeTabName($data['tab']); if ($color != "deleted") { echo "\$('li[role=tab]:has(a[href*={$tab}])').addClass('{$color}');"; } else { echo "\$('li[role=tab]:has(a[href*={$tab}])').remove();"; } } /*** Default Tabs ***/ $query = "SELECT * FROM glpi_plugin_custom_defaulttabs WHERE itemtype = '{$itemtype}'"; $res = $DB->query($query); $data = $DB->fetch_array($res); $default_tab = PluginCustomTab::escapeTabName($data['tab']); echo "}"; $path = dirname(dirname(dirname($_SERVER['REQUEST_URI']))); $login_locale = __("Login"); $JS = <<<JAVASCRIPT starVIP = function() { \$('a[id*=tooltiplink] img').each(function (index) { var tip = \$(this).qtip(); if (tip && "options" in tip) { var ttip_content = tip.options.content.text[0].innerHTML; if (ttip_content && ttip_content.indexOf('VIP') > 0 && ttip_content.indexOf('{$login_locale}') > 0 && \$(this).parent()[0].innerHTML.indexOf('vip.png') == -1) { \$(this).after("<img src='{$path}/plugins/custom/pics/vip.png' alt='VIP' title='VIP' />");