Skip to content

Commit 8a30dd7

Browse files
authored
Add config option to show data on the top of the page (#550)
* Add config option to show data on the top of the page Currently the default behavior is to show the data below the first heading if it is found, or else on the top of the page. In addition to the existing option to always show the data on the bottom, let's also add an option to show it always on the top. As we want to stay compatible with existing setups that use the 'bottomoutput' option we add another boolean 'topoutput'. The former takes precedence over the latter and only if both are unset, the default behavior of showing the data below the first heading is used. Signed-off-by: Frieder Schrempf <dev@fris.de> * fixup! Add config option to show data on the top of the page
1 parent 3a6382a commit 8a30dd7

File tree

6 files changed

+8
-2
lines changed

6 files changed

+8
-2
lines changed

action/output.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,12 @@ public function handleOutput(Doku_Event $event, $param)
4747
if (!page_exists($ID)) return;
4848

4949
$pos = 0;
50+
$ins = -1;
51+
5052
// display struct data at the bottom?
5153
if ($this->getConf('bottomoutput')) {
5254
$ins = count($event->data->calls);
53-
} else {
54-
$ins = -1;
55+
} else if (!$this->getConf('topoutput')) {
5556
foreach ($event->data->calls as $num => $call) {
5657
// try to find the first header
5758
if ($call[0] == 'header') {

conf/default.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
22

33
$conf['bottomoutput'] = 0;
4+
$conf['topoutput'] = 0;
45
$conf['disableDeleteSerial'] = 0;

conf/metadata.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
22

33
$meta['bottomoutput'] = ['onoff'];
4+
$meta['topoutput'] = ['onoff'];
45
$meta['disableDeleteSerial'] = ['onoff'];

lang/de/settings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@
55
*
66
*/
77
$lang['bottomoutput'] = 'Daten am Ende der Seite anzeigen';
8+
$lang['topoutput'] = 'Daten am Anfang der Seite anzeigen';
89
$lang['disableDeleteSerial'] = 'Löschen von serial Daten deaktivieren';

lang/en/settings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
<?php
22
$lang['bottomoutput'] = 'Display data at the bottom of the page';
3+
$lang['topoutput'] = 'Display data at the top of the page';
34
$lang['disableDeleteSerial'] = 'Disable delete button for serial data';

lang/fr/settings.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@
1010
* @author Laynee <seedfloyd@gmail.com>
1111
*/
1212
$lang['bottomoutput'] = 'Afficher les données au bas de la page';
13+
$lang['topoutput'] = 'Afficher les données en haut de la page';

0 commit comments

Comments
 (0)