Skip to content

Commit 8a6be9f

Browse files
committed
Option to use alternative date format in admin overview
1 parent 548fb61 commit 8a6be9f

File tree

5 files changed

+10
-4
lines changed

5 files changed

+10
-4
lines changed

admin.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,9 @@ public function html()
5858

5959
$time = $INPUT->str('time') ?: $now;
6060

61+
// alternative date format?
62+
$dateFormat = $this->getConf('admin_date_format') ?: $conf['dformat'];
63+
6164
echo $this->locale_xhtml('intro');
6265

6366
$form = new dokuwiki\Form\Form(['method'=>'GET']);
@@ -77,9 +80,8 @@ public function html()
7780
$form->addButton('submit', $this->getLang('submit'))->attr('type','submit');
7881
echo $form->toHTML();
7982

80-
81-
echo '<p>' . $this->getLang('range') . ' ' . strftime($conf['dformat'], $min) .
82-
' - ' . strftime($conf['dformat'], $max) . '</p>';
83+
echo '<p>' . $this->getLang('range') . ' ' . strftime($dateFormat, $min) .
84+
' - ' . strftime($dateFormat, $max) . '</p>';
8385

8486
echo '<table class="inline loglog">';
8587
echo '<tr>';
@@ -138,7 +140,7 @@ public function html()
138140
}
139141

140142
echo '<tr>';
141-
echo '<td>' . strftime($conf['dformat'], $dt) . '</td>';
143+
echo '<td>' . strftime($dateFormat, $dt) . '</td>';
142144
echo '<td>' . hsc($ip) . '</td>';
143145
echo '<td>' . hsc($user) . '</td>';
144146
echo '<td><span class="loglog_' . $class . '">' . $msg . '</span></td>';

conf/default.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
$conf['login_failed_interval'] = '1';
88
$conf['login_failed_email'] = '';
99
$conf['report_email'] = '';
10+
$conf['admin_date_format'] = '';

conf/metadata.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
$meta['login_failed_interval'] = ['string'];
88
$meta['login_failed_email'] = ['string'];
99
$meta['report_email'] = ['string'];
10+
$meta['admin_date_format'] = ['string'];

lang/de/settings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
$lang['login_failed_interval'] = 'Alle X Minuten prüfen, ob der konfigurierte Schwellenwert für fehlgeschlagene Anmeldeversuche überschritten wurde';
88
$lang['login_failed_email'] = 'E-Mail für Benachrichtigungen über zu viele fehlgeschlagene Anmeldeversuche';
99
$lang['report_email'] = 'E-Mail für monatliche Berichte (Monatsanfang)';
10+
$lang['admin_date_format'] = 'Datumsformat in der Admin-Übersicht, falls abweichend von der Vorgabe in der Hauptkonfiguration (Siehe PHP <a href="http://php.net/strftime">strftime</a> Funktion)';

lang/en/settings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
$lang['login_failed_interval'] = 'Interval to check the number of recent failed login attempts, in minutes';
88
$lang['login_failed_email'] = 'Email to send notifications about too many failed logins';
99
$lang['report_email'] = 'Email to send monthly reports to (beginning of every month)';
10+
$lang['admin_date_format'] = 'Date format to use in admin list instead of the global configuration (see PHP <a href="http://php.net/strftime">strftime</a> function)';

0 commit comments

Comments
 (0)