Collections functions
Encryption functions
General functions
Render functions
Theme permission functions
Video functions
Resource functions

collection_download_process_csv_metadata_file()

Description

Add a CSV containing resource metadata to a downloaded zip file during creation of the zip.

Parameters

ColumnTypeDefaultDescription
$result array
$id integer
$collection integer
$collection_download_tar boolean
$use_zip_extension boolean
&$zip
&$path
&$deletion_array array
$zip object
$path string
$deletion_array array

Return

void

Location

include/collections_functions.php lines 4017 to 4039

Definition

 
function collection_download_process_csv_metadata_file(array $result$id$collection$collection_download_tar$use_zip_extension, &$zip, &$path, array &$deletion_array)
    {
    
// Include the CSV file with the metadata of the resources found in this collection
    
$csv_file    get_temp_dir(false$id) . '/Col-' $collection '-metadata-export.csv';
    
generateResourcesMetadataCSV($resultfalse,false,$csv_file);
    
    
// Add link to file for use by tar to prevent full paths being included.
    
if($collection_download_tar)
        {
        global 
$p$usertempdir$filename;
        
debug("collection_download adding symlink: " $p " - " $usertempdir DIRECTORY_SEPARATOR $filename);
        @
symlink($csv_file$usertempdir DIRECTORY_SEPARATOR 'Col-' $collection '-metadata-export.csv');
        }
    elseif(
$use_zip_extension)
        {
        
$zip->addFile($csv_file'Col-' $collection '-metadata-export.csv');
        }
    else
        {
        
$path .= $csv_file "\r\n";
        }
    
$deletion_array[] = $csv_file;
    }

This article was last updated 30th November 2020 16:05 Europe/London time based on the source file dated 25th November 2020 10:35 Europe/London time.