1<?php 2/** 3 * Copyright (c) 2021. ComboStrap, Inc. and its affiliates. All Rights Reserved. 4 * 5 * This source code is licensed under the GPL license found in the 6 * COPYING file in the root directory of this source tree. 7 * 8 * @license GPL 3 (https://www.gnu.org/licenses/gpl-3.0.en.html) 9 * @author ComboStrap <support@combostrap.com> 10 * 11 */ 12 13namespace ComboStrap; 14 15 16use dokuwiki\Menu\Item\AbstractItem; 17use renderer_plugin_combo_analytics; 18 19/** 20 * Class MenuItem 21 * * 22 * @package ComboStrap 23 * 24 * Inspiration: 25 * https://raw.githubusercontent.com/splitbrain/dokuwiki-plugin-dw2pdf/master/MenuItem.php 26 */ 27class AnalyticsMenuItem extends AbstractItem 28{ 29 30 const ITEM_ID = renderer_plugin_combo_analytics::RENDERER_NAME_MODE . "_item_id"; 31 32 33 /** @var string do action for this plugin */ 34 protected $type = 'export_' . renderer_plugin_combo_analytics::RENDERER_NAME_MODE; 35 36 37 /** 38 * 39 * @return string 40 */ 41 public function getLabel(): string 42 { 43 return "Analytics"; 44 } 45 46 public function getLinkAttributes($classprefix = 'menuitem '): array 47 { 48 $linkAttributes = parent::getLinkAttributes($classprefix); 49 $linkAttributes['id'] = self::ITEM_ID; 50 return $linkAttributes; 51 } 52 53 public function getTitle(): string 54 { 55 return "Show the ComboStrap analytics"; 56 } 57 58 public function getSvg(): string 59 { 60 /** @var string icon file */ 61 return DirectoryLayout::getComboImagesDirectory()->resolve('file-chart.svg')->toAbsoluteId(); 62 63 } 64 65 66} 67