'avatar', // required — input name attribute * 'accept' => 'image/*', // required — accepted file types * 'hint' => t('Allowed file types: SVG, PNG, JPG, WEBP'),// optional — hint text below dropzone label * 'currentSrc' => 'admin/tenants/logo-file?uuid=…&theme=light&size=128', // optional — URL of existing server file * 'currentLabel' => t('Current image'), // optional — label for current file preview * 'deleteAction' => 'admin/tenants/logo-delete/…', // optional — formaction for delete button (requires currentSrc) * 'deleteConfirm' => t('Delete this image?'), // optional — confirm message on delete * 'required' => false, // optional — make input required * 'formId' => 'tenant-logo-light-form', // optional — HTML5 form attribute to associate input with an external form * 'deleteFormId' => 'tenant-logo-light-delete-form', // optional — HTML5 form attribute for the delete button (bypasses formaction) * ]; * require templatePath('partials/app-file-upload.phtml'); * * @var array $fileUpload */ $fileUpload = is_array($fileUpload ?? null) ? $fileUpload : []; $uploadName = trim((string) ($fileUpload['name'] ?? '')); if ($uploadName === '') { return; } $uploadAccept = trim((string) ($fileUpload['accept'] ?? '')); $uploadHint = trim((string) ($fileUpload['hint'] ?? '')); $uploadCurrentSrc = trim((string) ($fileUpload['currentSrc'] ?? '')); $uploadCurrentLabel = trim((string) ($fileUpload['currentLabel'] ?? t('Current image'))); $uploadDeleteAction = trim((string) ($fileUpload['deleteAction'] ?? '')); $uploadDeleteConfirm = trim((string) ($fileUpload['deleteConfirm'] ?? t('Delete this image?'))); $uploadRequired = (bool) ($fileUpload['required'] ?? false); $uploadFormId = trim((string) ($fileUpload['formId'] ?? '')); $uploadDeleteFormId = trim((string) ($fileUpload['deleteFormId'] ?? '')); $hasCurrent = $uploadCurrentSrc !== ''; $hasDelete = $hasCurrent && ($uploadDeleteAction !== '' || $uploadDeleteFormId !== ''); ?>
data-current-src="">
<?php e($uploadCurrentLabel); ?>