. * * ------------------------------------------------------------------------ * * This file is used to manage file collect of agent * * ------------------------------------------------------------------------ * * @package FusionInventory * @author David Durieux * @copyright Copyright (c) 2010-2016 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 https://github.com/fusioninventory/fusioninventory-for-glpi * */ if (!defined('GLPI_ROOT')) { die("Sorry. You can't access directly to this file"); } /** * Manage the files to search in collect module. */ class PluginFusioninventoryCollect_File extends PluginFusioninventoryCollectCommon { public $type = 'file'; /** * Get name of this type by language of the user connected * * @param integer $nb number of elements * @return string name of this type */ static function getTypeName($nb = 0) { return _n('Found file', 'Found files', $nb, 'fusioninventory'); } function getListHeaders() { return [ __("Name"), __("Limit", "fusioninventory"), __("Folder", "fusioninventory"), __("Recursive", "fusioninventory"), __("Regex", "fusioninventory"), __("Size", "fusioninventory"), __("Checksum SHA512", "fusioninventory"), __("Checksum SHA2", "fusioninventory"), __("Name", "fusioninventory"), __("Iname", "fusioninventory"), __("Type", "fusioninventory"), __("Action") ]; } function displayOneRow($row = []) { $filter = $type = ''; if (!empty($row['filter_sizeequals'])) { $filter = '= '.$row['filter_sizeequals']; } else if (!empty($row['filter_sizegreater'])) { $filer = '> '.$row['filter_sizegreater']; } else if (!empty($row['filter_sizelower'])) { $filter = '< '.$row['filter_sizelower']; } if ($row['filter_is_file'] == 1) { $type = __('File', 'fusioninventory'); } else { $type = __('Folder', 'fusioninventory'); } return [ $row['name'], $row['limit'], $row['dir'], $row['is_recursive'], $row['filter_regex'], $filter, $row['filter_checksumsha512'], $row['filter_checksumsha2'], $row['filter_name'], $row['filter_iname'], $type ]; } function displayNewSpecificities() { echo "