Initial import
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
<div class="row c9 top15 upload-info">
|
||||
Задължително за да се покаже метериалът на началната страница е необходимо след качване на "Заглавно изображение", то трябва да бъде изрязано във формат 16:11 с
|
||||
вградения редактор на изображението.
|
||||
</div>
|
||||
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
use app\models\RegisterObjects;
|
||||
use app\services\JWT;
|
||||
use app\widgets\FileWidget;
|
||||
|
||||
/**
|
||||
* @var $model RegisterObjects
|
||||
*/
|
||||
$lg = $_COOKIE['cookie_lg'] ?? 'bg'
|
||||
?>
|
||||
<div class="inner-content p10 top30">
|
||||
<table class="cms-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Визуализация</th>
|
||||
<th>URL за сваляне на файла</th>
|
||||
<th>Разширение</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($model->registerObjectFiles as $registerObjectFile): ?>
|
||||
<tr>
|
||||
<td class="c1 ct">
|
||||
<?php
|
||||
if ($registerObjectFile->file_content_type) {
|
||||
switch ($registerObjectFile->file_content_type) {
|
||||
/*
|
||||
1 Документ
|
||||
2 Изображение
|
||||
3 Видео
|
||||
4 3D модел
|
||||
5 Аудио
|
||||
6 Друго
|
||||
*/
|
||||
case 1:
|
||||
if($registerObjectFile->extension == 'pdf')
|
||||
echo '<div class="pdf-preview" data-pdf="/api/file-preview-delivery/' . JWT::encode(['id' => $registerObjectFile->id], JWT::SECRET_KEY) . '/"><i class="la la-file-pdf"></i></div>';
|
||||
break;
|
||||
case 2:
|
||||
echo '<img data-preview="' . $registerObjectFile->file_url . '" src="' . $registerObjectFile->file_url . '" style="height: 200px">';
|
||||
break;
|
||||
case 3:
|
||||
$stream = $registerObjectFile->streaming_url ? 'data-streaming-url="' . $registerObjectFile->streaming_url . '"' : '';
|
||||
$thumb = $registerObjectFile->video_thumbnail;
|
||||
$img = $thumb ? 'background: url(' . $thumb . ') no-repeat; background-size: cover;' : 'background: var(--base-background-bright);';
|
||||
echo '<div ' . $stream . ' style="' . $img . ' width: 100%; height: 150px; line-height:170px; text-align: center; color: #FFFFFF">
|
||||
<i style="font-size: 50px" class="la la-file-movie-o"></i>
|
||||
</div>';
|
||||
break;
|
||||
case 4:
|
||||
echo '<img src="/_public/assets/images/3d-modeling.png" style="width: 30px" class="pointer" data-model-3d="/api/render-model/' . JWT::encode(['id' => $registerObjectFile->id], JWT::SECRET_KEY) . '/?lg='.$lg.'">';
|
||||
//
|
||||
break;
|
||||
case 5:
|
||||
///
|
||||
break;
|
||||
|
||||
}
|
||||
} else {
|
||||
// This is for old content from database
|
||||
switch (mb_strtolower($registerObjectFile->extension)) {
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
echo '<img data-preview="' . $registerObjectFile->file_url . '" src="' . $registerObjectFile->file_url . '" style="height: 200px">';
|
||||
break;
|
||||
case 'mp4':
|
||||
case 'avi':
|
||||
$stream = $registerObjectFile->streaming_url ? 'data-streaming-url="' . $registerObjectFile->streaming_url . '"' : '';
|
||||
echo '<div ' . $stream . ' style="background: var(--base-background-bright); width: 100%; height: 150px; line-height:170px; text-align: center; color: #FFFFFF">
|
||||
<i style="font-size: 50px" class="la la-file-movie-o"></i>
|
||||
</div>';
|
||||
break;
|
||||
default:
|
||||
echo '';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td><a href="<?= $registerObjectFile->file_url ?>">Свали файла<?= $registerObjectFile->video_title ? ' ('.$registerObjectFile->video_title.')' : '' ?></a></td>
|
||||
<td><?= $registerObjectFile->extension ?></td>
|
||||
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/hls.js@1"></script>
|
||||
<!-- Or if you want the latest version from the main branch -->
|
||||
<!-- <script src="https://cdn.jsdelivr.net/npm/hls.js@canary"></script> -->
|
||||
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
document.querySelectorAll('[data-streaming-url]').forEach(e => {
|
||||
e.classList.add('pointer')
|
||||
e.addEventListener('click', () => {
|
||||
modal.player(e.dataset.streamingUrl);
|
||||
})
|
||||
})
|
||||
|
||||
document.querySelectorAll('[data-preview]').forEach(e => {
|
||||
e.classList.add('pointer')
|
||||
e.addEventListener('click', () => {
|
||||
modal.modalPreview(e.dataset.preview);
|
||||
})
|
||||
})
|
||||
|
||||
document.querySelectorAll('[data-pdf]').forEach(e => {
|
||||
e.classList.add('pointer')
|
||||
e.addEventListener('click', () => {
|
||||
modal.modalFrame(e.dataset.pdf);
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
Reference in New Issue
Block a user