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{
28    const ITEM_ID = renderer_plugin_combo_analytics::RENDERER_NAME_MODE . "_item_id";
29
30
31    /** @var string do action for this plugin */
32    protected $type = 'export_' . renderer_plugin_combo_analytics::RENDERER_NAME_MODE;
33
34
35    /**
36     *
37     * @return string
38     */
39    public function getLabel()
40    {
41        return "Analytics";
42    }
43
44    public function getLinkAttributes($classprefix = 'menuitem ')
45    {
46        $linkAttributes = parent::getLinkAttributes($classprefix);
47        $linkAttributes['id'] = self::ITEM_ID;
48        return $linkAttributes;
49    }
50
51    public function getTitle()
52    {
53        return "Show the ComboStrap analytics";
54    }
55
56    public function getSvg()
57    {
58        /** @var string icon file */
59        return Site::getComboImagesDirectory()->resolve('file-chart.svg')->toString();
60
61    }
62
63
64}
65