Remove space from end of line

This commit is contained in:
Dennis Eichhorn 2018-02-03 11:52:30 +01:00
parent 543821a1db
commit c0b17534e3
6 changed files with 20 additions and 20 deletions

View File

@ -190,8 +190,8 @@ class Controller extends ModuleAbstract implements WebInterface
public function apiMediaUpload(RequestAbstract $request, ResponseAbstract $response, $data = null) public function apiMediaUpload(RequestAbstract $request, ResponseAbstract $response, $data = null)
{ {
$uploads = $this->uploadFiles( $uploads = $this->uploadFiles(
$request->getFiles(), $request->getFiles(),
$request->getHeader()->getAccount(), $request->getHeader()->getAccount(),
(string) ($request->getData('path') ?? __DIR__ . '/../../Modules/Media/Files') (string) ($request->getData('path') ?? __DIR__ . '/../../Modules/Media/Files')
); );
@ -292,8 +292,8 @@ class Controller extends ModuleAbstract implements WebInterface
private static function normalizeDbPath(string $path) : string private static function normalizeDbPath(string $path) : string
{ {
return str_replace('\\', '/', return str_replace('\\', '/',
str_replace(realpath(__DIR__ . '/../../'), '', str_replace(realpath(__DIR__ . '/../../'), '',
rtrim($path, '/') rtrim($path, '/')
) )
); );

View File

@ -22,7 +22,7 @@ namespace Modules\Media\Models;
* @link http://website.orange-management.de * @link http://website.orange-management.de
* @since 1.0.0 * @since 1.0.0
*/ */
class Collection extends Media implements \Iterator class Collection extends Media implements \Iterator
{ {
/** /**
@ -95,27 +95,27 @@ class Collection extends Media implements \Iterator
{ {
} }
public function rewind() public function rewind()
{ {
reset($this->sources); reset($this->sources);
} }
public function current() public function current()
{ {
return current($this->sources); return current($this->sources);
} }
public function key() public function key()
{ {
return key($this->sources); return key($this->sources);
} }
public function next() public function next()
{ {
next($this->sources); next($this->sources);
} }
public function valid() public function valid()
{ {
return current($this->sources) !== false; return current($this->sources) !== false;
} }

View File

@ -195,7 +195,7 @@ class UploadFile
private function interlace(string $extension, string $path) /* : void */ private function interlace(string $extension, string $path) /* : void */
{ {
if ($extension === 'png') { if ($extension === 'png') {
$img = imagecreatefrompng($path); $img = imagecreatefrompng($path);
} elseif ($extension === 'jpg' || $extension === 'jpeg') { } elseif ($extension === 'jpg' || $extension === 'jpeg') {

View File

@ -11,7 +11,7 @@
<tfoot> <tfoot>
<tbody> <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('/{/lang}/backend/media/single?{?}&id=' . $value->getId()); $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $value->getId());
$icon = ''; $icon = '';
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension()); $extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());

View File

@ -40,7 +40,7 @@ echo $this->getData('nav')->render(); ?>
<td colspan="3"> <td colspan="3">
<tbody> <tbody>
<?php $count = 0; foreach ($media as $key => $value) : $count++; <?php $count = 0; foreach ($media as $key => $value) : $count++;
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $value->getId()); $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $value->getId());
$icon = ''; $icon = '';
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension()); $extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());

View File

@ -44,7 +44,7 @@ echo $this->getData('nav')->render();
$media->getExtension() === 'collection' $media->getExtension() === 'collection'
&& !is_file($media->getPath() . $this->request->getData('sub')) && !is_file($media->getPath() . $this->request->getData('sub'))
) || ( ) || (
is_dir($media->getPath()) is_dir($media->getPath())
&& ($this->request->getData('sub') === null || is_dir($media->getPath() . $this->request->getData('sub'))) && ($this->request->getData('sub') === null || is_dir($media->getPath() . $this->request->getData('sub')))
) )
) : ?> ) : ?>
@ -62,7 +62,7 @@ echo $this->getData('nav')->render();
<td><?= $this->getHtml('Created') ?> <td><?= $this->getHtml('Created') ?>
<tbody> <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('/{/lang}/backend/media/single?{?}&id=' . $value->getId()); $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $value->getId());
$icon = ''; $icon = '';
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension()); $extensionType = \phpOMS\System\File\FileUtils::getExtensionType($value->getExtension());
@ -99,12 +99,12 @@ echo $this->getData('nav')->render();
<td><a href="<?= $url; ?>"><?= $this->printHtml($value->getCreatedBy()->getName1()); ?></a> <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> <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 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); <?php $list = \phpOMS\System\File\Local\Directory::list($path);
foreach ($list as $key => $value) : foreach ($list as $key => $value) :
$url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $media->getId() . '&sub=' . substr($value, strlen($media->getPath()))); $url = \phpOMS\Uri\UriFactory::build('/{/lang}/backend/media/single?{?}&id=' . $media->getId() . '&sub=' . substr($value, strlen($media->getPath())));
$icon = ''; $icon = '';
$extensionType = \phpOMS\System\File\FileUtils::getExtensionType(!is_dir($value) ? \phpOMS\System\File\Local\File::extension($value) : 'collection'); $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'; $icon = 'file-code-o';
} elseif ($extensionType === \phpOMS\System\File\ExtensionType::TEXT) { } elseif ($extensionType === \phpOMS\System\File\ExtensionType::TEXT) {
@ -144,7 +144,7 @@ echo $this->getData('nav')->render();
<div class="col-xs-12"> <div class="col-xs-12">
<section class="box wf-100"> <section class="box wf-100">
<div class="inner"> <div class="inner">
<?php <?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(); $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> <div class="h-overflow"><img src="<?= $media->isAbsolute() ? $this->printHtml($path) : $this->printHtml($this->request->getUri()->getBase() . $path); ?>"></div>