diff --git a/aggpxtrack-update4.xml b/aggpxtrack-update4.xml
index cae74db..8721356 100644
--- a/aggpxtrack-update4.xml
+++ b/aggpxtrack-update4.xml
@@ -42,4 +42,25 @@
', $errors)),
@@ -157,8 +144,7 @@ public function upload()
return false;
}
- if (!JFile::upload($object_file->tmp_name, $object_file->filepath))
- {
+ if (!JFile::upload($object_file->tmp_name, $object_file->filepath)) {
// Error in upload
$app->enqueueMessage(JText::_('COM_AGGPXTRACK_ERROR_UNABLE_TO_UPLOAD_FILE'), 'warning');
@@ -166,7 +152,7 @@ public function upload()
}
// Trigger the onContentAfterSave event.
- $dispatcher->trigger('onContentAfterSave', array('com_aggpxtrack.file', &$object_file, true));
+ $dispatcher->trigger('onContentAfterSave', ['com_aggpxtrack.file', &$object_file, true]);
$this->setMessage(JText::sprintf('COM_AGGPXTRACK_UPLOAD_COMPLETE', substr($object_file->filepath, strlen(COM_MEDIA_BASE))));
}
@@ -184,8 +170,7 @@ public function upload()
*/
protected function authoriseUser($action)
{
- if (!JFactory::getUser()->authorise('core.' . strtolower($action), 'com_aggpxtrack'))
- {
+ if (!JFactory::getUser()->authorise('core.' . strtolower($action), 'com_aggpxtrack')) {
// User is not authorised
$app = JFactory::getApplication();
$app->enqueueMessage(JText::_('JLIB_APPLICATION_ERROR_' . strtoupper($action) . '_NOT_PERMITTED'), 'warning');
diff --git a/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/models/gpxtracklist.php b/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/models/gpxtracklist.php
index 9671350..c594394 100644
--- a/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/models/gpxtracklist.php
+++ b/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/models/gpxtracklist.php
@@ -34,8 +34,7 @@ public function getState($property = null, $default = null)
{
static $set;
- if (!$set)
- {
+ if (!$set) {
$input = JFactory::getApplication()->input;
$folder = $input->get('folder', '', 'path');
$this->setState('folder', $folder);
@@ -89,8 +88,7 @@ public function getList()
static $list;
// Only process the list once per request
- if (is_array($list))
- {
+ if (is_array($list)) {
return $list;
}
@@ -100,26 +98,22 @@ public function getList()
$basePath = COM_MEDIA_BASE . ((strlen($current) > 0) ? '/' . $current : '');
$mediaBase = str_replace(DIRECTORY_SEPARATOR, '/', COM_MEDIA_BASE . '/');
- $images = array ();
- $folders = array ();
+ $images = [];
+ $folders = [];
$fileList = false;
$folderList = false;
- if (file_exists($basePath))
- {
+ if (file_exists($basePath)) {
// Get the list of files and folders from the given folder
$fileList = array_reverse(JFolder::files($basePath));
$folderList = JFolder::folders($basePath);
}
// Iterate over the files if they exist
- if ($fileList !== false)
- {
- foreach ($fileList as $file)
- {
- if (is_file($basePath . '/' . $file) && substr($file, 0, 1) != '.' && strtolower($file) !== 'index.html')
- {
+ if ($fileList !== false) {
+ foreach ($fileList as $file) {
+ if (is_file($basePath . '/' . $file) && substr($file, 0, 1) != '.' && strtolower($file) !== 'index.html') {
$tmp = new JObject;
$tmp->name = $file;
$tmp->path = str_replace(DIRECTORY_SEPARATOR, '/', JPath::clean($basePath . '/' . $file));
@@ -129,8 +123,7 @@ public function getList()
$file_extension = strtolower(JFile::getExt($file));
- if ($file_extension == 'gpx')
- {
+ if ($file_extension == 'gpx') {
$images[] = $tmp;
}
}
@@ -138,10 +131,8 @@ public function getList()
}
// Iterate over the folders if they exist
- if ($folderList !== false)
- {
- foreach ($folderList as $folder)
- {
+ if ($folderList !== false) {
+ foreach ($folderList as $folder) {
$tmp = new JObject;
$tmp->name = basename($folder);
$tmp->path = str_replace(DIRECTORY_SEPARATOR, '/', JPath::clean($basePath . '/' . $folder));
@@ -156,16 +147,15 @@ public function getList()
}
// Sortiert nach Datum
- $date = array();
+ $date = [];
- foreach ($images as $key => $row)
- {
+ foreach ($images as $key => $row) {
$date[$key] = $row->date;
}
array_multisort($date, SORT_DESC, $images);
- $list = array('folders' => $folders, 'images' => $images);
+ $list = ['folders' => $folders, 'images' => $images];
return $list;
}
diff --git a/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/script.php b/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/script.php
index 6137201..7783106 100644
--- a/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/script.php
+++ b/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/script.php
@@ -83,10 +83,8 @@ public function copyFiles()
// Now we read all png files and put them in an array.
$gpx_files = JFolder::files($pathsearch, '.gpx');
- foreach ($gpx_files as $file)
- {
- if (!file_exists($path . $file))
- {
+ foreach ($gpx_files as $file) {
+ if (!file_exists($path . $file)) {
JFile::copy($pathsearch . $file, $path . $file);
}
}
diff --git a/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/views/aggpxtrack/view.html.php b/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/views/aggpxtrack/view.html.php
index 289fc64..6c3777d 100644
--- a/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/views/aggpxtrack/view.html.php
+++ b/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/views/aggpxtrack/view.html.php
@@ -30,6 +30,5 @@ public function display($tpl = null)
{
$url = JUri::base() . $url;
header('Location: ' . $url . 'index.php?option=com_config');
-
}
}
diff --git a/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/views/button/tmpl/default.php b/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/views/button/tmpl/default.php
index 10fd387..4f51838 100644
--- a/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/views/button/tmpl/default.php
+++ b/j4/pkg_aggpxtrack/src/administrator/components/com_aggpxtrack/views/button/tmpl/default.php
@@ -21,16 +21,15 @@
JHtml::_('formbehavior.chosen', 'select');
// Load tooltip instance without HTML support because we have a HTML tag in the tip
-JHtml::_('bootstrap.tooltip', '.noHtmlTip', array('html' => false));
+JHtml::_('bootstrap.tooltip', '.noHtmlTip', ['html' => false]);
// Include jQuery
JHtml::_('jquery.framework');
JHtml::_('script', 'com_aggpxtrack/popup-manager.js', false, true, false, false, true);
-JHtml::_('stylesheet', 'media/popup-imagemanager.css', array(), true);
+JHtml::_('stylesheet', 'media/popup-imagemanager.css', [], true);
-if ($lang->isRtl())
-{
- JHtml::_('stylesheet', 'media/popup-imagemanager_rtl.css', array(), true);
+if ($lang->isRtl()) {
+ JHtml::_('stylesheet', 'media/popup-imagemanager_rtl.css', [], true);
}
JFactory::getDocument()->addScriptDeclaration(
@@ -47,14 +46,11 @@
*
* This should be removed when mootools won't be shipped by Joomla.
*/
-if (!empty($fieldInput)) // Media Form Field
-{
- if ($isMoo)
- {
+if (!empty($fieldInput)) { // Media Form Field
+ if ($isMoo) {
$onClick = "window.parent.jInsertFieldValue(document.getElementById('f_url').value, '" . $fieldInput . "');window.parent.jModalClose();window.parent.jQuery('.modal.in').modal('hide');";
}
-}
-else // XTD Image plugin
+} else // XTD Image plugin
{
$onClick = 'ImageManager.onok();window.parent.jModalClose();';
}
@@ -64,7 +60,7 @@