1<?php 2 3namespace dokuwiki\plugin\dokullm; 4 5use dokuwiki\Menu\Item\AbstractItem; 6 7/** 8 * Class MenuItem 9 * 10 * Implements the Copy page button for DokuWiki's menu system 11 * 12 * @package dokuwiki\plugin\dokullm 13 */ 14class MenuItem extends AbstractItem 15{ 16 17 /** @var string do action for this plugin */ 18 protected $type = 'dokullmplugin__copy'; 19 20 /** @var string icon file */ 21 protected $svg = __DIR__ . '/images/copy.svg'; 22 23 /** 24 * Get the label for the menu item from the plugin language file 25 * 26 * This method loads the dokullm action plugin and retrieves the 27 * localized label for the copy page button from the language files. 28 * The label is defined in the lang/en/lang.php file as 'copy_page_button'. 29 * 30 * @return string The localized label for the menu item 31 */ 32 public function getLabel() 33 { 34 // Load the action plugin to access its language strings 35 $hlp = plugin_load('action', 'dokullm'); 36 // Return the localized label for the copy page button 37 return $hlp->getLang('copy_page_button'); 38 } 39} 40