From ef599cb21904ca40892e94e045af9969a4547d26 Mon Sep 17 00:00:00 2001 From: ralf Date: Tue, 23 Aug 2022 11:12:10 +0200 Subject: [PATCH] drop all size attributes (except SL size: small, large, medium), as it messes up too much you can always set a width manually, if you don't want flex to share the width equally between input fields Also removed automatic conversation of image to name attribute for new et2-button-icon, so our image setter can switch between our own icons and the SL icon library --- admin/templates/default/mailaccount.xet | 3 ++- api/etemplate.php | 17 ++++------------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/admin/templates/default/mailaccount.xet b/admin/templates/default/mailaccount.xet index b44a5837b6..90e23b94a5 100644 --- a/admin/templates/default/mailaccount.xet +++ b/admin/templates/default/mailaccount.xet @@ -22,7 +22,8 @@ - + diff --git a/api/etemplate.php b/api/etemplate.php index bad00a74ac..b11197d324 100644 --- a/api/etemplate.php +++ b/api/etemplate.php @@ -324,17 +324,10 @@ function send_template() unset($attrs['novalidation']); $attrs['noValidation'] = 'true'; } - // replace not set background_image attribute with et2-image tag, if not in NM / lists - if (!empty($attrs['image']) && (empty($attrs['background_image']) || $attrs['background_image'] === 'false') && - !preg_match('/^(index|list)/', $name)) + // replace not set background_image attribute with et2-button-icon tag, if not in NM / lists + if (!empty($attrs['image']) && (empty($attrs['background_image']) || $attrs['background_image'] === 'false')) { $tag = 'et2-button-icon'; - if (!isset($attrs['name'])) - { - $attrs['name'] = $attrs['image']; - unset($attrs['image']); - $attrs['library'] = 'egw'; - } } unset($attrs['background_image']); return "<$tag " . stringAttrs($attrs) . '>'; @@ -390,11 +383,9 @@ function send_template() unset($attrs['class']); } - // Change size=# attribute to width, size is small|medium|large with Shoelace - // Do not drop size if we're setting shoelace size format in the template - if (isset($attrs['size']) && !preg_match('/small|medium|large/',$attrs['size'])) + // Drop all (old) size attributes, if it's not shoelace size format: small, medium or large + if (isset($attrs['size']) && !in_array($attrs['size'], ['small', 'medium', 'large'])) { - $attrs['width'] = (int)$attrs['size'].'em'; unset($attrs['size']); }