Skip to content

Commit

Permalink
NEW: Disable Download if zip Extension Not Installed
Browse files Browse the repository at this point in the history
 - #25
  • Loading branch information
aljawaid committed Sep 20, 2023
1 parent 20f8c2d commit 8cc374b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Assets/css/kanboard-support.css
Original file line number Diff line number Diff line change
Expand Up @@ -745,6 +745,10 @@ form.add-webhook-form .form-actions button {
color: var(--pp-grey);
}

.config-btns button.config-download-btn:disabled svg {
color: var(--pp-red-alt-2);
}

.config-btns button svg, .config-download-btn svg {
vertical-align: sub;
width: 22px;
Expand Down
6 changes: 6 additions & 0 deletions Template/config_sections/app-info.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,11 +56,17 @@
'plugin' => 'KanboardSupport'), false, '', false) ?>" class="btn config-btn config-btn-red js-modal-confirm" title="<?= t('This file is for reference only') ?>">
<?= $this->helper->supportHelper->embedSVGIcon('raw-icon') ?> <?= t('Default Raw Config File') ?>
</button>
<?php if (extension_loaded('zip')): ?>
<form method="post" action="<?= $this->url->href('TechnicalSupportController', 'backupConfigFiles', array('plugin' => 'KanboardSupport'), true, '', false) ?>">
<button type="submit" class="btn config-download-btn">
<?= $this->helper->supportHelper->embedSVGIcon('zip-icon') ?> <?= t('Download Config Files') ?>
</button>
</form>
<?php else: ?>
<button type="submit" class="btn config-download-btn" title="<?= t('PHP \'zip\' Extension Not Detected. Check the \'PHP Information\' section of this page.') ?>" disabled>
<?= $this->helper->supportHelper->embedSVGIcon('zip-icon') ?> <?= t('Download Config Files') ?>
</button>
<?php endif ?>
</div>
<?php endif ?>
<?= $this->render('KanboardSupport:config_sections/app-sections') ?>
Expand Down

0 comments on commit 8cc374b

Please sign in to comment.