------------------------------------------------------------------------

  @package   FusionInventory
  @author
  @co-author
  @copyright Copyright (c) 2010-2015 FusionInventory team
  @license   AGPL License 3.0 or (at your option) any later version
             http://www.gnu.org/licenses/agpl-3.0-standalone.html
  @link      http://www.fusioninventory.org/
  @link      http://forge.fusioninventory.org/projects/fusioninventory-for-glpi/
  @since     2013

  ------------------------------------------------------------------------
*/
include "../../../inc/includes.php";
Session::checkLoginUser();
if (!isset($_GET["id"])) {
    $_GET["id"] = 0;
}
$collect = new PluginFusioninventoryInventoryComputerCollectContent();
//Add a new collectcontent
if (isset($_POST["add"])) {
    //we need to rebuild the post.
    $data = array('plugin_fusioninventory_inventorycomputercollects_id' => $_POST['plugin_fusioninventory_inventorycomputercollects_id'], 'plugin_fusioninventory_inventorycomputercollecttypes_id' => $_POST['plugin_fusioninventory_inventorycomputercollecttypes_id'], 'name' => $_POST['name']);
    switch ($_POST['plugin_fusioninventory_inventorycomputercollecttypes_id']) {
        case 1:
            $data['details'] = serialize(array('hives_id' => $_POST['hives_id'], 'path' => $_POST['path'], 'key' => $_POST['key']));
            break;
            //getFromWMI
        //getFromWMI
        case 2: