From e51aa878cba8a05cead23594d2bb45ff4cf91a7d Mon Sep 17 00:00:00 2001 From: Nate Date: Tue, 10 Sep 2019 12:08:54 -0600 Subject: [PATCH] Contacts: Fix QR code. --- app/contacts/contact_edit.php | 70 +++++++++++++++++------------------ 1 file changed, 34 insertions(+), 36 deletions(-) diff --git a/app/contacts/contact_edit.php b/app/contacts/contact_edit.php index 550cb72fac..5d7e89b921 100644 --- a/app/contacts/contact_edit.php +++ b/app/contacts/contact_edit.php @@ -267,17 +267,23 @@ $document['title'] = $text['title-contact-add']; } -//set the mode - if (isset($_SESSION['theme']['qr_image']['text'])) { - if (strlen($_SESSION['theme']['qr_image']['text']) == 0) { - $mode = '4'; - } - else { - $mode = '0'; - } +//determine qr branding + if ($_SESSION['theme']['qr_brand_type']['text'] == 'image' && $_SESSION['theme']['qr_brand_image']['text'] != '') { + echo ""; + $qr_option = "image: $('#img-buffer')[0],"; + $qr_mode = '4'; + $qr_size = '0.2'; + } + else if ($_SESSION['theme']['qr_brand_type']['text'] == 'text' && $_SESSION['theme']['qr_brand_text']['text'] != '') { + $qr_option = 'label: "'.$_SESSION['theme']['qr_brand_text']['text'].'"'; + $qr_mode = '2'; + $qr_size = '0.05'; } else { - $mode = '4'; + echo ""; + $qr_option = "image: $('#img-buffer')[0],"; + $qr_mode = '4'; + $qr_size = '0.2'; } //qr code generation @@ -289,10 +295,10 @@ echo " #qr_code_container {"; echo " z-index: 999999; "; echo " position: absolute; "; - echo " left: 0px; "; - echo " top: 0px; "; - echo " right: 0px; "; - echo " bottom: 0px; "; + echo " left: 0; "; + echo " top: 0; "; + echo " right: 0; "; + echo " bottom: 0; "; echo " text-align: center; "; echo " vertical-align: middle;"; echo " }"; @@ -308,32 +314,24 @@ echo ""; echo ""; - if (isset($_SESSION['theme']['qr_image'])) { - echo ""; - } - else { - echo ""; - } //show the content echo "
\n";