From 4c6aafc0a5c236509ab6f271d8a72be3ae878bed Mon Sep 17 00:00:00 2001 From: Tazzios <23451105+Tazzios@users.noreply.github.com> Date: Sun, 23 Apr 2023 14:11:21 +0200 Subject: [PATCH 1/3] J4 fixes Fix for #25 and #26 . But breaks the popup in joomla 3. Find out if there is something universal or that i have to do a version check. --- content_plugin/pdfviewer.php | 100 +++++++++++++++++++++++------------ 1 file changed, 65 insertions(+), 35 deletions(-) diff --git a/content_plugin/pdfviewer.php b/content_plugin/pdfviewer.php index ceea75a..c2f81d4 100644 --- a/content_plugin/pdfviewer.php +++ b/content_plugin/pdfviewer.php @@ -3,8 +3,8 @@ defined('_JEXEC') or die; use Joomla\CMS\Factory; -use Joomla\CMS\Categories\CategoryNode; -use Joomla\CMS\Categories\Categories; // needed for retrieving full file pathfor pdfimage +use Joomla\CMS\HTML\HTMLHelper; + /** * Plug-in to enable loading pdf files into content (e.g. articles) @@ -377,9 +377,32 @@ function CreatePdfviewer($filelink,$pagereference,$pagenumber,$pdfjsviewsettings // Popup IF ($style=='popup') { - JHTML::_('behavior.modal'); + $randomId = rand(0, 1000); // important when there are multiple popup pdfs on one page with different settings + + HTMLHelper::_('bootstrap.modal', '.selector', []); - return ''. $linktext .''; + return '
+