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

  @package   FusionInventory
  @author    David Durieux
  @co-author
  @copyright Copyright (c) 2010-2014 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";
$pfCollect_Registry = new PluginFusioninventoryCollect_Registry();
if (isset($_POST["add"])) {
    if (!preg_match('/^\\/()/', $_POST['path'])) {
        $_POST['path'] = "/" . $_POST['path'];
    }
    if (!preg_match('/\\/$/', $_POST['path'])) {
        $_POST['path'] = $_POST['path'] . "/";
    }
    $pfCollect_Registry->add($_POST);
    Html::back();
} else {
    if (isset($_POST["delete_x"])) {
        $pfCollect_Registry->delete($_POST);
        Html::back();
    }
}