$translateVariables['server'] = $server->name;
$url = $this->install($dest, $server);
- $this->sendNotification(__('Collection ":title" (#:nb) installée sur le serveur :server', $translateVariables), __('La collection ":title" a été installée sur le serveur :server', $translateVariables), [__('Voir sur :server', $translateVariables) => $url]);
+ if ($this->entry->type === 'export') {
+ $actions = [];
+ $paths = $this->getPublicationsPaths($this->entry->getPageData());
+ foreach ($paths as $fbid => $path) {
+ $actions[$this->_getFluidbookTitle($fbid)] = $url . '/' . $path;
+ }
+ } else {
+ $actions = [__('Voir sur :server', $translateVariables) => $url];
+ }
+ $this->sendNotification(__('Collection ":title" (#:nb) installée sur le serveur :server', $translateVariables), __('La collection ":title" a été installée sur le serveur :server', $translateVariables), $actions);
} else if ($this->action === 'export' && in_array($this->entry->version, ['win_inss_html', 'win_ins_html'])) {
$url = $this->downloadList($this->entry->getPageData());
$this->sendNotification(__($this->_subject, $translateVariables), __($this->_text, $translateVariables), [__('Télécharger') => $url]);
* @return void
* @throws \Exception
*/
- protected function compileExport($data, $path)
+ protected function compileExport($data, $basePath)
{
$options = $this->getCollectionGlobalSettings();
- $zipmerge = in_array($data->version, ['online', 'scorm', 'sharepoint', 'precompiled', 'win_exe_html', 'win_html', 'win_cd_html', 'mac_exe_html']);
+
$jobs = [];
+ $paths = $this->getPublicationsPaths($data);
+ foreach ($paths as $fbid => $path) {
+ $dest = $basePath . $path;
+ $jobs[] = $this->_jobDownloadFluidbook($fbid, $data->version, $dest, $options);
+ }
+
+ $this->_waitJobs($jobs);
+ }
+
+ protected function getPublicationsPaths($data, $attr = 'dir')
+ {
+ $zipmerge = in_array($data->version, ['online', 'scorm', 'sharepoint', 'precompiled', 'win_exe_html', 'win_html', 'win_cd_html', 'mac_exe_html']);
+ $res = [];
foreach ($data->publications as $publication) {
$fbid = $publication['fluidbook'];
- $dest = $path;
- if ($publication['export']) {
- $dest .= $publication['export'];
+ if ($publication[$attr]) {
+ $path = $publication[$attr];
} else {
- $dest .= Str::slug($this->_getFluidbookTitle($fbid));
+ $path = Str::slug($this->_getFluidbookTitle($fbid));
}
if (!$zipmerge) {
- $dest .= '.exe';
+ $path .= '.exe';
}
-
- $jobs[] = $this->_jobDownloadFluidbook($fbid, $data->version, $dest, $options);
+ $res[$fbid] = $path;
}
- $this->_waitJobs($jobs);
+ return $res;
}