xref: /plugin/combo/ComboStrap/AnalyticsMenuItem.php (revision 37748cd8654635afbeca80942126742f0f4cc346)
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
15use dokuwiki\Menu\Item\AbstractItem;
16use renderer_plugin_combo_analytics;
17
18/**
19 * Class MenuItem
20 * *
21 * @package ComboStrap
22 *
23 * Inspiration:
24 * https://raw.githubusercontent.com/splitbrain/dokuwiki-plugin-dw2pdf/master/MenuItem.php
25 */
26class AnalyticsMenuItem extends AbstractItem {
27    const ITEM_ID = renderer_plugin_combo_analytics::RENDERER_NAME_MODE . "_item_id";
28
29
30    /** @var string do action for this plugin */
31    protected $type = 'export_'. renderer_plugin_combo_analytics::RENDERER_NAME_MODE;
32
33
34
35    /**
36     *
37     * @return string
38     */
39    public function getLabel() {
40        return "Analytics";
41    }
42
43    public function getLinkAttributes($classprefix = 'menuitem ')
44    {
45        $linkAttributes = parent::getLinkAttributes($classprefix);
46        $linkAttributes['id']= self::ITEM_ID;
47        return $linkAttributes;
48    }
49
50    public function getTitle()
51    {
52        return "Show the ComboStrap analytics";
53    }
54
55    public function getSvg()
56    {
57        /** @var string icon file */
58        return Resources::getImagesDirectory() . '/file-chart.svg';
59    }
60
61
62}
63