mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-13 07:48:41 +00:00
Fix if for foreach while spacing
This commit is contained in:
parent
038b2c0cd7
commit
a78bde6303
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Admin\Install;
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabaseType;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Admin;
|
||||
|
||||
use phpOMS\DataStorage\Database\DatabasePool;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media;
|
||||
|
||||
use Modules\Media\Models\Media;
|
||||
|
|
@ -149,7 +149,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
$view->addData('nav', $this->app->moduleManager->get('Navigation')->createNavigationMid(1000401001, $request, $response));
|
||||
|
||||
$media = MediaMapper::get($request->getData('id'));
|
||||
if($media->getExtension() === 'collection') {
|
||||
if ($media->getExtension() === 'collection') {
|
||||
$media = CollectionMapper::get($media->getId());
|
||||
}
|
||||
|
||||
|
|
@ -193,7 +193,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
$uploads = $this->uploadFiles($request->getFiles(), $request->getHeader()->getAccount(), $request->getData('path') ?? __DIR__ . '/../../Modules/Media/Files');
|
||||
|
||||
$ids = [];
|
||||
foreach($uploads as $file) {
|
||||
foreach ($uploads as $file) {
|
||||
$ids[] = $file->getId();
|
||||
}
|
||||
|
||||
|
|
@ -260,7 +260,7 @@ class Controller extends ModuleAbstract implements WebInterface
|
|||
$mediaCreated = [];
|
||||
|
||||
foreach ($status as $uFile) {
|
||||
if(!is_null($created = self::createDbEntry($uFile, $account))) {
|
||||
if (!is_null($created = self::createDbEntry($uFile, $account))) {
|
||||
$mediaCreated[] = $created;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Models;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Models;
|
||||
|
||||
use Modules\Media\Models\MediaMapper;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Models;
|
||||
|
||||
use phpOMS\Asset\AssetType;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Models;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Models;
|
||||
|
||||
use phpOMS\DataStorage\Database\DataMapperAbstract;
|
||||
|
|
@ -89,7 +89,7 @@ class MediaMapper extends DataMapperAbstract
|
|||
try {
|
||||
$objId = parent::create($obj, $relations);
|
||||
|
||||
if($objId === null || !is_scalar($objId)) {
|
||||
if ($objId === null || !is_scalar($objId)) {
|
||||
return $objId;
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Models;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Models;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Models;
|
||||
|
||||
use phpOMS\System\File\Local\Directory;
|
||||
|
|
@ -163,7 +163,7 @@ class UploadFile
|
|||
$limit++;
|
||||
} while (file_exists($path . '/' . $this->fileName) && $limit < self::PATH_GENERATION_LIMIT);
|
||||
|
||||
if($limit >= self::PATH_GENERATION_LIMIT) {
|
||||
if ($limit >= self::PATH_GENERATION_LIMIT) {
|
||||
throw new \Exception('No file path could be found. Potential attack!');
|
||||
}
|
||||
}
|
||||
|
|
@ -184,7 +184,7 @@ class UploadFile
|
|||
return $result;
|
||||
}
|
||||
|
||||
if($this->interlaced && in_array($extension, ['png', 'jpg', 'jpeg', 'gif'])) {
|
||||
if ($this->interlaced && in_array($extension, ['png', 'jpg', 'jpeg', 'gif'])) {
|
||||
$this->interlace($extension, $dest);
|
||||
}
|
||||
|
||||
|
|
@ -197,22 +197,22 @@ class UploadFile
|
|||
private function interlace(string $extension, string $path) /* : void */
|
||||
{
|
||||
|
||||
if($extension === 'png') {
|
||||
if ($extension === 'png') {
|
||||
$img = imagecreatefrompng($path);
|
||||
} elseif($extension === 'jpg' || $extension === 'jpeg') {
|
||||
} elseif ($extension === 'jpg' || $extension === 'jpeg') {
|
||||
$img = imagecreatefromjpeg($path);
|
||||
} else {
|
||||
$img = imagecreatefromgif($path);
|
||||
$img = imagecreatefromgif ($path);
|
||||
}
|
||||
|
||||
imageinterlace($img, (int) $this->interlaced);
|
||||
|
||||
if($extension === 'png') {
|
||||
if ($extension === 'png') {
|
||||
imagepng($img, $path);
|
||||
} elseif($extension === 'jpg' || $extension === 'jpeg') {
|
||||
} elseif ($extension === 'jpg' || $extension === 'jpeg') {
|
||||
imagejpeg($img, $path);
|
||||
} else {
|
||||
imagegif($img, $path);
|
||||
imagegif ($img, $path);
|
||||
}
|
||||
|
||||
imagedestroy($img);
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Models;
|
||||
|
||||
use phpOMS\Stdlib\Base\Enum;
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
|
||||
namespace Modules\Media\Theme\Backend\Components\Media;
|
||||
|
||||
|
|
|
|||
|
|
@ -10,31 +10,31 @@
|
|||
<td><?= $this->getHtml('Created', 'Media') ?>
|
||||
<tfoot>
|
||||
<tbody>
|
||||
<?php $count = 0; foreach($this->media as $key => $value) : $count++;
|
||||
<?php $count = 0; foreach ($this->media as $key => $value) : $count++;
|
||||
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/media/single?{?}&id=' . $value->getId());
|
||||
|
||||
$icon = '';
|
||||
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());
|
||||
|
||||
if($extensionType === \phpOMS\System\File\ExtensionType::CODE) {
|
||||
if ($extensionType === \phpOMS\System\File\ExtensionType::CODE) {
|
||||
$icon = 'file-code-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::TEXT) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::TEXT) {
|
||||
$icon = 'file-text-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::PRESENTATION) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::PRESENTATION) {
|
||||
$icon = 'file-powerpoint-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::PDF) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::PDF) {
|
||||
$icon = 'file-pdf-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::ARCHIVE) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::ARCHIVE) {
|
||||
$icon = 'file-zip-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::AUDIO) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::AUDIO) {
|
||||
$icon = 'file-audio-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::VIDEO) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::VIDEO) {
|
||||
$icon = 'file-video-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::IMAGE) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::IMAGE) {
|
||||
$icon = 'file-image-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::SPREADSHEET) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::SPREADSHEET) {
|
||||
$icon = 'file-excel-o';
|
||||
} elseif($value->getExtension() === 'collection') {
|
||||
} elseif ($value->getExtension() === 'collection') {
|
||||
$icon = 'folder-open-o';
|
||||
} else {
|
||||
$icon = 'file-o';
|
||||
|
|
@ -48,7 +48,7 @@
|
|||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getCreatedBy()->getName1()); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getCreatedAt()->format('Y-m-d H:i:s')); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if($count === 0) : ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="6" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -40,31 +40,31 @@ echo $this->getData('nav')->render(); ?>
|
|||
<tr>
|
||||
<td colspan="3"><?= $footerView->render(); ?>
|
||||
<tbody>
|
||||
<?php $count = 0; foreach($media as $key => $value) : $count++;
|
||||
<?php $count = 0; foreach ($media as $key => $value) : $count++;
|
||||
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/media/single?{?}&id=' . $value->getId());
|
||||
|
||||
$icon = '';
|
||||
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());
|
||||
|
||||
if($extensionType === \phpOMS\System\File\ExtensionType::CODE) {
|
||||
if ($extensionType === \phpOMS\System\File\ExtensionType::CODE) {
|
||||
$icon = 'file-code-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::TEXT) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::TEXT) {
|
||||
$icon = 'file-text-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::PRESENTATION) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::PRESENTATION) {
|
||||
$icon = 'file-powerpoint-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::PDF) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::PDF) {
|
||||
$icon = 'file-pdf-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::ARCHIVE) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::ARCHIVE) {
|
||||
$icon = 'file-zip-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::AUDIO) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::AUDIO) {
|
||||
$icon = 'file-audio-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::VIDEO) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::VIDEO) {
|
||||
$icon = 'file-video-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::IMAGE) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::IMAGE) {
|
||||
$icon = 'file-image-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::SPREADSHEET) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::SPREADSHEET) {
|
||||
$icon = 'file-excel-o';
|
||||
} elseif($value->getExtension() === 'collection') {
|
||||
} elseif ($value->getExtension() === 'collection') {
|
||||
$icon = 'folder-open-o';
|
||||
} else {
|
||||
$icon = 'file-o';
|
||||
|
|
@ -78,7 +78,7 @@ echo $this->getData('nav')->render(); ?>
|
|||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getCreatedBy()->getName1()); ?></a>
|
||||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getCreatedAt()->format('Y-m-d H:i:s')); ?></a>
|
||||
<?php endforeach; ?>
|
||||
<?php if($count === 0) : ?>
|
||||
<?php if ($count === 0) : ?>
|
||||
<tr><td colspan="5" class="empty"><?= $this->getHtml('Empty', 0, 0); ?>
|
||||
<?php endif; ?>
|
||||
</table>
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ echo $this->getData('nav')->render();
|
|||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php if(
|
||||
<?php if (
|
||||
(
|
||||
$media->getExtension() === 'collection'
|
||||
&& !is_file($media->getPath() . $this->request->getData('sub'))
|
||||
|
|
@ -62,31 +62,31 @@ echo $this->getData('nav')->render();
|
|||
<td><?= $this->getHtml('Creator') ?>
|
||||
<td><?= $this->getHtml('Created') ?>
|
||||
<tbody>
|
||||
<?php if(!is_dir($media->getPath())) : foreach($media as $key => $value) :
|
||||
<?php if (!is_dir($media->getPath())) : foreach ($media as $key => $value) :
|
||||
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/media/single?{?}&id=' . $value->getId());
|
||||
|
||||
$icon = '';
|
||||
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());
|
||||
|
||||
if($extensionType === \phpOMS\System\File\ExtensionType::CODE) {
|
||||
if ($extensionType === \phpOMS\System\File\ExtensionType::CODE) {
|
||||
$icon = 'file-code-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::TEXT) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::TEXT) {
|
||||
$icon = 'file-text-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::PRESENTATION) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::PRESENTATION) {
|
||||
$icon = 'file-powerpoint-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::PDF) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::PDF) {
|
||||
$icon = 'file-pdf-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::ARCHIVE) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::ARCHIVE) {
|
||||
$icon = 'file-zip-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::AUDIO) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::AUDIO) {
|
||||
$icon = 'file-audio-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::VIDEO) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::VIDEO) {
|
||||
$icon = 'file-video-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::IMAGE) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::IMAGE) {
|
||||
$icon = 'file-image-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::SPREADSHEET) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::SPREADSHEET) {
|
||||
$icon = 'file-excel-o';
|
||||
} elseif($value->getExtension() === 'collection') {
|
||||
} elseif ($value->getExtension() === 'collection') {
|
||||
$icon = 'folder-open-o';
|
||||
} else {
|
||||
$icon = 'file-o';
|
||||
|
|
@ -101,30 +101,30 @@ echo $this->getData('nav')->render();
|
|||
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getCreatedAt()->format('Y-m-d H:i:s')); ?></a>
|
||||
<?php endforeach; else : $path = is_dir($media->getPath() . $this->request->getData('sub')) && phpOMS\Utils\StringUtils::startsWith(str_replace('\\', '/', realpath($media->getPath() . $this->request->getData('sub'))), $media->getPath()) ? $media->getPath() . $this->request->getData('sub') : $media->getPath(); ?>
|
||||
<?php $list = \phpOMS\System\File\Local\Directory::list($path);
|
||||
foreach($list as $key => $value) :
|
||||
foreach ($list as $key => $value) :
|
||||
$url = \phpOMS\Uri\UriFactory::build('{/base}/{/lang}/backend/media/single?{?}&id=' . $media->getId() . '&sub=' . substr($value, strlen($media->getPath())));
|
||||
$icon = '';
|
||||
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType(!is_dir($value) ? \phpOMS\System\File\Local\File::extension($value) : 'collection');
|
||||
|
||||
if($extensionType === \phpOMS\System\File\ExtensionType::CODE) {
|
||||
if ($extensionType === \phpOMS\System\File\ExtensionType::CODE) {
|
||||
$icon = 'file-code-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::TEXT) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::TEXT) {
|
||||
$icon = 'file-text-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::PRESENTATION) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::PRESENTATION) {
|
||||
$icon = 'file-powerpoint-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::PDF) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::PDF) {
|
||||
$icon = 'file-pdf-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::ARCHIVE) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::ARCHIVE) {
|
||||
$icon = 'file-zip-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::AUDIO) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::AUDIO) {
|
||||
$icon = 'file-audio-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::VIDEO) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::VIDEO) {
|
||||
$icon = 'file-video-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::IMAGE) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::IMAGE) {
|
||||
$icon = 'file-image-o';
|
||||
} elseif($extensionType === \phpOMS\System\File\ExtensionType::SPREADSHEET) {
|
||||
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::SPREADSHEET) {
|
||||
$icon = 'file-excel-o';
|
||||
} elseif($extensionType === 'collection') {
|
||||
} elseif ($extensionType === 'collection') {
|
||||
$icon = 'folder-open-o';
|
||||
} else {
|
||||
$icon = 'file-o';
|
||||
|
|
@ -147,7 +147,7 @@ echo $this->getData('nav')->render();
|
|||
<div class="inner">
|
||||
<?php
|
||||
$path = is_file($media->getPath() . $this->request->getData('sub')) && phpOMS\Utils\StringUtils::startsWith(str_replace('\\', '/', realpath($media->getPath() . $this->request->getData('sub'))), $media->getPath()) ? $media->getPath() . $this->request->getData('sub') : $media->getPath();
|
||||
if(\phpOMS\System\File\FileUtils::getExtensionType($media->getExtension()) === \phpOMS\System\File\ExtensionType::IMAGE || \phpOMS\System\File\FileUtils::getExtensionType(\phpOMS\System\File\Local\File::extension($path)) === \phpOMS\System\File\ExtensionType::IMAGE) : ?>
|
||||
if (\phpOMS\System\File\FileUtils::getExtensionType($media->getExtension()) === \phpOMS\System\File\ExtensionType::IMAGE || \phpOMS\System\File\FileUtils::getExtensionType(\phpOMS\System\File\Local\File::extension($path)) === \phpOMS\System\File\ExtensionType::IMAGE) : ?>
|
||||
<div class="h-overflow"><img src="<?= $media->isAbsolute() ? $this->printHtml($path) : $this->printHtml($this->request->getUri()->getBase() . $path); ?>"></div>
|
||||
<?php else : ?>
|
||||
<pre>
|
||||
|
|
@ -155,7 +155,7 @@ echo $this->getData('nav')->render();
|
|||
$output = file_get_contents($media->isAbsolute() ? $path : __DIR__ . '/../../../../' . $path);
|
||||
$output = str_replace(["\r\n", "\r"], "\n", $output);
|
||||
$output = explode("\n", $output);
|
||||
foreach($output as $line) : ?><span><?= $this->printHtml($line); ?></span><?php endforeach; ?>
|
||||
foreach ($output as $line) : ?><span><?= $this->printHtml($line); ?></span><?php endforeach; ?>
|
||||
</pre>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
* @version 1.0.0
|
||||
* @link http://orange-management.com
|
||||
*/
|
||||
declare(strict_types=1);
|
||||
declare(strict_types = 1);
|
||||
namespace Modules\Media\Views;
|
||||
|
||||
use phpOMS\Views\View;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user