/
PrintPage.php
41 lines (28 loc) · 932 Bytes
/
PrintPage.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<?php
namespace dokuwiki\Menu\Item;
/**
* Class PrintPage
*/
class PrintPage extends AbstractItem {
/** @inheritdoc */
public function __construct() {
parent::__construct();
if (! in_array('print', explode(',', tpl_getConf('pageIcons')))) {
throw new \RuntimeException("print is not available");
}
unset($this->params['do']);
$this->label = tpl_getLang('print');
$this->svg = template('assets/mdi/svg/printer.svg');
$this->id = '#';
}
public function getLinkAttributes($classprefix = 'menuitem ') {
$attr = array(
'href' => $this->getLink(),
'title' => $this->getTitle(),
'rel' => 'nofollow',
'onclick' => 'javascript:window.print()',
);
if ($classprefix !== false) $attr['class'] = $classprefix . $this->getType();
return $attr;
}
}