This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/image/theme.php
2024-01-19 19:07:03 +00:00

24 lines
715 B
PHP

<?php
declare(strict_types=1);
namespace Shimmie2;
use function MicroHTML\{INPUT, emptyHTML};
class ImageIOTheme extends Themelet
{
/**
* Display a link to delete an image
* (Added inline Javascript to confirm the deletion)
*/
public function get_deleter_html(int $image_id): \MicroHTML\HTMLElement
{
$form = SHM_FORM("image/delete", form_id: "image_delete_form");
$form->appendChild(emptyHTML(
INPUT(["type" => 'hidden', "name" => 'image_id', "value" => $image_id]),
INPUT(["type" => 'submit', "value" => 'Delete', "onclick" => 'return confirm("Delete the image?");', "id" => "image_delete_button"]),
));
return $form;
}
}