xref: /plugin/dw2pdf/MenuItem.php (revision 026b594bb55d8ddc29ab361fa1990225c9debf6c)
1<?php
2
3namespace dokuwiki\plugin\dw2pdf;
4
5use dokuwiki\Menu\Item\AbstractItem;
6
7/**
8 * Class MenuItem
9 *
10 * Implements the PDF export button for DokuWiki's menu system
11 *
12 * @package dokuwiki\plugin\dw2pdf
13 */
14class MenuItem extends AbstractItem {
15
16    /** @var string do action for this plugin */
17    protected $type = 'export_pdf';
18
19    /** @var string icon file */
20    protected $svg = __DIR__ . '/file-pdf.svg';
21
22    /**
23     * MenuItem constructor.
24     */
25    public function __construct() {
26        parent::__construct();
27        global $REV;
28        if($REV) $this->params['rev'] = $REV;
29    }
30
31    /**
32     * Get label from plugin language file
33     *
34     * @return string
35     */
36    public function getLabel() {
37        $hlp = plugin_load('action', 'dw2pdf');
38        return $hlp->getLang('export_pdf_button');
39    }
40}
41