'video_loop' => __('Video : boucle'), 'video_auto_start' => __('Video : démarrage automatique'), 'video_controls' => __('Vidéo : afficher les contrôles'), 'video_sound_on' => __('Vidéo : activer le son'),
'inline' => __('Vidéo : afficher dans la page'), 'video_width' => __('Vidéo : Largeur du popup'), 'video_height' => __('Vidéo : Hauteur du popup'),
'interactive' => __('Interactivité'), 'video_service' => __('Webvideo : service'),
- 'close_button'=>__('Bouton de fermeture'),
+ 'close_button' => __('Bouton de fermeture'),
'extra' => __('Paramètre supplémentaire'),
'alternative' => __('Alternative'),
'read_mode' => __('Mode de lecture'),
}
return $randstring;
}
+
+ public static function copy($source, $dest, $sourceVersion = 'latest')
+ {
+ self::getLinksAndRulers($source, $links, $rulers, $sourceVersion);
+ self::saveLinksInFile($dest, backpack_user()->id, __('Copier les liens à partir du fluidbook :fluidbook', ['fluidbook' => $source]), $links, $rulers);
+ }
}
*/
protected function setupCloneRoutes($segment, $routeName, $controller)
{
- Route::post($segment . '/{id}/clone/{action}', [
+ Route::get($segment . '/{id}/clone/{action}', [
'as' => $routeName . '.clone',
'uses' => $controller . '@clone',
'operation' => 'clone',
use Cubist\Util\Graphics\Image;
use Cubist\Util\Json;
use Datetime;
+
// __('!!Paramètres des fluidbooks')
class FluidbookPublication extends ToolboxSettingsModel
{
return true;
}
- public function replicate(array $except = null)
+ protected function _baseReplicate(array $except = null)
{
$new = parent::replicate($except);
if (backpack_user()) {
$new->status = -1;
$new->title = __('Copie de :title', ['title' => $new->title]);
$new->visits_counter = 0;
+ return $new;
+ }
+
+ public function replicate(array $except = null)
+ {
+ $new = $this->_baseReplicate($except);
$new->save();
- // Todo copy links
+ // Copy links & assets
+ Links::copy($this->id, $new->id);
+ $this->_replicateMedia($new->id);
return $new;
}
public function replicateSettings(array $except = null)
{
- $new = parent::replicate($except);
- if (backpack_user()) {
- $new->owner = backpack_user()->id;
- }
- $new->status = -1;
- $new->title = __('Copie de :title', ['title' => $new->title]);
+ $new = $this->_baseReplicate($except);
$new->composition = [];
- $new->visits_counter = 0;
$new->save();
- // Todo copy assets
+ // Copy assets
+ $this->_replicateMedia($new->id);
return $new;
}
+
protected function _replicateMedia($newId)
{
- $from = protected_path('fluidbookpublication/working/' . $this->id . '/') . '*';
+ $from = protected_path('fluidbookpublication/working/' . $this->id . '/');
if (!file_exists($from)) {
return;
}
$to = Files::mkdir(protected_path('fluidbookpublication/working/' . $newId . '/'));
- `cp -r $from $to`;
+ `cp -Rs $from* $to`;
}
public function incrementPreviewVisit()