You are here

function patterns_export_to_zip in Patterns 7.2

Same name and namespace in other branches
  1. 7 patterns_export/finalize.inc \patterns_export_to_zip()

Exports patterns as a donwlodable Zip archive

Parameters

array $sections The sections of the pattern:

array $info The info section of the pattern:

array $modules The modules section of the pattern:

string $format The pattern format:

string $filename (optional) The final name of file :

string $path (optional) : The path of the temporary directory in which the zip file will be saved

1 call to patterns_export_to_zip()
patterns_export_finalize_export in patterns_export/finalize.inc
Initializes the appropriate action to export a collection of patterns

File

patterns_export/finalize.inc, line 67

Code

function patterns_export_to_zip($sections = array(), $info = array(), $modules = array(), $format, $filename = NULL, $path = NULL) {
  $zip_path = patterns_create_zip($sections, $format, $path, $filename);
  if (!$zip_path) {
    return FALSE;
  }

  // web server
  if (!patterns_utils_is_cli()) {
    patterns_download_zip($zip_path);
  }
  return TRUE;
}