$web->restore($_POST);
     $web->redirectToList();
 } else {
     if (isset($_POST["purge"])) {
         $web->check($_POST['id'], 'w');
         $web->delete($_POST, 1);
         $web->redirectToList();
     } else {
         if (isset($_POST["update"])) {
             $web->check($_POST['id'], 'w');
             $web->update($_POST);
             Html::back();
         } else {
             if (isset($_POST["additem"])) {
                 if (!empty($_POST['itemtype']) && $_POST['items_id'] > 0) {
                     $web_item->check(-1, 'w', $_POST);
                     $web_item->addItem($_POST);
                 }
                 Html::back();
             } else {
                 if (isset($_POST["deleteitem"])) {
                     foreach ($_POST["item"] as $key => $val) {
                         $input = array('id' => $key);
                         if ($val == 1) {
                             $web_item->check($key, 'w');
                             $web_item->delete($input);
                         }
                     }
                     Html::back();
                     //unlink webapplications to items of glpi from the items form
                 } else {
     $web->restore($_POST);
     $web->redirectToList();
 } else {
     if (isset($_POST["purge"])) {
         $web->check($_POST['id'], PURGE);
         $web->delete($_POST, 1);
         $web->redirectToList();
     } else {
         if (isset($_POST["update"])) {
             $web->check($_POST['id'], UPDATE);
             $web->update($_POST);
             Html::back();
         } else {
             if (isset($_POST["additem"])) {
                 if (!empty($_POST['itemtype']) && $_POST['items_id'] > 0) {
                     $web_item->check(-1, UPDATE, $_POST);
                     $web_item->addItem($_POST);
                 }
                 Html::back();
             } else {
                 if (isset($_POST["deleteitem"])) {
                     foreach ($_POST["item"] as $key => $val) {
                         $input = array('id' => $key);
                         if ($val == 1) {
                             $web_item->check($key, UPDATE);
                             $web_item->delete($input);
                         }
                     }
                     Html::back();
                     //unlink webapplications to items of glpi from the items form
                 } else {