Make it joomla 4 compatible (#362)

This commit is contained in:
Allon Moritz 2019-08-16 15:52:52 +02:00 committed by George Wilson
parent 20b335d918
commit f7519475f1
3 changed files with 9 additions and 5 deletions

View File

@ -38,6 +38,7 @@
label="JCATEGORY" label="JCATEGORY"
description="COM_WEBLINKS_FIELD_CATEGORY_DESC" description="COM_WEBLINKS_FIELD_CATEGORY_DESC"
extension="com_weblinks" extension="com_weblinks"
addfieldprefix="Joomla\Component\Categories\Administrator\Field"
required="true" required="true"
default="" default=""
/> />

View File

@ -38,8 +38,11 @@ class WeblinksTableWeblink extends JTable
// Set the published column alias // Set the published column alias
$this->setColumnAlias('published', 'state'); $this->setColumnAlias('published', 'state');
JTableObserverTags::createObserver($this, array('typeAlias' => 'com_weblinks.weblink')); if (version_compare(JVERSION, '4.0', '<' ) == 1)
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_weblinks.weblink')); {
JTableObserverTags::createObserver($this, array('typeAlias' => 'com_weblinks.weblink'));
JTableObserverContenthistory::createObserver($this, array('typeAlias' => 'com_weblinks.weblink'));
}
} }
/** /**
@ -194,6 +197,6 @@ class WeblinksTableWeblink extends JTable
$this->metakey = implode(", ", $clean_keys); $this->metakey = implode(", ", $clean_keys);
} }
return true; return parent::check();
} }
} }

View File

@ -93,7 +93,7 @@ class WeblinksViewWeblinks extends JViewLegacy
$user = JFactory::getUser(); $user = JFactory::getUser();
// Get the toolbar object instance // Get the toolbar object instance
$bar = JToolBar::getInstance('toolbar'); $bar = JToolbar::getInstance('toolbar');
JToolbarHelper::title(JText::_('COM_WEBLINKS_MANAGER_WEBLINKS'), 'link weblinks'); JToolbarHelper::title(JText::_('COM_WEBLINKS_MANAGER_WEBLINKS'), 'link weblinks');
@ -129,7 +129,7 @@ class WeblinksViewWeblinks extends JViewLegacy
if ($user->authorise('core.create', 'com_weblinks') && $user->authorise('core.edit', 'com_weblinks') if ($user->authorise('core.create', 'com_weblinks') && $user->authorise('core.edit', 'com_weblinks')
&& $user->authorise('core.edit.state', 'com_weblinks')) && $user->authorise('core.edit.state', 'com_weblinks'))
{ {
JHtml::_('bootstrap.modal', 'collapseModal'); JHtml::_('bootstrap.renderModal', 'collapseModal');
$title = JText::_('JTOOLBAR_BATCH'); $title = JText::_('JTOOLBAR_BATCH');
// Instantiate a new JLayoutFile instance and render the batch button // Instantiate a new JLayoutFile instance and render the batch button