Skip to content
This repository was archived by the owner on May 5, 2023. It is now read-only.

Commit f2461df

Browse files
committed
enh: code cleanup
1 parent b4570b7 commit f2461df

File tree

1 file changed

+6
-20
lines changed

1 file changed

+6
-20
lines changed

com_kunena.php

Lines changed: 6 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -49,30 +49,16 @@ public static function getTree($xmap, stdClass $parent, array &$params)
4949
$params['include_pagination'] = ($params['include_pagination'] == 1 || ($params['include_pagination'] == 2 && $xmap->view == 'xml') || ($params['include_pagination'] == 3 && $xmap->view == 'html'));
5050

5151
$params['cat_priority'] = JArrayHelper::getValue($params, 'cat_priority', $parent->priority);
52-
$params['cat_changefreq'] = JArrayHelper::getValue($params, 'cat_changefreq', $parent->changefreq);
53-
54-
if ($params['cat_priority'] == -1)
55-
{
56-
$params['cat_priority'] = $parent->priority;
57-
}
52+
$params['cat_priority'] = ($params['cat_priority'] == -1) ? $parent->priority : $params['cat_priority'];
5853

59-
if ($params['cat_changefreq'] == -1)
60-
{
61-
$params['cat_changefreq'] = $parent->changefreq;
62-
}
54+
$params['cat_changefreq'] = JArrayHelper::getValue($params, 'cat_changefreq', $parent->changefreq);
55+
$params['cat_changefreq'] = ($params['cat_changefreq'] == -1) ? $parent->changefreq : $params['cat_changefreq'];
6356

6457
$params['topic_priority'] = JArrayHelper::getValue($params, 'topic_priority', $parent->changefreq);
65-
$params['topic_changefreq'] = JArrayHelper::getValue($params, 'topic_changefreq', $parent->changefreq);
66-
67-
if ($params['topic_priority'] == -1)
68-
{
69-
$params['topic_priority'] = $parent->priority;
70-
}
58+
$params['topic_priority'] = ($params['topic_priority'] == -1) ? $parent->priority : $params['topic_priority'];
7159

72-
if ($params['topic_changefreq'] == -1)
73-
{
74-
$params['topic_changefreq'] = $parent->changefreq;
75-
}
60+
$params['topic_changefreq'] = JArrayHelper::getValue($params, 'topic_changefreq', $parent->changefreq);
61+
$params['topic_changefreq'] = ($params['topic_changefreq'] == -1) ? $parent->changefreq : $params['topic_changefreq'];
7662

7763
if ($params['include_topics'])
7864
{

0 commit comments

Comments
 (0)