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