xref: /plugin/twofactor/MenuItem.php (revision 30625b49d43f35ae8dc732acccd71d5a391980ea)
172b54c1bSAndreas Gohr<?php
272b54c1bSAndreas Gohr
372b54c1bSAndreas Gohrnamespace dokuwiki\plugin\twofactor;
472b54c1bSAndreas Gohr
572b54c1bSAndreas Gohruse dokuwiki\Menu\Item\Profile;
672b54c1bSAndreas Gohr
772b54c1bSAndreas Gohr/**
872b54c1bSAndreas Gohr * Menu Item to open the user's 2FA profile
972b54c1bSAndreas Gohr */
1072b54c1bSAndreas Gohrclass MenuItem extends Profile
1172b54c1bSAndreas Gohr{
1272b54c1bSAndreas Gohr    /** @inheritdoc */
1372b54c1bSAndreas Gohr    public function __construct($label = '')
1472b54c1bSAndreas Gohr    {
1572b54c1bSAndreas Gohr        parent::__construct();
1672b54c1bSAndreas Gohr
1772b54c1bSAndreas Gohr        // Borrow the Profile  language construct.
1872b54c1bSAndreas Gohr        global $lang;
1972b54c1bSAndreas Gohr        $this->label = $label ?: $lang['btn_profile'] . ' (2FA)';
2072b54c1bSAndreas Gohr    }
2172b54c1bSAndreas Gohr
2272b54c1bSAndreas Gohr    /** @inheritdoc */
2372b54c1bSAndreas Gohr    public function getType()
2472b54c1bSAndreas Gohr    {
2572b54c1bSAndreas Gohr        return 'twofactor_profile';
2672b54c1bSAndreas Gohr    }
27*24f76e8eSAndreas Gohr
28*24f76e8eSAndreas Gohr    /** @inheritdoc */
29*24f76e8eSAndreas Gohr    public function getSvg()
30*24f76e8eSAndreas Gohr    {
31*24f76e8eSAndreas Gohr        return __DIR__ . '/admin.svg';
32*24f76e8eSAndreas Gohr    }
3372b54c1bSAndreas Gohr}
34