|
8 | 8 | if ($plugin->isActivated("formcreator")) { |
9 | 9 | $section = new PluginFormcreatorSection(); |
10 | 10 |
|
11 | | - // Add a new Section |
12 | 11 | if (isset($_POST["add"])) { |
| 12 | + // Add a new Section |
13 | 13 | Session::checkRight("entity", UPDATE); |
14 | 14 | $section->add($_POST); |
15 | 15 | Html::redirect($CFG_GLPI["root_doc"] . '/plugins/formcreator/front/form.form.php?id=' . $_POST['plugin_formcreator_forms_id']); |
16 | 16 |
|
17 | | - // Edit an existing Section |
18 | 17 | } else if (isset($_POST["update"])) { |
| 18 | + // Edit an existing section |
19 | 19 | Session::checkRight("entity", UPDATE); |
20 | 20 | $section->update($_POST); |
21 | 21 | Html::redirect($CFG_GLPI["root_doc"] . '/plugins/formcreator/front/form.form.php?id=' . $_POST['plugin_formcreator_forms_id']); |
22 | 22 |
|
23 | | - // Delete a Section |
24 | 23 | } else if (isset($_POST["delete_section"])) { |
| 24 | + // Delete a Section |
25 | 25 | Session::checkRight("entity", UPDATE); |
26 | 26 | $section->delete($_POST); |
27 | | - Html::redirect($CFG_GLPI["root_doc"] . '/plugins/formcreator/front/form.form.php?id=' . $_POST['plugin_formcreator_forms_id']); |
| 27 | + // Page refresh handled by Javascript |
28 | 28 |
|
29 | | - // Duplicate a Section |
30 | 29 | } else if (isset($_POST["duplicate_section"])) { |
| 30 | + // Duplicate a Section |
31 | 31 | Session::checkRight("entity", UPDATE); |
32 | 32 | if ($section->getFromDB((int) $_POST['id'])) { |
33 | 33 | $section->duplicate(); |
34 | 34 | } |
| 35 | + // Page refresh handled by Javascript |
35 | 36 |
|
36 | | - // Move a Section |
37 | 37 | } else if (isset($_POST["move"])) { |
| 38 | + // Move a Section |
38 | 39 | Session::checkRight("entity", UPDATE); |
39 | 40 |
|
40 | 41 | if ($section->getFromDB((int) $_POST['id'])) { |
|
44 | 45 | $section->moveDown(); |
45 | 46 | } |
46 | 47 | } |
47 | | - |
48 | 48 | // Page refresh handled by Javascript |
49 | 49 |
|
50 | | - // Return to form list |
51 | 50 | } else { |
| 51 | + // Return to form list |
52 | 52 | Html::redirect($CFG_GLPI["root_doc"] . '/plugins/formcreator/front/form.php'); |
53 | 53 | } |
54 | 54 |
|
|
0 commit comments