1<?php
2
3namespace dokuwiki\Ui;
4
5/**
6 * DokuWiki Backlinks Interface
7 *
8 * @package dokuwiki\Ui
9 */
10class Backlinks extends Ui
11{
12    /**
13     * Display backlinks
14     *
15     * @return void
16     * @author   Michael Klier <chi@chimeric.de>
17     *
18     * @author   Andreas Gohr <andi@splitbrain.org>
19     */
20    public function show()
21    {
22        global $ID;
23        global $lang;
24
25        // print intro
26        echo p_locale_xhtml('backlinks');
27
28        $data = ft_backlinks($ID);
29
30        if (!empty($data)) {
31            echo '<ul class="idx">';
32            foreach ($data as $blink) {
33                echo '<li><div class="li">';
34                echo html_wikilink(':' . $blink, useHeading('navigation') ? null : $blink);
35                echo '</div></li>';
36            }
37            echo '</ul>';
38        } else {
39            echo '<div class="level1"><p>' . $lang['nothingfound'] . '</p></div>';
40        }
41    }
42}
43