Skip to content

Commit

Permalink
action hooks ngg_dlgallery_zip_before_send and `ngg_dlgallery_zip_a…
Browse files Browse the repository at this point in the history
…fter_send`
  • Loading branch information
webaware committed Jun 13, 2015
1 parent f610d81 commit 27020ef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
4 changes: 4 additions & 0 deletions includes/class.NextGENDownloadGallery.php
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ protected static function getNgg2DownloadTitle($displayed_gallery) {
// TODO: extend this function to pick up other NGG2 gallery sources
$title = '';
break;

}

// restrict length to 250 characters
Expand Down Expand Up @@ -473,6 +474,7 @@ public static function nggDownloadZip() {

// send the Zip archive to the browser
$zipName = apply_filters('ngg_dlgallery_zip_filename', sanitize_file_name(strtr($gallery, ',', '-')) . '.zip', $gallery);
do_action('ngg_dlgallery_zip_before_send', $zipName, $filename, $images);
header('Content-Description: File Transfer');
header('Content-Type: application/zip');
header('Content-Disposition: attachment; filename=' . $zipName);
Expand All @@ -494,6 +496,8 @@ public static function nggDownloadZip() {
if (is_resource($file))
@fclose($file);

do_action('ngg_dlgallery_zip_after_send', $zipName, $filename, $images);

// delete the temporary file
@unlink($filename);

Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ This program incorporates a little code that is copyright by Photocrati Media 20

= 1.4.5, soon... =
* fixed: NextGEN Gallery no longer permits typing in download gallery template name; add our templates to list
* added: action hooks `ngg_dlgallery_zip_before_send` and `ngg_dlgallery_zip_after_send`
* changed: Download All handled via POST, not GET; more robust

= 1.4.4, 2014-10-27 =
Expand Down

0 comments on commit 27020ef

Please sign in to comment.