Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions inc/config.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,14 @@ public static function showConfigForm($item)
$config->showFormHeader();

$is_branding_active = Plugin::isPluginActive('branding');
$is_branding_compatible = false;

if ($is_branding_active) {
$branding_info = Plugin::getInfo('branding');
if (isset($branding_info['version']) && version_compare($branding_info['version'], '3.0.0', '>=')) {
$is_branding_compatible = true;
}
}

$options = [];
foreach ($PDF_DEVICES as $option => $value) {
Expand All @@ -163,8 +171,8 @@ public static function showConfigForm($item)
[
'currency_options' => $options,
'selected_currency' => $config->fields['currency'],
'is_branding_active' => $is_branding_active,
'use_branding_logo' => (!empty($config->fields['use_branding_logo']) && $is_branding_active),
'is_branding_active' => $is_branding_active && $is_branding_compatible,
'use_branding_logo' => (!empty($config->fields['use_branding_logo']) && $is_branding_active && $is_branding_compatible),
'add_text' => $config->fields['add_text'],
],
);
Expand Down
2 changes: 1 addition & 1 deletion templates/config.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
{% else %}
<label class="form-switch mt-1" style="padding-left: 1rem;"
data-bs-toggle="tooltip" data-bs-placement="bottom" data-bs-trigger="hover"
title="{{ __('The Branding plugin is disabled or non-existent', 'pdf') }}">
title="{{ __('The Branding plugin is either disabled, missing, or its version is below 3.0.0.', 'pdf') }}">
<input type="checkbox" class="form-check-input ms-0 me-1 mt-0" disabled />
</label>
{% endif %}
Expand Down