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