1<?php 2 3namespace dokuwiki\plugin\links4pages; 4 5use dokuwiki\Menu\Item\AbstractItem; 6 7/** 8 * Class MenuItem 9 * 10 * Implements the link button for DokuWiki's menu system 11 * 12 * @package dokuwiki\plugin\links4pages 13 */ 14class MenuItem extends AbstractItem { 15 16 /** @var string name of the action, usually the lowercase class name */ 17 protected $type = 'show'; 18 19 /** @var string text identifier used to call getLang() */ 20 private $btn_txt_id = ''; 21 22 /** 23 * MenuItem constructor. 24 * 25 * Sets the page $id to link to 26 */ 27 public function __construct($id, $label, $svg_id) { 28 parent::__construct(); 29 $this->id = $id; 30 if (empty($label)) { 31 global $lang; 32 $this->label = $lang['skip_to_content'] . ' "' . $id . '"'; 33 } else { 34 $this->label = $label; 35 } 36 if (empty($svg_id)) { 37 $this->svg = __DIR__ . '/images/file-question.svg'; 38 } else { 39 $this->svg = mediaFN($svg_id); 40 } 41 } 42 43} 44