|
19 | 19 | // No direct access |
20 | 20 | defined('_JEXEC') or die('Restricted access'); |
21 | 21 |
|
22 | | -// Import Joomla! libraries |
23 | | -jimport('joomla.application.component.model'); |
24 | | - |
25 | 22 | use Joomla\CMS\HTML\HTMLHelper; |
26 | 23 | use Joomla\CMS\Factory; |
27 | 24 | use Joomla\CMS\Filesystem\File; |
|
31 | 28 | use Joomla\CMS\Table\Table; |
32 | 29 | use Joomla\Utilities\ArrayHelper; |
33 | 30 |
|
| 31 | +use Jtg\Component\Jtg\Site\Helpers\GPSData; |
| 32 | +use Jtg\Component\Jtg\Site\Helpers\JtgHelper; |
| 33 | + |
34 | 34 | /** |
35 | 35 | * Model Class Files |
36 | 36 | * |
@@ -74,10 +74,8 @@ function updateGeneratedValues() |
74 | 74 | $id = Factory::getApplication()->input->get('id'); |
75 | 75 | $file = Factory::getApplication()->input->get('file'); |
76 | 76 | $cfg = JtgHelper::getConfig(); |
77 | | - jimport('joomla.filesystem.file'); |
78 | | - require_once '../components/com_jtg/helpers/gpsClass.php'; |
79 | 77 | $file = JPATH_SITE . '/images/jtrackgallery/uploaded_tracks/' . $file; |
80 | | - $gpsData = new GpsDataClass($file, $file); |
| 78 | + $gpsData = new GPSData($file, $file); |
81 | 79 |
|
82 | 80 | if ($gpsData->displayErrors()) |
83 | 81 | { |
@@ -837,9 +835,6 @@ function getAccess($id) |
837 | 835 | function saveFiles() |
838 | 836 | { |
839 | 837 | $app = Factory::getApplication(); |
840 | | - jimport('joomla.filesystem.file'); |
841 | | - jimport('joomla.filesystem.folder'); |
842 | | - require_once '../components/com_jtg/helpers/gpsClass.php'; |
843 | 838 | $fileokay = true; |
844 | 839 | $db = $this->getDbo(); |
845 | 840 | $user = Factory::getUser(); |
@@ -926,7 +921,7 @@ function saveFiles() |
926 | 921 | $data['access'] = $input->getInt('access_' . $i); |
927 | 922 |
|
928 | 923 | // TODO use $target below!! |
929 | | - $gpsData = new GpsDataClass($file, $filename); |
| 924 | + $gpsData = new GPSData($file, $filename); |
930 | 925 | $errors = $gpsData->displayErrors(); |
931 | 926 |
|
932 | 927 | if ($errors) |
@@ -1037,9 +1032,6 @@ function getDefaultMaps() |
1037 | 1032 | function importFromJPT($track) |
1038 | 1033 | { |
1039 | 1034 | // TODO Deprecated, can be replacd by import from injooosm |
1040 | | - jimport('joomla.filesystem.file'); |
1041 | | - jimport('joomla.filesystem.folder'); |
1042 | | - require_once '../components/com_jtg/helpers/gpsClass.php'; |
1043 | 1035 | $db = $this->getDbo(); |
1044 | 1036 | $fileokay = false; |
1045 | 1037 | $targetdir = JPATH_SITE . '/images/jtrackgallery/uploaded_tracks/'; |
@@ -1183,9 +1175,6 @@ function importFromJPT($track) |
1183 | 1175 | function saveFile() |
1184 | 1176 | { |
1185 | 1177 | $app = Factory::getApplication(); |
1186 | | - jimport('joomla.filesystem.file'); |
1187 | | - jimport('joomla.filesystem.folder'); |
1188 | | - require_once '../components/com_jtg/helpers/gpsClass.php'; |
1189 | 1178 |
|
1190 | 1179 | $db = $this->getDbo(); |
1191 | 1180 | $user = Factory::getUser(); |
@@ -1271,7 +1260,7 @@ function saveFile() |
1271 | 1260 |
|
1272 | 1261 | // Get the start coordinates |
1273 | 1262 | $file = $upload_dir . $target; |
1274 | | - $gpsData = new GpsDataClass($file, $target); |
| 1263 | + $gpsData = new GPSData($file, $target); |
1275 | 1264 | $errors = $gpsData->displayErrors(); |
1276 | 1265 |
|
1277 | 1266 | if ($errors) |
@@ -1362,11 +1351,8 @@ function importJPTtracks() |
1362 | 1351 | { |
1363 | 1352 | /* under construction */ |
1364 | 1353 | // TODO DEPRECATED |
1365 | | - jimport('joomla.filesystem.file'); |
1366 | | - jimport('joomla.filesystem.folder'); |
1367 | 1354 | $importfiles = $this->_fetchJPTfiles; |
1368 | 1355 | $app = Factory::getApplication(); |
1369 | | - require_once '../components/com_jtg/helpers/gpsClass.php'; |
1370 | 1356 | $fileokay = true; |
1371 | 1357 | $db = $this->getDbo(); |
1372 | 1358 | $user = Factory::getUser(); |
@@ -1557,9 +1543,6 @@ function getImageFiles($id) |
1557 | 1543 | function updateFile() |
1558 | 1544 | { |
1559 | 1545 | $app = Factory::getApplication(); |
1560 | | - jimport('joomla.filesystem.file'); |
1561 | | - jimport('joomla.filesystem.folder'); |
1562 | | - require_once '../components/com_jtg/helpers/gpsClass.php'; |
1563 | 1546 |
|
1564 | 1547 | $db = $this->getDbo(); |
1565 | 1548 | $user = Factory::getUser(); |
|
0 commit comments