From 9d6aa00a44daebe4491c4777ac7f4a542e610195 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 4 Jan 2017 13:03:27 +0100 Subject: [PATCH] Hide QR-Code button if PHP-GD is not installed Keep it as an optional dependency. --- program/steps/addressbook/show.inc | 3 +++ skins/classic/templates/contact.html | 2 ++ skins/larry/templates/contact.html | 2 ++ 3 files changed, 7 insertions(+) diff --git a/program/steps/addressbook/show.inc b/program/steps/addressbook/show.inc index da8f5bf90..0c5a2d611 100644 --- a/program/steps/addressbook/show.inc +++ b/program/steps/addressbook/show.inc @@ -42,7 +42,10 @@ if ($cid && ($record = ($CONTACT_RECORD ?: $CONTACTS->get_record($cid, true)))) // get address book name (for display) rcmail_set_sourcename($CONTACTS); +// Disable qr-code if php-gd is not installed +$OUTPUT->set_env('qrcode', function_exists('imagecreate')); $OUTPUT->add_label('qrcode'); + $OUTPUT->add_handlers(array( 'contacthead' => 'rcmail_contact_head', 'contactdetails' => 'rcmail_contact_details', diff --git a/skins/classic/templates/contact.html b/skins/classic/templates/contact.html index 2022a2ce0..3835222e1 100644 --- a/skins/classic/templates/contact.html +++ b/skins/classic/templates/contact.html @@ -21,7 +21,9 @@

+ +

diff --git a/skins/larry/templates/contact.html b/skins/larry/templates/contact.html index de42e1a9d..252d83d45 100644 --- a/skins/larry/templates/contact.html +++ b/skins/larry/templates/contact.html @@ -25,7 +25,9 @@
+ +