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