Coding standards
Security in ResourceSpace
Developer reference
Database
Action functions
Admin functions
Ajax functions
Annotation functions
API functions
Collections functions
Comment functions
Config functions
CSV export functions
Dash functions
Debug functions
Encryption functions
Facial recognition functions
File functions
General functions
Language functions
Log functions
Login functions
Message functions
Migration functions
Node functions
PDF functions
Plugin functions
Render functions
Reporting functions
Request functions
Research functions
Slideshow functions
Theme permission functions
User functions
Video functions
Database functions
Metadata functions
Resource functions
Search functions
Map functions
Job functions
Tab functions
Test 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 5084 to 5110

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';
        if(isset(
$result[0]["ref"]))
        {
        
$result array_column($result,"ref");  
        }
    
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 4th December 2024 09:05 Europe/London time based on the source file dated 27th November 2024 15:30 Europe/London time.