From f38c613dfcfd97b749b2e5322ab5d5c624fb1c08 Mon Sep 17 00:00:00 2001 From: Allon Moritz Date: Thu, 31 Aug 2017 15:19:37 +0200 Subject: [PATCH] Make it joomla 4 compatible --- .../components/com_weblinks/models/forms/weblink.xml | 1 + .../components/com_weblinks/tables/weblink.php | 7 +++++-- .../components/com_weblinks/views/weblinks/view.html.php | 3 +-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/administrator/components/com_weblinks/models/forms/weblink.xml b/src/administrator/components/com_weblinks/models/forms/weblink.xml index 9acd378..2e04707 100644 --- a/src/administrator/components/com_weblinks/models/forms/weblink.xml +++ b/src/administrator/components/com_weblinks/models/forms/weblink.xml @@ -35,6 +35,7 @@ setColumnAlias('published', 'state'); - JTableObserverTags::createObserver($this, array('typeAlias' => 'com_weblinks.weblink')); - JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_weblinks.weblink')); + if (version_compare(JVERSION, '4.0', '<' ) == 1) + { + JTableObserverTags::createObserver($this, array('typeAlias' => 'com_weblinks.weblink')); + JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_weblinks.weblink')); + } } /** diff --git a/src/administrator/components/com_weblinks/views/weblinks/view.html.php b/src/administrator/components/com_weblinks/views/weblinks/view.html.php index a722a91..ed39468 100644 --- a/src/administrator/components/com_weblinks/views/weblinks/view.html.php +++ b/src/administrator/components/com_weblinks/views/weblinks/view.html.php @@ -67,7 +67,7 @@ class WeblinksViewWeblinks extends JViewLegacy $user = JFactory::getUser(); // Get the toolbar object instance - $bar = JToolBar::getInstance('toolbar'); + $bar = JToolbar::getInstance('toolbar'); JToolbarHelper::title(JText::_('COM_WEBLINKS_MANAGER_WEBLINKS'), 'link weblinks'); @@ -103,7 +103,6 @@ class WeblinksViewWeblinks extends JViewLegacy if ($user->authorise('core.create', 'com_weblinks') && $user->authorise('core.edit', 'com_weblinks') && $user->authorise('core.edit.state', 'com_weblinks')) { - JHtml::_('bootstrap.modal', 'collapseModal'); $title = JText::_('JTOOLBAR_BATCH'); // Instantiate a new JLayoutFile instance and render the batch button