class Download extends DownloadBase
{
-
protected $version = 'online';
protected $type = 'Fluidbook';
// __('Fluidbook ":title" (#:nb) installé sur :server')
protected $_installSubject = 'Fluidbook ":title" (#:nb) installé sur :server';
+ // __('Fluidbook ":title" (#:nb) déployé sur le loadbalancer')
+ protected $_loadbalancerSubject = 'Fluidbook ":title" (#:nb) déployé sur le loadbalancer';
+
+ // __('Le Fluidbook ":title" a été installé sur :server.')
+ protected $_loadbalancerText = 'Le Fluidbook ":title" a été installé sur le loadbalancer.';
+
// __('Le Fluidbook ":title" est prêt au téléchargement.');
protected $_text = 'Le Fluidbook ":title" est prêt au téléchargement.';
$actions = [__('Voir sur :server', ['server' => $server->name]) => $url];
}
+ } else if ($this->action === 'loadbalancer') {
+ $path = $this->_compileandpackage(false);
+ $dest = protected_path('fluidbookpublication/loadbalancer/' . $this->entry->id . '_' . $this->entry->hash . '/');
+
+ $rsync = new Rsync($path, $dest, true);
+ $rsync->execute();
+ $rsync->debug();
+
+ $subject = __($this->_loadbalancerSubject, $translateVariables);
+ $text = __($this->_loadbalancerText, $translateVariables);
}
} catch (\Exception $e) {
$subject = __('Erreur lors de la compilation du :type :nb', ['nb' => $this->_id(), 'type' => $this->type]);
*/
protected function package($id, $action, $version)
{
- if (!in_array($action, ['download', 'install', 'scormcloud'])) {
+ if (!in_array($action, ['download','loadbalancer', 'install', 'scormcloud'])) {
abort(404, __('Cette action n\'est pas disponible'));
}
if (!FluidbookPublication::hasPermission($id, 'read')) {
$actions=array_merge($actions,$installActions);
}
}
+ if(can('fluibook-publication:download:install-hosting') && $entry->hosting_loadbalancer){
+ $actions['sep_lb']='---------';
+ $actions['install_lb']=[
+ 'label'=>__('Envoyer sur le loadbalancer'),
+ 'url'=> $basePackage.'/loadbalancer/online',
+ ];
+ }
$confirm=[
'title'=>'',