* @link https://www.tassos.gr * @copyright Copyright © 2024 Tassos All Rights Reserved * @license GNU GPLv3 or later */ defined('_JEXEC') or die('Restricted access'); use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Language\Text; use Joomla\CMS\Factory; extract($displayData); if (defined('nrJ4')) { Factory::getDocument()->addScriptDeclaration(' document.addEventListener("DOMContentLoaded", function() { let proOnlyEl = document.getElementById("proOnlyModal"); proOnlyEl.classList.add("tf-pro-only-modal"); document.body.appendChild(proOnlyEl); const opts = { backdrop: "static", keyboard: false }; let proOnlyModal = new bootstrap.Modal(proOnlyEl, opts); document.addEventListener("click", function(e) { let elem = e.target.closest("[data-pro-only]"); if (!elem) { return; } let proFeature = elem.dataset.proOnly; if (proFeature === undefined) { return; } event.preventDefault(); if (proFeature) { proOnlyEl.querySelectorAll("em").forEach(function(el) { el.innerHTML = proFeature; }); proOnlyEl.querySelector(".po-upgrade").style.display = "none"; proOnlyEl.querySelector(".po-feature").style.display = "block"; } else { proOnlyEl.querySelector(".po-upgrade").style.display = "block"; proOnlyEl.querySelector(".po-feature").style.display = "none"; } proOnlyModal.show(); }); }); '); } else { Factory::getDocument()->addScriptDeclaration(' jQuery(function($) { var $proOnlyModal = $("#proOnlyModal"); // Move to body so it can be accessible by all buttons $proOnlyModal.addClass("tf-pro-only-modal"); $proOnlyModal.appendTo("body"); $(document).on("click", "*[data-pro-only]", function() { event.preventDefault(); var $el = $(this) feature_name = $el.data("pro-only"); if (feature_name) { $proOnlyModal.find("em").html(feature_name); $proOnlyModal.find(".po-upgrade").hide().end().find(".po-feature").show(); } else { $proOnlyModal.find(".po-feature").hide().end().find(".po-upgrade").show(); } $proOnlyModal.modal("show"); }); }); '); } HTMLHelper::stylesheet('plg_system_nrframework/proonlymodal.css', ['relative' => true, 'version' => 'auto']); ?>

Pro