xref: /dokuwiki/inc/Menu/Item/Back.php (revision 944e9ba7254387adb60f253b0d8796f2276096b1)
1<?php
2
3namespace dokuwiki\Menu\Item;
4
5use dokuwiki\File\StaticImage;
6
7/**
8 * Class Back
9 *
10 * Navigates back up one namepspace. This is currently not used in any menu. Templates
11 * would need to add this item manually.
12 */
13class Back extends AbstractItem
14{
15    /** @inheritdoc */
16    public function __construct()
17    {
18        global $ID;
19        parent::__construct();
20
21        $parent = tpl_getparent($ID);
22        if (!$parent) {
23            throw new \RuntimeException("No parent for back action");
24        }
25
26        $this->id = $parent;
27        $this->params = ['do' => ''];
28        $this->accesskey = 'b';
29        $this->svg = StaticImage::path('menu/12-back_arrow-left.svg');
30    }
31}
32