mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-16 01:08:41 +00:00
Allow name for upload form data
This commit is contained in:
parent
d2b894f4a7
commit
549fe0bc59
58
Theme/Backend/Components/InlinePreview/BaseView.php
Normal file
58
Theme/Backend/Components/InlinePreview/BaseView.php
Normal file
|
|
@ -0,0 +1,58 @@
|
||||||
|
<?php
|
||||||
|
/**
|
||||||
|
* Orange Management
|
||||||
|
*
|
||||||
|
* PHP Version 7.4
|
||||||
|
*
|
||||||
|
* @package TBD
|
||||||
|
* @copyright Dennis Eichhorn
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @version 1.0.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
*/
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Modules\Media\Theme\Backend\Components\InlinePreview;
|
||||||
|
|
||||||
|
use phpOMS\ApplicationAbstract;
|
||||||
|
use phpOMS\Message\RequestAbstract;
|
||||||
|
use phpOMS\Message\ResponseAbstract;
|
||||||
|
use phpOMS\Views\View;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Component view.
|
||||||
|
*
|
||||||
|
* @package TBD
|
||||||
|
* @license OMS License 1.0
|
||||||
|
* @link https://orange-management.org
|
||||||
|
* @since 1.0.0
|
||||||
|
* @codeCoverageIgnore
|
||||||
|
*/
|
||||||
|
class BaseView extends View
|
||||||
|
{
|
||||||
|
protected $form = '';
|
||||||
|
|
||||||
|
protected $virtualPath = '';
|
||||||
|
|
||||||
|
protected $name = '';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function __construct(ApplicationAbstract $app, RequestAbstract $request, ResponseAbstract $response)
|
||||||
|
{
|
||||||
|
parent::__construct($app, $request, $response);
|
||||||
|
$this->setTemplate('/Modules/Media/Theme/Backend/Components/InlinePreview/inline-preview');
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritdoc}
|
||||||
|
*/
|
||||||
|
public function render(...$data) : string
|
||||||
|
{
|
||||||
|
$this->form = $data[0];
|
||||||
|
$this->name = $data[1];
|
||||||
|
$this->virtualPath = $data[2] ?? '/';
|
||||||
|
return parent::render();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,30 @@
|
||||||
|
<div class="ipt-wrap">
|
||||||
|
<div class="ipt-first">
|
||||||
|
<div class="advancedInput wf-100" id="iMediaInput">
|
||||||
|
<input autocomplete="off" class="input" id="mediaInput" name="<?= $this->name; ?>-search" type="text" data-emptyAfter="true" data-autocomplete="false" data-src="api/media/find?search={#mediaInput}">
|
||||||
|
<div id="iMediaInput-dropdown" class="dropdown" data-active="true">
|
||||||
|
<table id="iMediaInput-table" class="default">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<td>ID<i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||||
|
<td>Name<i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||||
|
<td>Extension<i class="sort-asc fa fa-chevron-up"></i><i class="sort-desc fa fa-chevron-down"></i>
|
||||||
|
<tbody>
|
||||||
|
<template id="iMediaInput-rowElement" class="rowTemplate">
|
||||||
|
<tr tabindex="-1">
|
||||||
|
<td data-tpl-text="/id" data-tpl-value="/id" data-value=""></td>
|
||||||
|
<td data-tpl-text="/name" data-tpl-value="/name" data-value=""></td>
|
||||||
|
<td data-tpl-text="/extension"></td>
|
||||||
|
</tr>
|
||||||
|
</template>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="ipt-second"><button><?= $this->getHtml('Select', 'Media') ?></button></div>
|
||||||
|
</div>
|
||||||
|
<tr><td>
|
||||||
|
<input type="hidden" name="<?= $this->name; ?>-path" form="<?= $this->form; ?>" value="<?= $this->virtualPath; ?>">
|
||||||
|
<input type="file" id="i<?= $this->form; ?>-upload" class="preview" name="<?= $this->name; ?>" form="<?= $this->form; ?>" multiple>
|
||||||
|
<input form="<?= $this->form; ?>" type="hidden" name="media-list">
|
||||||
|
|
@ -34,6 +34,8 @@ class BaseView extends View
|
||||||
|
|
||||||
protected $virtualPath = '';
|
protected $virtualPath = '';
|
||||||
|
|
||||||
|
protected $name = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
|
|
@ -46,10 +48,11 @@ class BaseView extends View
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
public function render(...$data) : string
|
public function render(...$data): string
|
||||||
{
|
{
|
||||||
$this->form = $data[0];
|
$this->form = $data[0];
|
||||||
$this->virtualPath = $data[1] ?? '/';
|
$this->name = $data[1];
|
||||||
|
$this->virtualPath = $data[2] ?? '/';
|
||||||
return parent::render();
|
return parent::render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user