diff --git a/static/sidebar.html b/static/sidebar.html index fe39d002..f51e6443 100644 --- a/static/sidebar.html +++ b/static/sidebar.html @@ -13,10 +13,23 @@

Slaves

<%# Very ugly ejs code to hide the Players button if the playerManager plugin isn`t installed %> - <% adsdf = "none"; masterPlugins.forEach(plug => {if(plug.pluginConfig.name == "playerManager"){ adsdf = "block" }}); %> - + <% + sidebarPluginButtonsHtml = ""; + masterPlugins.forEach(plug => { + if(plug.main + && plug.main.ui + && typeof plug.main.ui.sidebar == "object" + && Array.isArray(plug.main.ui.sidebar)){ + let sidebarEntries = plug.main.ui.sidebar; + sidebarEntries.forEach(button => { + if(button.getHtml && typeof button.getHtml == "function"){ + sidebarPluginButtonsHtml += button.getHtml(); + } + }); + } + }); + %> + <%- sidebarPluginButtonsHtml %>