Route::match(['get'], $segment . '/docInfos/{doc_id}', $controller . '@docInfos');
Route::match(['get'], $segment . '/{fluidbook_id}/pdfarchive/{time}', $controller . '@pdfArchive');
Route::match(['get'], $segment . '/{fluidbook_id}/{type}/{page}.{ext}', $controller . '@getPageAsset')
- ->whereIn('type', ['originalpdf', 'texts', 'index', 'layout']);
+ ->whereIn('type', ['originalpdf', 'texts', 'index', 'layout', 'links']);
}
protected function setupCompositionDefaults()
$doc = $fb->getDocument($page);
return XSendFileController::sendfile($fb->protected_path('fluidbookpublication/docs/' . $doc->id . '/original.pdf'), 86400, ['Content-Disposition', 'attachment; filename="' . $doc->id . '.pdf"']);
}
+ if ($type === 'links') {
+ $file = $fb->getLinksFile($page);
+ return XSendFileController::sendfile($file, headers: ['Content-type', 'text/plain']);
+ }
$types = ['texts' => FluidbookDocument::TEXT_PLAIN, 'index' => FluidbookDocument::TEXT_INDEX, 'layout' => FluidbookDocument::TEXT_LAYOUT];
if (!isset($types[$type])) {
abort(404, 'Text type not found');
use Cubist\Backpack\Http\Controllers\Base\XSendFileController;
use Cubist\Util\PHP;
use Illuminate\Support\Facades\Auth;
+use Illuminate\Support\Facades\Log;
use Illuminate\Support\Facades\Route;
// __('!!Paramètres des fluidbooks')
$dest = $fluidbook->getFinalPath($theme, $isScorm);
if ($path === 'index.html') {
$fluidbook->incrementPreviewVisit();
+ Log::debug('Compile fluidbook ' . $fluidbook->id . '//' . $path);
$compiler = new Compiler($fluidbook, $isScorm, theme: $theme);
$compiler->handle();
}
return self::$_docs[$documentID];
}
+ public function getLinksFile($page){
+ $compo = $this->getComposition()[$page];
+ $document=self::_getDocument($compo[0]);
+ return $document->path('links').'p'.$compo[1].'.csv';
+ }
+
public function getTextFile($page, $type = FluidbookDocument::TEXT_PLAIN, $mode = null)
{
$compo = $this->getComposition()[$page];
callback: function (key, opt) {
window.open('/fluidbook-publication/' + {{$entry->id}} + '/layout/' + ($(opt.$trigger[0]).index() + 1) + '.txt');
},
- }
+ },
+ seelinks: {
+ name: "{{__('Liens détectés dans le PDF')}}",
+ callback: function (key, opt) {
+ window.open('/fluidbook-publication/' + {{$entry->id}} + '/links/' + ($(opt.$trigger[0]).index() + 1) + '.csv');
+ },
+ },
}
}
};