966B; PHP | 2020-08-26 15:35:48+02 | SLOC 35
1
<?php
2
3
namespace dokuwiki\Menu\Item;
4
5
/**
6
 * Class ImgOriginalSize
7
 */
8
class ImgOriginalSize extends AbstractItem
9
{
10
11
    /** @inheritdoc */
12 3
    public function __construct()
13
    {
14
        parent::__construct();
15
16
        global $lang;
17
        global $IMG;
18
19
        if (!$IMG) {
20
            throw new \RuntimeException("image is not available");
21
        }
22
23
        unset($this->params['do']);
24
25
        $this->label = $lang['js']['mediadirect'];
26
        $this->svg   = tpl_incdir() . 'images/menu/image-size-select-large.svg';
27
        $this->id    = $IMG;
28
    }
29
30 6
    public function getLink()
CamelCaseVariableName The variable $REV is not named in camelCase. (kritika/PHPMD) Filter like this
CamelCaseVariableName The variable $INPUT is not named in camelCase. (kritika/PHPMD) Filter like this
CamelCaseVariableName The variable $IMG is not named in camelCase. (kritika/PHPMD) Filter like this
CamelCaseVariableName The variable $INPUT is not named in camelCase. (kritika/PHPMD) Filter like this
CamelCaseVariableName The variable $REV is not named in camelCase. (kritika/PHPMD) Filter like this
CamelCaseVariableName The variable $IMG is not named in camelCase. (kritika/PHPMD) Filter like this
31
    {
32
        global $IMG;
33
        global $REV;
34
        global $INPUT;
35
36
        return ml($IMG, array('cache' => $INPUT->str('cache'), 'rev' => $REV), true, '&');
37
    }
38
39
    public function getLinkAttributes($classprefix = 'menuitem ')
40
    {
41
        $attr           = parent::getLinkAttributes($classprefix);
42
        $attr['target'] = '_blank';
43
44
        return $attr;
45
    }
46
}