$cl->setArg('delay', 2);
$cl->setArg('scale', 1);
$cl->setArg('dest', $dest);
- $cl->setArg('url', 'https://workshop.fluidbook.com/viewerh/20098-' . $this->theme->getIdValue() . '_f2e0452eed6dba9878016ce5603fdc54_' . time() . '/?shortLoading=1#/page/2');
+ $cl->setArg('url', $this->theme->getPreviewURL(['shortLoading'=>1]));
$cl->execute();
}
}
$this->setSettingsFields();
}
+ public function setup()
+ {
+ parent::setup();
+ $this->addAdditionalEditView('fluidbook_theme.preview');
+ }
+
public function setSettingsFields()
{
$this->addField([
$data[] = ['theme_id' => $theme->id, 'signature' => 0, 'nom' => $theme->name, 'proprietaire' => $theme->owner, 'icones' => $theme->iconSet, 'date' => strtotime($theme->creation_date), 'parametres' => json_encode($settings)];
$dest = $t3dir . '/' . $theme->id . '.jpg';
- if(!file_exists($dest)) {
+ if (!file_exists($dest)) {
$preview = storage_path('themes/' . $theme->id . '.jpg');
`ln -s $preview $dest`;
}
}
}
+ public function getPreviewURL($params = [], $page = 2)
+ {
+ if (count($params) > 0) {
+ $get = [];
+ foreach ($params as $k => $v) {
+ $get = [$k . '=' . urlencode($v)];
+ }
+ $get = '?' . implode('&', $get);
+ }else{
+ $get='';
+ }
+ return 'https://workshop.fluidbook.com/viewerh/20098-' . $this->getIdValue() . '_f2e0452eed6dba9878016ce5603fdc54_' . time() . '/' . $get . '#/page/' . $page;
+ }
+
protected static function _unserialize($str)
{
--- /dev/null
+@php
+ $previewURL=$crud->entry->getPreviewURL(['widget'=>1,'action'=>'fullscreen'],0)
+@endphp
+
+@section('form_below_shortcuts')
+ <style type="text/css">
+ #themePreview {
+ position: relative;
+ padding-bottom: 75%;
+ }
+
+ #themePreview iframe {
+ position: absolute;
+ top: 0;
+ left: 0;
+ width: 100%;
+ height: 100%;;
+ }
+ </style>
+ <div class="card" id="themePreview">
+ <iframe src="{{$previewURL}}" width="100%" height="100%" frameborder="0" allowfullscreen></iframe>
+ </div>
+@endsection