xref: /dokuwiki/inc/Menu/Item/Top.php (revision 90fb952c4c30c09c8446076ba05991c89a3f0b01)
1<?php
2
3namespace dokuwiki\Menu\Item;
4
5/**
6 * Class Top
7 *
8 * Scroll back to the top. Uses a hash as $id which is handled special in getLink().
9 * Not shown in mobile context
10 */
11class Top extends AbstractItem
12{
13
14    /** @inheritdoc */
15    public function __construct()
16    {
17        parent::__construct();
18
19        $this->svg = DOKU_INC . 'lib/images/menu/10-top_arrow-up.svg';
20        $this->accesskey = 't';
21        $this->params = ['do' => ''];
22        $this->id = '#dokuwiki__top';
23        $this->context = self::CTX_DESKTOP;
24    }
25
26    /**
27     * Convenience method to create a <button> element
28     *
29     * Uses html_topbtn()
30     *
31     * @return string
32     * @todo this does currently not support the SVG icon
33     */
34    public function asHtmlButton()
35    {
36        return html_topbtn();
37    }
38}
39