Completed
Push — master ( c08467...5f28f7 )
by Andreas
03:00
created

Top   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 26
rs 10
c 1
b 0
f 0
wmc 2
lcom 0
cbo 1

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 9 1
A asHtmlButton() 0 3 1
1
<?php
2
3
namespace 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
 */
11
class Top extends AbstractItem {
12
13
    /** @inheritdoc */
14
    public function __construct() {
15
        parent::__construct();
16
17
        $this->svg = DOKU_INC . 'lib/images/menu/10-top_arrow-up.svg';
18
        $this->accesskey = 't';
19
        $this->params = array('do' => '');
20
        $this->id = '#dokuwiki__top';
21
        $this->context = self::CTX_DESKTOP;
22
    }
23
24
    /**
25
     * Convenience method to create a <button> element
26
     *
27
     * Uses html_topbtn()
28
     *
29
     * @todo this does currently not support the SVG icon
30
     * @return string
31
     */
32
    public function asHtmlButton() {
33
        return html_topbtn();
34
    }
35
36
}
37