1<?php 2 3/** 4 * DokuWiki WebDAV Menu Item 5 * 6 * @author Giuseppe Di Terlizzi <giuseppe.diterlizzi@gmail.com> 7 * @license GPL 2 (http://www.gnu.org/licenses/gpl.html) 8 * @link https://dokuwiki.org/plugin:webdav 9 */ 10 11namespace dokuwiki\plugin\webdav; 12 13use dokuwiki\Menu\Item\AbstractItem; 14 15/** 16 * Class MenuItem 17 * 18 * Implements the WebDAV button for DokuWiki's menu system 19 * 20 * @package dokuwiki\plugin\webdav 21 */ 22class MenuItem extends AbstractItem 23{ 24 25 /** @var string icon file */ 26 protected $svg = __DIR__ . '/folder-network-outline.svg'; 27 28 /** @var string do action for this plugin */ 29 protected $type = 'webdav'; 30 31 public function getLinkAttributes($classprefix = 'menuitem ') 32 { 33 $attr = parent::getLinkAttributes($classprefix); 34 35 if (empty($attr['class'])) { 36 $attr['class'] = ''; 37 } 38 39 $attr['class'] .= ' plugin_webdav '; 40 $attr['data-webdav-url'] = getBaseURL(true) . 'lib/plugins/webdav/server.php/'; 41 42 return $attr; 43 } 44 45 /** 46 * Get label from plugin language file 47 * 48 * @return string 49 */ 50 public function getLabel() 51 { 52 return 'WebDAV'; 53 } 54 55 public function getLink() 56 { 57 return 'javascript:void(0)'; 58 } 59} 60