Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| BaseView | n/a |
0 / 0 |
n/a |
0 / 0 |
2 | n/a |
0 / 0 |
|||
| __construct | n/a |
0 / 0 |
n/a |
0 / 0 |
1 | |||||
| render | n/a |
0 / 0 |
n/a |
0 / 0 |
1 | |||||
| 1 | <?php |
| 2 | /** |
| 3 | * Jingga |
| 4 | * |
| 5 | * PHP Version 8.1 |
| 6 | * |
| 7 | * @package Modules\Media |
| 8 | * @copyright Dennis Eichhorn |
| 9 | * @license OMS License 2.0 |
| 10 | * @version 1.0.0 |
| 11 | * @link https://jingga.app |
| 12 | */ |
| 13 | declare(strict_types=1); |
| 14 | |
| 15 | namespace Modules\Media\Theme\Backend\Components\Upload; |
| 16 | |
| 17 | use phpOMS\Localization\L11nManager; |
| 18 | use phpOMS\Message\RequestAbstract; |
| 19 | use phpOMS\Message\ResponseAbstract; |
| 20 | use phpOMS\Views\View; |
| 21 | |
| 22 | /** |
| 23 | * Component view. |
| 24 | * |
| 25 | * @package Modules\Media |
| 26 | * @license OMS License 2.0 |
| 27 | * @link https://jingga.app |
| 28 | * @since 1.0.0 |
| 29 | * @codeCoverageIgnore |
| 30 | */ |
| 31 | class BaseView extends View |
| 32 | { |
| 33 | /** |
| 34 | * Form id |
| 35 | * |
| 36 | * @var string |
| 37 | * @since 1.0.0 |
| 38 | */ |
| 39 | public string $form = ''; |
| 40 | |
| 41 | /** |
| 42 | * Virtual path of the media file |
| 43 | * |
| 44 | * @var string |
| 45 | * @since 1.0.0 |
| 46 | */ |
| 47 | public string $virtualPath = ''; |
| 48 | |
| 49 | /** |
| 50 | * Name of the image preview |
| 51 | * |
| 52 | * @var string |
| 53 | * @since 1.0.0 |
| 54 | */ |
| 55 | public string $name = ''; |
| 56 | |
| 57 | public array $files = []; |
| 58 | |
| 59 | /** |
| 60 | * {@inheritdoc} |
| 61 | */ |
| 62 | public function __construct(L11nManager $l11n = null, RequestAbstract $request, ResponseAbstract $response) |
| 63 | { |
| 64 | parent::__construct($l11n, $request, $response); |
| 65 | $this->setTemplate('/Modules/Media/Theme/Backend/Components/Upload/upload-list'); |
| 66 | } |
| 67 | |
| 68 | /** |
| 69 | * {@inheritdoc} |
| 70 | */ |
| 71 | public function render(mixed ...$data) : string |
| 72 | { |
| 73 | /** @var array{0:string, 1?:string, 2?:string} $data */ |
| 74 | $this->form = $data[0]; |
| 75 | $this->name = $data[1] ?? 'UNDEFINED'; |
| 76 | $this->virtualPath = $data[2] ?? $this->virtualPath; |
| 77 | $this->files = $data[3] ?? $this->files; |
| 78 | return parent::render(); |
| 79 | } |
| 80 | } |