Example #1
0
     break;
 case 'cancelComponent':
     if (isset($_GET['craftId'])) {
         $status = $node->cancelComponent($_GET['craftId'], $node->modules[$_GET['slotId']]['module']);
         if ($status == 'done') {
             header('Location: module.php?action=get&nodeId=' . $node->data['id'] . '&slotId=' . $_GET['slotId']);
         } else {
             $message = $ui[$status];
         }
     }
     break;
 case 'addUnit':
     if ($flags['train']) {
         if (isset($_GET['unitId'], $_POST['quantity'])) {
             if ($_POST['quantity'] > 0) {
                 $status = $node->addUnit($_GET['unitId'], $_POST['quantity'], $_GET['slotId']);
                 if ($status == 'done') {
                     header('Location: module.php?action=get&nodeId=' . $node->data['id'] . '&slotId=' . $_GET['slotId']);
                 } else {
                     $message = $ui[$status];
                 }
             } else {
                 header('Location: module.php?action=get&nodeId=' . $node->data['id'] . '&slotId=' . $_GET['slotId']);
             }
         }
     } else {
         $message = $ui['featureDisabled'];
     }
     break;
 case 'removeUnit':
     if ($flags['train']) {