- /**
- * Generates an import status summary
- *
- * @param string $filename name of the file to import
- * @param int $filesize size of the file to import
- * @param int $importCount how many bookmarks were imported
- * @param int $overwriteCount how many bookmarks were overwritten
- * @param int $skipCount how many bookmarks were skipped
- * @param int $duration how many seconds did the import take
- *
- * @return string Summary of the bookmark import status
- */
- private static function importStatus(
- $filename,
- $filesize,
- $importCount = 0,
- $overwriteCount = 0,
- $skipCount = 0,
- $duration = 0
- ) {
- $status = sprintf(t('File %s (%d bytes) '), $filename, $filesize);
- if ($importCount == 0 && $overwriteCount == 0 && $skipCount == 0) {
- $status .= t('has an unknown file format. Nothing was imported.');
- } else {
- $status .= vsprintf(
- t(
- 'was successfully processed in %d seconds: '
- . '%d bookmarks imported, %d bookmarks overwritten, %d bookmarks skipped.'
- ),
- [$duration, $importCount, $overwriteCount, $skipCount]
- );
- }
- return $status;
- }
-