aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/inc/Ui/Backlinks.php
blob: 8eb55820f5eaef18a0c784ae1f26c8c6f807f825 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php

namespace dokuwiki\Ui;

/**
 * DokuWiki Backlinks Interface
 *
 * @package dokuwiki\Ui
 */
class Backlinks extends Ui
{
    /**
     * Display backlinks
     *
     * @return void
     * @author   Michael Klier <chi@chimeric.de>
     *
     * @author   Andreas Gohr <andi@splitbrain.org>
     */
    public function show()
    {
        global $ID;
        global $lang;

        // print intro
        echo p_locale_xhtml('backlinks');

        $data = ft_backlinks($ID);

        if (!empty($data)) {
            echo '<ul class="idx">';
            foreach ($data as $blink) {
                echo '<li><div class="li">';
                echo html_wikilink(':' . $blink, useHeading('navigation') ? null : $blink);
                echo '</div></li>';
            }
            echo '</ul>';
        } else {
            echo '<div class="level1"><p>' . $lang['nothingfound'] . '</p></div>';
        }
    }
}