mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-12 15:28:41 +00:00
bug fixes and template adjustments
This commit is contained in:
parent
6dee9b7de2
commit
d038fa7c53
|
|
@ -209,8 +209,8 @@ final class ApiController extends Controller
|
||||||
*/
|
*/
|
||||||
public static function createMediaPath(string $basePath = '/Modules/Media/Files') : string
|
public static function createMediaPath(string $basePath = '/Modules/Media/Files') : string
|
||||||
{
|
{
|
||||||
$rndPath = \str_pad(\dechex(\mt_rand(0, 65535)), 4, '0', \STR_PAD_LEFT);
|
$rndPath = \str_pad(\dechex(\mt_rand(0, 4294967295)), 8, '0', \STR_PAD_LEFT);
|
||||||
return $basePath . '/_' . $rndPath[0] . $rndPath[1] . '/' . $rndPath[2] . $rndPath[3];
|
return $basePath . '/_' . $rndPath[0] . $rndPath[1] . $rndPath[2] . $rndPath[3] . '/_' . $rndPath[4] . $rndPath[5] . $rndPath[6] . $rndPath[7];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ final class CollectionMapper extends MediaMapper
|
||||||
public static function getByVirtualPath(string $virtualPath = '/', bool $hidden = false) : array
|
public static function getByVirtualPath(string $virtualPath = '/', bool $hidden = false) : array
|
||||||
{
|
{
|
||||||
$depth = 3;
|
$depth = 3;
|
||||||
$query = self::getQuery();
|
$query = self::getQuery(depth: $depth);
|
||||||
$query->where(self::$table . '_d' . $depth . '.media_virtual', '=', $virtualPath);
|
$query->where(self::$table . '_d' . $depth . '.media_virtual', '=', $virtualPath);
|
||||||
$query->where(self::$table . '_d' . $depth . '.media_collection', '=', 1);
|
$query->where(self::$table . '_d' . $depth . '.media_collection', '=', 1);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,7 +140,7 @@ class MediaMapper extends DataMapperAbstract
|
||||||
public static function getByVirtualPath(string $virtualPath = '/', bool $hidden = false) : array
|
public static function getByVirtualPath(string $virtualPath = '/', bool $hidden = false) : array
|
||||||
{
|
{
|
||||||
$depth = 3;
|
$depth = 3;
|
||||||
$query = self::getQuery();
|
$query = self::getQuery(depth: $depth);
|
||||||
$query->where(self::$table . '_d' . $depth . '.media_virtual', '=', $virtualPath);
|
$query->where(self::$table . '_d' . $depth . '.media_virtual', '=', $virtualPath);
|
||||||
|
|
||||||
if ($hidden === false) {
|
if ($hidden === false) {
|
||||||
|
|
|
||||||
|
|
@ -164,6 +164,7 @@ $next = empty($media) ? '{/prefix}media/list' : '{/prefix}media/list?{?}&id=
|
||||||
<td>
|
<td>
|
||||||
<td>
|
<td>
|
||||||
<td>
|
<td>
|
||||||
|
<td>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
<?php $count = 0;
|
<?php $count = 0;
|
||||||
foreach ($media as $key => $value) :
|
foreach ($media as $key => $value) :
|
||||||
|
|
@ -199,11 +200,11 @@ $next = empty($media) ? '{/prefix}media/list' : '{/prefix}media/list?{?}&id=
|
||||||
<td data-label="<?= $this->getHtml('Size'); ?>"><a href="<?= $url; ?>"><?php
|
<td data-label="<?= $this->getHtml('Size'); ?>"><a href="<?= $url; ?>"><?php
|
||||||
$size = FileSizeType::autoFormat($value->size);
|
$size = FileSizeType::autoFormat($value->size);
|
||||||
echo $this->printHtml($value->extension !== 'collection' ? \number_format($size[0], 1, '.', ',') . $size[1] : ''); ?></a>
|
echo $this->printHtml($value->extension !== 'collection' ? \number_format($size[0], 1, '.', ',') . $size[1] : ''); ?></a>
|
||||||
<td data-label="<?= $this->getHtml('Creator'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->createdBy->name1); ?></a>
|
<td data-label="<?= $this->getHtml('Creator'); ?>"><a class="content" href="<?= UriFactory::build('{/prefix}profile/single?{?}&for=' . $value->createdBy->getId()); ?>"><?= $this->printHtml($value->createdBy->name1); ?></a>
|
||||||
<td data-label="<?= $this->getHtml('Created'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->createdAt->format('Y-m-d')); ?></a>
|
<td data-label="<?= $this->getHtml('Created'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($value->createdAt->format('Y-m-d')); ?></a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if ($count === 0) : ?>
|
<?php if ($count === 0) : ?>
|
||||||
<tr><td colspan="6" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
<tr><td colspan="8" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</table>
|
</table>
|
||||||
<div class="portlet-foot">
|
<div class="portlet-foot">
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": ">=9.4",
|
"phpunit/phpunit": ">=9.4",
|
||||||
"friendsofphp/php-cs-fixer": ">=3.0",
|
"friendsofphp/php-cs-fixer": ">=3.0",
|
||||||
"squizlabs/php_codesniffer": ">=3.5",
|
"squizlabs/php_codesniffer": ">=3.6",
|
||||||
"phpmd/phpmd": ">=2.9",
|
"phpmd/phpmd": ">=2.9",
|
||||||
"phpstan/phpstan": ">=0.12.58",
|
"phpstan/phpstan": ">=0.12.58",
|
||||||
"phan/phan": ">=3.2.6"
|
"phan/phan": ">=3.2.6"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user