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