*/ function plugin_urbackup_get_classes(): array { return [ Config::class, Profile::class, Server::class, ServerAsset::class, PluginUrbackupMassiveAction::class, ]; } /** * Declare plugin massive actions. * * In GLPI this hook receives the current itemtype as string, * for example Computer, Printer, Peripheral. * * It does not receive a MassiveAction object. * * @param mixed $type Current itemtype * * @return array */ function plugin_urbackup_MassiveActions($type): array { $actions = []; if (!is_string($type) || $type === '') { return $actions; } if (!Config::isItemtypeEnabled($type)) { return $actions; } if (Profile::canCurrentUser(UPDATE) || Profile::canCurrentUser(CREATE)) { $actions[ PluginUrbackupMassiveAction::class . \MassiveAction::CLASS_ACTION_SEPARATOR . PluginUrbackupMassiveAction::ACTION_CONNECT_SERVER ] = __('UrBackup - connect to server', 'urbackup'); } if (Profile::canCurrentUser(UPDATE)) { $actions[ PluginUrbackupMassiveAction::class . \MassiveAction::CLASS_ACTION_SEPARATOR . PluginUrbackupMassiveAction::ACTION_DISCONNECT_SERVER ] = __('UrBackup - disconnect from server', 'urbackup'); } return $actions; }