File tree Expand file tree Collapse file tree 4 files changed +28
-3
lines changed
components/com_actionlogs Expand file tree Collapse file tree 4 files changed +28
-3
lines changed Original file line number Diff line number Diff line change 5656 <option value =" PUT" >COM_ACTIONLOGS_FIELD_VALUE_PUT</option >
5757 <option value =" PATCH" >COM_ACTIONLOGS_FIELD_VALUE_PATCH</option >
5858 </field >
59+ <field
60+ name=" date_relative"
61+ type=" radio"
62+ label=" COM_ACTIONLOGS_DATE_RELATIVE_LABEL"
63+ layout=" joomla.form.field.radio.switcher"
64+ default=" 1"
65+ filter=" integer"
66+ >
67+ <option value =" 0" >JHIDE</option >
68+ <option value =" 1" >JSHOW</option >
69+ </field >
5970 </fieldset >
6071</config >
Original file line number Diff line number Diff line change @@ -78,6 +78,14 @@ class HtmlView extends BaseHtmlView
7878 */
7979 protected $ showIpColumn = false ;
8080
81+ /**
82+ * Setting if the date should be displayed relative to the current date.
83+ *
84+ * @var boolean
85+ * @since __DEPLOY_VERSION__
86+ */
87+ protected $ dateRelative = false ;
88+
8189 /**
8290 * Method to display the view.
8391 *
@@ -100,6 +108,7 @@ public function display($tpl = null)
100108 $ this ->activeFilters = $ model ->getActiveFilters ();
101109 $ params = ComponentHelper::getParams ('com_actionlogs ' );
102110 $ this ->showIpColumn = (bool ) $ params ->get ('ip_logging ' , 0 );
111+ $ this ->dateRelative = (bool ) $ params ->get ('date_relative ' , 1 );
103112
104113 if (count ($ errors = $ model ->getErrors ()))
105114 {
Original file line number Diff line number Diff line change 8888 <?php echo $ this ->escape (Text::_ ($ extension )); ?>
8989 </td>
9090 <td class="d-none d-md-table-cell">
91- <?php echo HTMLHelper::_ ('date.relative ' , $ item ->log_date ); ?>
92- <div class="small">
91+ <?php if ($ this ->dateRelative ) : ?>
92+ <?php echo HTMLHelper::_ ('date.relative ' , $ item ->log_date ); ?>
93+ <div class="small">
94+ <?php endif ; ?>
9395 <?php echo HTMLHelper::_ ('date ' , $ item ->log_date , Text::_ ('DATE_FORMAT_LC6 ' )); ?>
94- </div>
96+ <?php if ($ this ->dateRelative ) : ?>
97+ </div>
98+ <?php endif ; ?>
9599 </td>
96100 <td class="d-md-table-cell">
97101 <?php echo $ this ->escape ($ item ->name ); ?>
Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ COM_ACTIONLOGS_COMMA="Comma"
1414COM_ACTIONLOGS_CONFIGURATION =" User Actions Log: Options"
1515COM_ACTIONLOGS_CSV_DELIMITER_LABEL =" CSV Delimiter"
1616COM_ACTIONLOGS_DATE =" Date"
17+ COM_ACTIONLOGS_DATE_RELATIVE_LABEL =" Relative Date/Time"
1718COM_ACTIONLOGS_DISABLED =" Disabled"
1819COM_ACTIONLOGS_EMAIL_BODY =" Latest User Actions\n------\nThis is the latest action performed by a user on your website.\n\nAction | Date | Extension | Name\n{MESSAGES} {MESSAGE} | {DATE} | {EXTENSION} | {USERNAME} \n{/MESSAGES}"
1920COM_ACTIONLOGS_EMAIL_DESC =" This is the latest action performed by a user on your website."
You can’t perform that action at this time.
0 commit comments