diff --git a/ajax/form_toggle.php b/ajax/form_toggle.php new file mode 100644 index 000000000..4402666f2 --- /dev/null +++ b/ajax/form_toggle.php @@ -0,0 +1,44 @@ +. + * --------------------------------------------------------------------- + * @copyright Copyright © 2011 - 2021 Teclib' + * @license http://www.gnu.org/licenses/gpl.txt GPLv3+ + * @link https://github.com/pluginsGLPI/formcreator/ + * @link https://pluginsglpi.github.io/formcreator/ + * @link http://plugins.glpi-project.org/#/plugin/formcreator + * --------------------------------------------------------------------- + */ + +include ('../../../inc/includes.php'); +Session::checkRight('entity', UPDATE); + +$form = new PluginFormcreatorForm(); + +$success = $form->update([ + 'id' => $_POST['id'], + 'toggle' => 'toggle', +]); + +if (!$success) { + http_response_code(500); +} \ No newline at end of file diff --git a/css/styles.css b/css/styles.css index 4ff900acc..d5facbffe 100644 --- a/css/styles.css +++ b/css/styles.css @@ -1589,10 +1589,12 @@ span.fc_list_icon { /* Active / inactive light for forms */ .plugin-forcreator-active { + cursor: pointer; color: #009933; } .plugin-forcreator-inactive { + cursor: pointer; color: #a0a0a0; } diff --git a/inc/form.class.php b/inc/form.class.php index 29027ba41..017a92fbd 100644 --- a/inc/form.class.php +++ b/inc/form.class.php @@ -338,7 +338,7 @@ public static function getSpecificValueToDisplay($field, $values, array $options $output = ''; - $output = '