. -------------------------------------------------------------------------- */ class PluginExampleConfig extends CommonDBTM { static protected $notable = true; function getTabNameForItem(CommonGLPI $item, $withtemplate=0) { if (!$withtemplate) { if ($item->getType() == 'Config') { return __('Example plugin'); } } return ''; } static function configUpdate($input) { $input['configuration'] = 1 - $input['configuration']; return $input; } function showFormExample() { global $CFG_GLPI; if (!Session::haveRight("config", "w")) { return false; } $my_config = Config::getConfigurationValues('plugin:Example'); echo "
"; echo "
"; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo "
" . __('Example setup') . "
" . __('My boolean choice :') . ""; echo ""; echo ""; Dropdown::showYesNo("configuration", $my_config['configuration']); echo "
"; echo ""; echo "
"; Html::closeForm(); } static function displayTabContentForItem(CommonGLPI $item, $tabnum=1, $withtemplate=0) { if ($item->getType() == 'Config') { $config = new self(); $config->showFormExample(); } } } ?>