. * ------------------------------------------------------------------------- * @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 CommonDBTM; use CommonGLPI; use Config as GlpiConfig; use Dropdown; use Html; use Session; use Toolbox; class Config extends CommonDBTM { protected static $notable = true; public function getTabNameForItem(CommonGLPI $item, $withtemplate = 0) { if (!$withtemplate) { if ($item->getType() == 'Config') { return __('Example plugin'); } } return ''; } public static function configUpdate($input) { $input['configuration'] = 1 - $input['configuration']; return $input; } public function showFormExample() { global $CFG_GLPI; if (!Session::haveRight('config', UPDATE)) { return false; } $my_config = GlpiConfig::getConfigurationValues('plugin:Example'); echo "