Browse Source

Hide QR-Code button if PHP-GD is not installed

Keep it as an optional dependency.
pull/5584/head 1.3-beta
Aleksander Machniak 9 years ago
parent
commit
9d6aa00a44
  1. 3
      program/steps/addressbook/show.inc
  2. 2
      skins/classic/templates/contact.html
  3. 2
      skins/larry/templates/contact.html

3
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',

2
skins/classic/templates/contact.html

@ -21,7 +21,9 @@
</div>
<p>
<roundcube:button command="edit" type="input" class="button" label="editcontact" condition="!ENV:readonly" />
<roundcube:if condition="env:qrcode" />
<roundcube:button command="qrcode" type="input" class="button" label="qrcode" />
<roundcube:endif />
</p>
</div>
<script type="text/javascript">rcube_init_tabs('contacttabs')</script>

2
skins/larry/templates/contact.html

@ -25,7 +25,9 @@
<div id="headerbuttons" class="formbuttons">
<roundcube:button command="edit" type="input" class="button mainaction" label="editcontact" condition="!ENV:readonly" />
<roundcube:if condition="env:qrcode" />
<roundcube:button command="qrcode" type="input" class="button" label="qrcode" />
<roundcube:endif />
</div>
<roundcube:include file="/includes/footer.html" />

Loading…
Cancel
Save