. * ------------------------------------------------------------------------- * @copyright Copyright (C) 2006-2022 by Example plugin team. * @license GPLv2 https://www.gnu.org/licenses/gpl-2.0.html * @link https://github.com/pluginsGLPI/example * ------------------------------------------------------------------------- */ namespace GlpiPlugin\Example; use CommonGLPI; use Html; use Session; class Profile extends \Profile { public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { if ( $item instanceof \Profile && $item->getField('id') ) { return self::createTabEntry(__s('Example plugin')); } return ''; } public static function displayTabContentForItem(CommonGLPI $item, $tabnum = 1, $withtemplate = 0) { if ($item instanceof self) { $profile = new self(); $profile->showFormExample($item->getID()); } return true; } public function showFormExample(int $profiles_id): void { if (!$this->can($profiles_id, READ)) { return; } echo "