mirror of
https://github.com/joomla-extensions/weblinks.git
synced 2024-06-09 01:32:22 +00:00
Various fixes for category view on PHP 8
This commit is contained in:
parent
dffe7c53c3
commit
b591407d4f
|
@ -14,7 +14,7 @@ JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html');
|
||||||
JHtml::_('behavior.framework');
|
JHtml::_('behavior.framework');
|
||||||
|
|
||||||
// Create a shortcut for params.
|
// Create a shortcut for params.
|
||||||
$params = &$this->item->params;
|
$params = &$this->category->params;
|
||||||
|
|
||||||
// Get the user object.
|
// Get the user object.
|
||||||
$user = JFactory::getUser();
|
$user = JFactory::getUser();
|
||||||
|
@ -128,8 +128,8 @@ $listDirn = $this->escape($this->state->get('list.direction'));
|
||||||
</div>
|
</div>
|
||||||
<?php $tagsData = $item->tags->getItemTags('com_weblinks.weblink', $item->id); ?>
|
<?php $tagsData = $item->tags->getItemTags('com_weblinks.weblink', $item->id); ?>
|
||||||
<?php if ($this->params->get('show_tags', 1)) : ?>
|
<?php if ($this->params->get('show_tags', 1)) : ?>
|
||||||
<?php $this->item->tagLayout = new JLayoutFile('joomla.content.tags'); ?>
|
<?php $tagLayout = new JLayoutFile('joomla.content.tags'); ?>
|
||||||
<?php echo $this->item->tagLayout->render($tagsData); ?>
|
<?php echo $tagLayout->render($tagsData); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php if (($this->params->get('show_link_description')) and ($item->description != '')) : ?>
|
<?php if (($this->params->get('show_link_description')) and ($item->description != '')) : ?>
|
||||||
<?php $images = json_decode($item->images); ?>
|
<?php $images = json_decode($item->images); ?>
|
||||||
|
|
|
@ -61,13 +61,11 @@ class WeblinksViewCategory extends JViewCategory
|
||||||
parent::prepareDocument();
|
parent::prepareDocument();
|
||||||
|
|
||||||
$app = JFactory::getApplication();
|
$app = JFactory::getApplication();
|
||||||
$menus = $app->getMenu();
|
|
||||||
$pathway = $app->getPathway();
|
$pathway = $app->getPathway();
|
||||||
$title = null;
|
|
||||||
|
|
||||||
// Because the application sets a default page title,
|
// Because the application sets a default page title,
|
||||||
// we need to get it from the menu item itself
|
// we need to get it from the menu item itself
|
||||||
$menu = $menus->getActive();
|
$menu = $app->getMenu()->getActive();
|
||||||
|
|
||||||
if ($menu)
|
if ($menu)
|
||||||
{
|
{
|
||||||
|
@ -86,7 +84,7 @@ class WeblinksViewCategory extends JViewCategory
|
||||||
$path = array(array('title' => $this->category->title, 'link' => ''));
|
$path = array(array('title' => $this->category->title, 'link' => ''));
|
||||||
$category = $this->category->getParent();
|
$category = $this->category->getParent();
|
||||||
|
|
||||||
while (($menu->query['option'] != 'com_weblinks' || $id != $category->id) && $category->id > 1)
|
while ($category !== null && $category->id !== 'root' && ($menu->query['option'] != 'com_weblinks' || $id != $category->id))
|
||||||
{
|
{
|
||||||
$path[] = array('title' => $category->title, 'link' => WeblinksHelperRoute::getCategoryRoute($category->id));
|
$path[] = array('title' => $category->title, 'link' => WeblinksHelperRoute::getCategoryRoute($category->id));
|
||||||
$category = $category->getParent();
|
$category = $category->getParent();
|
||||||
|
|
Loading…
Reference in New Issue
Block a user