1<?php 2 3namespace dokuwiki\plugin\overlay; 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\overlay 13 */ 14class MenuItem extends AbstractItem { 15 16 /** @var string do action for this plugin */ 17 protected $type = ''; 18 private $btn_name; 19 20 /** @var string icon file */ 21 // protected $svg = __DIR__ . '/multiple-outline.svg'; 22 protected $svg = __DIR__ . '/multiple-blank.svg'; 23 24 /** 25 * MenuItem constructor. 26 * @param string $btn_name (can be passed in from the event handler) 27 */ 28 public function __construct($btn_name = "") { 29 parent::__construct(); 30 $this->params['do']=""; 31 if($btn_name) { 32 $this->btn_name = $btn_name; 33 } 34 35 } 36 37 /** 38 * Get label from plugin language file 39 * 40 * @return string 41 */ 42 public function getLabel() { 43 if($this->btn_name) return $this->btn_name; 44 /* 45 if the button name has not been set up in the constructor 46 you can get it now. 47 Note: In the current case the name is guaranteed by 48 having been hard-coded in the event of a name not having been found 49 */ 50 $hlp = plugin_load('action', 'overlay'); 51 return $hlp->getLang('btn_dw_edit'); 52 53 54 } 55 56 public function getLink() { 57 return 'javascript:jQuery("#overlay").toggle();void(0)'; 58 } 59} 60