xref: /dokuwiki/inc/Menu/Item/Back.php (revision cf71061da2667f7f873a09d8aa7e8d7f932aa764)
193b8c351SAndreas Gohr<?php
293b8c351SAndreas Gohr
393b8c351SAndreas Gohrnamespace dokuwiki\Menu\Item;
493b8c351SAndreas Gohr
5368ce258SAndreas Gohr/**
6368ce258SAndreas Gohr * Class Back
7368ce258SAndreas Gohr *
8*cf71061dSAndreas Gohr * Navigates back up one namepspace. This is currently not used in any menu. Templates
9*cf71061dSAndreas Gohr * would need to add this item manually.
10368ce258SAndreas Gohr */
1193b8c351SAndreas Gohrclass Back extends AbstractItem {
1293b8c351SAndreas Gohr
1393b8c351SAndreas Gohr    /** @inheritdoc */
1493b8c351SAndreas Gohr    public function __construct() {
1593b8c351SAndreas Gohr        global $ID;
1693b8c351SAndreas Gohr        parent::__construct();
1793b8c351SAndreas Gohr
1893b8c351SAndreas Gohr        $parent = tpl_getparent($ID);
1993b8c351SAndreas Gohr        if(!$parent) {
2093b8c351SAndreas Gohr            throw new \RuntimeException("No parent for back action");
2193b8c351SAndreas Gohr        }
2293b8c351SAndreas Gohr
2393b8c351SAndreas Gohr        $this->id = $parent;
2493b8c351SAndreas Gohr        $this->params = array('do' => '');
2593b8c351SAndreas Gohr        $this->accesskey = 'b';
26*cf71061dSAndreas Gohr        $this->svg = DOKU_INC . 'lib/images/menu/12-back_arrow-left.svg';
2793b8c351SAndreas Gohr    }
2893b8c351SAndreas Gohr
2993b8c351SAndreas Gohr}
30