From fa359e2c728135c81f69579f2634824220c00443 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Badet=20Aur=C3=A9lien?= Date: Fri, 18 Nov 2016 23:52:16 +0100 Subject: [PATCH] Check for Bridge's const FORMATS restrictions before adding helperbuttons --- lib/html.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/lib/html.php b/lib/html.php index e329102d..c58228cb 100644 --- a/lib/html.php +++ b/lib/html.php @@ -1,15 +1,29 @@ 0)){ + $bridgeFormats = $bridgeClass::FORMATS;} + else {$bridgeFormats = $formats}; + $getHelperButtonsFormat = function($formats){ $buttons = ''; foreach($formats as $name){ + if(in_array($name , $bridgeFormats){ $buttons .= '' . PHP_EOL; + } } return $buttons; @@ -23,12 +37,6 @@ function displayBridgeCard($bridgeName, $formats, $isActive = true){ EOD; }; - $bridgeElement = Bridge::create($bridgeName); - $bridgeClass = $bridgeName . 'Bridge'; - - if($bridgeElement == false) - return ""; - $name = '' . $bridgeClass::NAME . ''; $description = $bridgeClass::DESCRIPTION;