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_summary_notes()

Description

Append summary notes about the completeness of the package, write the text file, add to archive, and schedule for deletion.

Parameters

ColumnTypeDefaultDescription
$result array
$available_sizes array
&$text
$subbed_original_resources array
$used_resources array
$id
$collection
$collectiondata
$collection_download_tar
$usertempdir
$filename
&$path
&$deletion_array array
$size
&$zip

Return

void

Location

include/collections_functions.php lines 4996 to 5075

Definition

 
function collection_download_process_summary_notes(
    array 
$result,
    array 
$available_sizes,
    &
$text,
    array 
$subbed_original_resources,
    array 
$used_resources,
    
$id,
    
$collection,
    
$collectiondata,
    
$collection_download_tar,
    
$usertempdir,
    
$filename,
    &
$path,
    array &
$deletion_array,
    
$size,
    &
$zip)
    {
    global 
$lang$zipped_collection_textfile$includetext$sizetext$use_zip_extension$p;

    if (
        !
hook('zippedcollectiontextfile''', array($text))
        && 
$zipped_collection_textfile
        
&& $includetext == "true"
    
) {
        
$qty_sizes = isset($available_sizes[$size]) ? count($available_sizes[$size]) : 0;
        
$qty_total count($result);
        
$text.= $lang["status-note"] . ": " $qty_sizes " " $lang["of"] . " " $qty_total " ";
        switch (
$qty_total) {
        case 
0:
            
$text.= $lang["resource-0"] . " ";
            break;
        case 
1:
            
$text.= $lang["resource-1"] . " ";
            break;
        default:
            
$text.= $lang["resource-2"] . " ";
            break;
        }

        switch (
$qty_sizes) {
        case 
0:
            
$text.= $lang["were_available-0"] . " ";
            break;
        case 
1:
            
$text.= $lang["were_available-1"] . " ";
            break;
        default:
            
$text.= $lang["were_available-2"] . " ";
            break;
        }
        
$text.= $lang["forthispackage"] . ".\r\n\r\n";

        foreach (
$result as $resource) {
        if (
in_array($resource['ref'],$subbed_original_resources)){
        
$text.= $lang["didnotinclude"] . ": " $resource['ref'];
        
$text.= " (".$lang["substituted_original"] . ")";
        
$text.= "\r\n";
        } elseif (!
in_array($resource['ref'],$used_resources)) {
                
$text.= $lang["didnotinclude"] . ": " $resource['ref'];
        
$text.= "\r\n";
            }
        }

        
$textfile get_temp_dir(false,$id) . "/"$collection "-" safe_file_name(i18n_get_collection_name($collectiondata)) . $sizetext ".txt";
        
$fh fopen($textfile'w') or die("can't open file");
        
fwrite($fh$text);
        
fclose($fh);
        if(
$collection_download_tar)
            {
            
debug("collection_download adding symlink: " $p " - " $usertempdir DIRECTORY_SEPARATOR $filename);
            @
symlink($textfile$usertempdir DIRECTORY_SEPARATOR $collection "-" safe_file_name(i18n_get_collection_name($collectiondata)) . $sizetext '.txt');
            }
        elseif (
$use_zip_extension){
            
$zip->addFile($textfile,$collection "-" safe_file_name(i18n_get_collection_name($collectiondata)) . $sizetext ".txt");
        } else {
            
$path.=$textfile "\r\n";  
        }
        
$deletion_array[]=$textfile;    
    }    
    }

This article was last updated 14th December 2024 20:35 Europe/London time based on the source file dated 12th December 2024 10:55 Europe/London time.