From e0a5252a877c1ef3bd88465770be34e93e157382 Mon Sep 17 00:00:00 2001 From: Nate Date: Wed, 8 Jan 2020 10:34:26 -0700 Subject: [PATCH] Button Class: Apply margin* styles only to anchor tag (when present). --- resources/classes/button.php | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/resources/classes/button.php b/resources/classes/button.php index f1e401a25a..d7c73aedb8 100644 --- a/resources/classes/button.php +++ b/resources/classes/button.php @@ -32,6 +32,18 @@ if (!class_exists('button')) { static function create($array) { $button_icons = $_SESSION['theme']['button_icons']['text'] != '' ? $_SESSION['theme']['button_icons']['text'] : 'auto'; + //parse styles into array + if ($array['style']) { + $tmp = explode(';',$array['style']); + foreach ($tmp as $style) { + if ($style) { + $style = explode(':', $style); + $styles[trim($style[0])] = trim($style[1]); + } + } + $array['style'] = $styles; + unset($styles); + } //button: open $button = "