* @throws \Exception
*/
- function __construct(FluidbookPublication $book, $scormVariant = false, $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false, FluidbookTheme $theme = null, $hybrid = false, Command $command = null)
+ function __construct(FluidbookPublication $book, $variant = 'online', $phonegap = false, $phonegapVersion = 'latest', $dir = null, $standalone = false, $appcache = false, $home = false, FluidbookTheme $theme = null, $hybrid = false, Command $command = null)
{
ExcelToArray::setCache($book->protected_path('fluidbookpublication/cache/exceltoarray'));
YoutubeDL::setCookiesFile(resource_path('yt-dlp/cookies.txt'), 'firefox');
$this->multiApp = $this->home = $home;
$this->devversion = /*$this->getFluidbook()->version < 3 ? "dev" : */
$this->getFluidbook()->mobileLVersion;
- $this->scormVariant = $scormVariant;
+ $this->scormVariant = $variant==='scorm';
$this->hybrid = $hybrid;
$this->log('Start compilation');
- $this->dir = $this->getFluidbook()->getFinalPath($theme, $scormVariant);
+ $this->dir = $this->getFluidbook()->getFinalPath($theme, $variant);
$this->vdir = new VirtualDirectory($this->dir);
$this->vdir->setLogger($this);
$this->vdir->setErrorListener($this);
* @return void
* @throws \Exception
*/
- public static function compile($fluidbook, $scormVariant = false, $hybrid = false, $sync = false)
+ public static function compile($fluidbook, $variant = 'online', $hybrid = false, $sync = false)
{
- $compiler = new static($fluidbook instanceof FluidbookPublication ? $fluidbook : FluidbookPublication::withoutGlobalScopes()->find($fluidbook), scormVariant: $scormVariant, hybrid: $hybrid);
+ $compiler = new static($fluidbook instanceof FluidbookPublication ? $fluidbook : FluidbookPublication::withoutGlobalScopes()->find($fluidbook), variant: $variant, hybrid: $hybrid);
if ($sync) {
$compiler->handle();
} else {
$fluidbook = FluidbookPublication::withoutGlobalScopes()->find(request()->get('fluidbook'));
$fluidbook->secureClientSidePassword = '___secure.html';
move_uploaded_file(request()->allFiles()['template']->getPathname(), $fluidbook->getAssetDir() . '/___secure.html');
- Compiler::compile($fluidbook, false, false, true);
+ Compiler::compile($fluidbook, 'online', false, true);
$final = $fluidbook->getFinalPath();
// TODO : add other assets by parsing html and finding needed assets (images, logo)
return $this->region;
}
- public function getFinalPath($theme = null, $scormVariant = false)
+ public function getFinalPath($theme = null, $variant = 'online')
{
$dir = $this->id;
if (null !== $theme && ($themeId != $this->theme)) {
$dir .= '-' . $themeId;
}
- return $this->protected_path('fluidbookpublication/final/' . $dir . '/' . ($scormVariant ? 'scorm' : 'online'));
+ return $this->protected_path('fluidbookpublication/final/' . $dir . '/' . ($variant));
}
public function _getFreeFileRootDirectory()
$suffixv3='';
$previewURL=$crud->route.'/preview/'.$entry->getKey().'_'.$entry->hash;
$actions['preview']=['label'=>__('Version online'),'url'=>$previewURL,'target'=>'_blank'];
+ if($entry->hosting_loadbalancer){
+ $previewNLB=$crud->route.'/preview/nolb/'.$entry->getKey().'_'.$entry->hash;
+ $actions['preview_nolb']=['label'=>__('Version online'). ' ('.__('sans loadbalancer').')','url'=>$previewNLB,'target'=>'_blank'];
+ }
if($entry->isSCORMEnabled()){
$actions['scorm']=['label'=>__('Version SCORM'),'url'=>$crud->route.'/preview/scorm/'.$entry->getKey().'_'.$entry->hash,'target'=>'_blank'];
}