return $fname;
}
+ protected function _zipAssets($id)
+ {
+ /** @var Asset $asset */
+ $asset = Asset::find($id);
+ $collection = $asset->getMediaInField($asset->getAttributeValue('file_upload'));
+ $tmp = Files::tmpdir();
+ $zip = Files::tempnam() . '.zip';
+
+ foreach ($collection as $item) {
+ /** @var $item Media */
+ copy($item->getPath(), $tmp);
+ }
+ Zip::archive($tmp, $zip);
+ Files::rmdir($tmp);
+ return $zip;
+ }
+
+
public function getLinks()
{
$links = $this->getLinksFromPDF();
$link['loop'] = false;
$link['sound'] = true;
}
+ } else if (stripos($e[0], 'slideshow/') === 0) {
+ $link['inline'] = $e[0] === 'slideshow/inline';
+ $link['to'] = $this->_zipAssets($e[1]);
+ if ($link['inline']) {
+ $link['type'] = 15;
+ } else {
+ $link['type'] = 30;
+ }
}
$res[$k] = $link;
}