1*72b54c1bSAndreas Gohr<?php 2*72b54c1bSAndreas Gohr 3*72b54c1bSAndreas Gohrnamespace dokuwiki\plugin\twofactor; 4*72b54c1bSAndreas Gohr 5*72b54c1bSAndreas Gohruse dokuwiki\Menu\Item\Profile; 6*72b54c1bSAndreas Gohr 7*72b54c1bSAndreas Gohr/** 8*72b54c1bSAndreas Gohr * Menu Item to open the user's 2FA profile 9*72b54c1bSAndreas Gohr */ 10*72b54c1bSAndreas Gohrclass MenuItem extends Profile 11*72b54c1bSAndreas Gohr{ 12*72b54c1bSAndreas Gohr 13*72b54c1bSAndreas Gohr /** @inheritdoc */ 14*72b54c1bSAndreas Gohr public function __construct($label = '') 15*72b54c1bSAndreas Gohr { 16*72b54c1bSAndreas Gohr parent::__construct(); 17*72b54c1bSAndreas Gohr 18*72b54c1bSAndreas Gohr // Borrow the Profile language construct. 19*72b54c1bSAndreas Gohr global $lang; 20*72b54c1bSAndreas Gohr $this->label = $label ?: $lang['btn_profile'] . ' (2FA)'; 21*72b54c1bSAndreas Gohr 22*72b54c1bSAndreas Gohr } 23*72b54c1bSAndreas Gohr 24*72b54c1bSAndreas Gohr /** @inheritdoc */ 25*72b54c1bSAndreas Gohr public function getType() 26*72b54c1bSAndreas Gohr { 27*72b54c1bSAndreas Gohr return 'twofactor_profile'; 28*72b54c1bSAndreas Gohr } 29*72b54c1bSAndreas Gohr} 30