From ff32892ea3338311d2556abb8c4e1db2a3e7ea95 Mon Sep 17 00:00:00 2001 From: Constantin Romankiewicz Date: Wed, 16 Dec 2020 11:47:53 +0100 Subject: [PATCH 1/3] Actionlogs: Added parameter to disable relative timestamps. --- administrator/components/com_actionlogs/config.xml | 11 +++++++++++ .../com_actionlogs/src/View/Actionlogs/HtmlView.php | 9 +++++++++ .../com_actionlogs/tmpl/actionlogs/default.php | 10 +++++++--- administrator/language/en-GB/com_actionlogs.ini | 1 + 4 files changed, 28 insertions(+), 3 deletions(-) diff --git a/administrator/components/com_actionlogs/config.xml b/administrator/components/com_actionlogs/config.xml index 8ccd6e176e251..a80705200137c 100644 --- a/administrator/components/com_actionlogs/config.xml +++ b/administrator/components/com_actionlogs/config.xml @@ -56,5 +56,16 @@ + + + + diff --git a/administrator/components/com_actionlogs/src/View/Actionlogs/HtmlView.php b/administrator/components/com_actionlogs/src/View/Actionlogs/HtmlView.php index 77a559496e7b7..1eb52ab681fa0 100644 --- a/administrator/components/com_actionlogs/src/View/Actionlogs/HtmlView.php +++ b/administrator/components/com_actionlogs/src/View/Actionlogs/HtmlView.php @@ -78,6 +78,14 @@ class HtmlView extends BaseHtmlView */ protected $showIpColumn = false; + /** + * Setting if the date should be displayed relative to the current date. + * + * @var boolean + * @since __DEPLOY_VERSION__ + */ + protected $dateRelative = false; + /** * Method to display the view. * @@ -100,6 +108,7 @@ public function display($tpl = null) $this->activeFilters = $model->getActiveFilters(); $params = ComponentHelper::getParams('com_actionlogs'); $this->showIpColumn = (bool) $params->get('ip_logging', 0); + $this->dateRelative = (bool) $params->get('date_relative', 1); if (count($errors = $model->getErrors())) { diff --git a/administrator/components/com_actionlogs/tmpl/actionlogs/default.php b/administrator/components/com_actionlogs/tmpl/actionlogs/default.php index a9b88b5782c7f..41d6d976838e1 100644 --- a/administrator/components/com_actionlogs/tmpl/actionlogs/default.php +++ b/administrator/components/com_actionlogs/tmpl/actionlogs/default.php @@ -86,10 +86,14 @@ escape(Text::_($extension)); ?> - log_date); ?> -
+ dateRelative) : ?> + log_date); ?> +
+ log_date, Text::_('DATE_FORMAT_LC6')); ?> -
+ dateRelative) : ?> +
+ escape($item->name); ?> diff --git a/administrator/language/en-GB/com_actionlogs.ini b/administrator/language/en-GB/com_actionlogs.ini index a29e34ac7785c..e2cc2be8e03fa 100644 --- a/administrator/language/en-GB/com_actionlogs.ini +++ b/administrator/language/en-GB/com_actionlogs.ini @@ -14,6 +14,7 @@ COM_ACTIONLOGS_COMMA="Comma" COM_ACTIONLOGS_CONFIGURATION="User Actions Log: Options" COM_ACTIONLOGS_CSV_DELIMITER_LABEL="CSV Delimiter" COM_ACTIONLOGS_DATE="Date" +COM_ACTIONLOGS_DATE_RELATIVE_LABEL="Show Relative Date/Time" COM_ACTIONLOGS_DISABLED="Disabled" COM_ACTIONLOGS_EMAIL_DESC="This is the latest action performed by a user on your website." COM_ACTIONLOGS_EMAIL_SUBJECT="Latest User Actions" From 833a74d957c750eac50fa9a0a80c6648913c4fa6 Mon Sep 17 00:00:00 2001 From: Constantin Romankiewicz Date: Wed, 16 Dec 2020 17:03:16 +0100 Subject: [PATCH 2/3] Update administrator/components/com_actionlogs/config.xml Co-authored-by: Quy --- administrator/components/com_actionlogs/config.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/administrator/components/com_actionlogs/config.xml b/administrator/components/com_actionlogs/config.xml index a80705200137c..efd26dbca31f1 100644 --- a/administrator/components/com_actionlogs/config.xml +++ b/administrator/components/com_actionlogs/config.xml @@ -63,7 +63,7 @@ layout="joomla.form.field.radio.switcher" default="1" filter="integer" - > + > From bb6238ca68437a7c543e2136f9396a6779646ad5 Mon Sep 17 00:00:00 2001 From: Constantin Romankiewicz Date: Wed, 16 Dec 2020 17:27:22 +0100 Subject: [PATCH 3/3] Apply suggestions from code review Co-authored-by: Quy --- administrator/components/com_actionlogs/config.xml | 4 ++-- administrator/language/en-GB/com_actionlogs.ini | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/administrator/components/com_actionlogs/config.xml b/administrator/components/com_actionlogs/config.xml index efd26dbca31f1..f84146d31ccf0 100644 --- a/administrator/components/com_actionlogs/config.xml +++ b/administrator/components/com_actionlogs/config.xml @@ -64,8 +64,8 @@ default="1" filter="integer" > - - + + diff --git a/administrator/language/en-GB/com_actionlogs.ini b/administrator/language/en-GB/com_actionlogs.ini index e2cc2be8e03fa..058f2a3af51b9 100644 --- a/administrator/language/en-GB/com_actionlogs.ini +++ b/administrator/language/en-GB/com_actionlogs.ini @@ -14,7 +14,7 @@ COM_ACTIONLOGS_COMMA="Comma" COM_ACTIONLOGS_CONFIGURATION="User Actions Log: Options" COM_ACTIONLOGS_CSV_DELIMITER_LABEL="CSV Delimiter" COM_ACTIONLOGS_DATE="Date" -COM_ACTIONLOGS_DATE_RELATIVE_LABEL="Show Relative Date/Time" +COM_ACTIONLOGS_DATE_RELATIVE_LABEL="Relative Date/Time" COM_ACTIONLOGS_DISABLED="Disabled" COM_ACTIONLOGS_EMAIL_DESC="This is the latest action performed by a user on your website." COM_ACTIONLOGS_EMAIL_SUBJECT="Latest User Actions"