From 78422c3a67a1dcd9ccb6585da5a0c951ccfa1d21 Mon Sep 17 00:00:00 2001 From: FrankReisenhofer <37330222+FrankReisenhofer@users.noreply.github.com> Date: Mon, 26 Feb 2024 14:35:22 +0100 Subject: [PATCH 1/3] Update pdfviewer.php --- content_plugin/pdfviewer.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/content_plugin/pdfviewer.php b/content_plugin/pdfviewer.php index cc3602f..bdc86eb 100644 --- a/content_plugin/pdfviewer.php +++ b/content_plugin/pdfviewer.php @@ -5,6 +5,7 @@ use Joomla\CMS\Factory; use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Version; +use Joomla\CMS\Plugin\CMSPlugin; /** @@ -12,7 +13,7 @@ * This uses the {pdfviewer} syntax * Licensed under the GNU General Public License version 2 or later; see LICENSE.txt */ -class PlgContentpdfviewer extends JPlugin +class PlgContentpdfviewer extends CMSPlugin { protected static $modules = array(); From 9e89872b814474391633c133b7fe83f495bd8a21 Mon Sep 17 00:00:00 2001 From: FrankReisenhofer <37330222+FrankReisenhofer@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:03:51 +0100 Subject: [PATCH 2/3] Update pdfviewer.php --- content_plugin/pdfviewer.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/content_plugin/pdfviewer.php b/content_plugin/pdfviewer.php index bdc86eb..1d6167c 100644 --- a/content_plugin/pdfviewer.php +++ b/content_plugin/pdfviewer.php @@ -6,6 +6,7 @@ use Joomla\CMS\HTML\HTMLHelper; use Joomla\CMS\Version; use Joomla\CMS\Plugin\CMSPlugin; +use Joomla\CMS\Uri\Uri; /** @@ -13,6 +14,8 @@ * This uses the {pdfviewer} syntax * Licensed under the GNU General Public License version 2 or later; see LICENSE.txt */ +// class PlgContentpdfviewer extends JPlugin + class PlgContentpdfviewer extends CMSPlugin { protected static $modules = array(); @@ -288,7 +291,7 @@ public function onContentPrepare($context, &$article, &$params, $page = 0) $path= JPATH_ROOT . '/administrator/components/com_jdownloads'; if (file_exists( $path )) { $jdownloadsid = trim($tagparameters['jdownloadsid']); - $filelink = JUri::base().'index.php?option=com_jdownloads&task=download.send&id='. $jdownloadsid ; + $filelink = Uri::base().'index.php?option=com_jdownloads&task=download.send&id='. $jdownloadsid ; } else { $showpdfpreview ='no'; $output = "jdownloads is not installed (anymore)"; @@ -345,18 +348,18 @@ function CreatePdfviewer($filelink,$pagereference,$pdfjsviewsettings,$height,$wi // set Path to pdfjs viewer.html file and check if there is an override //Set default path - $Path_pdfjs = JUri::base().'plugins/content/pdfviewer/assets/pdfjs/web/viewer.html' ; + $Path_pdfjs = Uri::base().'plugins/content/pdfviewer/assets/pdfjs/web/viewer.html' ; // Get active template path from Joomla: - $app = JFactory::getApplication(); - $path = JURI::base(true).'templates/'.$app->getTemplate().'/'; + $app = Factory::getApplication(); + $path = URI::base(true).'templates/'.$app->getTemplate().'/'; // determine override patch $pdfjs_override = JPATH_ROOT .'/templates/'.$app->getTemplate(). '/html/plg_content_pdfviewer/assets/pdfjs/web/viewer.html'; //Check for override if (file_exists($pdfjs_override)) { - $Path_pdfjs = JUri::base().'templates/'.$app->getTemplate(). '/html/plg_content_pdfviewer/assets/pdfjs/web/viewer.html'; + $Path_pdfjs = Uri::base().'templates/'.$app->getTemplate(). '/html/plg_content_pdfviewer/assets/pdfjs/web/viewer.html'; } @@ -434,7 +437,7 @@ function Createpdfimage($file_id,$pagenumber,$height,$width,$style,$linktext) { $files_uploaddir = $jdownloads_params->get( 'files_uploaddir' ); // get categorie path - $db = JFactory::getDbo(); + $db = Factory::getDbo(); $db->setQuery("WITH RECURSIVE n AS ( SELECT id, parent_id, concat('/', title ,'/') AS path FROM #__jdownloads_categories @@ -549,7 +552,3 @@ function Createpdfimage($file_id,$pagenumber,$height,$width,$style,$linktext) { } - - - - From fb93f93b1b48955a6a6bd412e48d27ae19307e73 Mon Sep 17 00:00:00 2001 From: FrankReisenhofer <37330222+FrankReisenhofer@users.noreply.github.com> Date: Mon, 26 Feb 2024 15:06:49 +0100 Subject: [PATCH 3/3] Update pdfviewer.php --- content_plugin/pdfviewer.php | 1 - 1 file changed, 1 deletion(-) diff --git a/content_plugin/pdfviewer.php b/content_plugin/pdfviewer.php index 1d6167c..a764816 100644 --- a/content_plugin/pdfviewer.php +++ b/content_plugin/pdfviewer.php @@ -14,7 +14,6 @@ * This uses the {pdfviewer} syntax * Licensed under the GNU General Public License version 2 or later; see LICENSE.txt */ -// class PlgContentpdfviewer extends JPlugin class PlgContentpdfviewer extends CMSPlugin {