Skip to content

Commit 054ee93

Browse files
Improve routing for tags
1 parent deb01ee commit 054ee93

File tree

4 files changed

+23
-14
lines changed

4 files changed

+23
-14
lines changed

administrator/components/com_jtg/sql/install.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ VALUES ('GPS Track',
162162
"core_created_user_id": "uid",
163163
"core_body": "description"
164164
}}',
165-
'jtgRouter::getFileRoute',
165+
'JtgHelperRoute::getFileRoute',
166166
'com_jtg.file');
167167

168168
INSERT IGNORE INTO `#__jtg_maps` (`name`, `ordering`, `published`, `type`, `param`, `apikey`) VALUES
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
UPDATE `#__content_types`
2+
SET router='JtgHelperRoute::getFileRoute'
3+
WHERE type_alias='com_jtg.file';
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
defined('_JEXEC') or die;
4+
5+
class JtgHelperRoute
6+
{
7+
/*
8+
* Used to create links for tag list
9+
*/
10+
11+
public static function getFileRoute($id, $catid = 0, $language = 0) {
12+
$link = 'index.php?option=com_jtg&view=track&id=' . $id;
13+
if ($language && $language !== '*' && Multilanguage::isEnabled())
14+
{
15+
$link .= '&lang=' . $language;
16+
}
17+
return $link;
18+
}
19+
}

components/com_jtg/router.php

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -493,18 +493,5 @@ public static function getCategoryRoute($catid, $language = 0)
493493

494494
return $link;
495495
}
496-
497-
/*
498-
* Used to create links for tag list
499-
*/
500-
501-
public static function getFileRoute($id, $catid = 0, $language = 0) {
502-
$link = 'index.php?option=com_jtg&view=track&id=' . $id;
503-
if ($language && $language !== '*' && Multilanguage::isEnabled())
504-
{
505-
$link .= '&lang=' . $language;
506-
}
507-
return $link;
508-
}
509496
}
510497
?>

0 commit comments

Comments
 (0)