Exemplo n.º 1
0
     break;
 case 'cancelTechnology':
     if (isset($_GET['technologyId'])) {
         $status = $node->cancelTechnology($_GET['technologyId'], $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 'addComponent':
     if ($flags['craft']) {
         if (isset($_GET['componentId'], $_POST['quantity'])) {
             if ($_POST['quantity'] > 0) {
                 $status = $node->addComponent($_GET['componentId'], $_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 'removeComponent':
     if ($flags['craft']) {