have image admin controls block use microhtml consistently
This commit is contained in:
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace Shimmie2;
|
||||
|
||||
use function MicroHTML\INPUT;
|
||||
use function MicroHTML\{INPUT, SPAN};
|
||||
|
||||
class ImageIOTheme extends Themelet
|
||||
{
|
||||
@@ -12,12 +12,15 @@ 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): string
|
||||
public function get_deleter_html(int $image_id): \MicroHTML\HTMLElement
|
||||
{
|
||||
return (string)"<span id='image_delete_form'>".SHM_SIMPLE_FORM(
|
||||
"image/delete",
|
||||
INPUT(["type" => 'hidden', "name" => 'image_id', "value" => $image_id]),
|
||||
INPUT(["type" => 'submit', "value" => 'Delete', "onclick" => 'return confirm("Delete the image?");', "id" => "image_delete_button"]),
|
||||
)."</span>";
|
||||
return SPAN(
|
||||
["id"=>"image_delete_form"],
|
||||
SHM_SIMPLE_FORM(
|
||||
"image/delete",
|
||||
INPUT(["type" => 'hidden', "name" => 'image_id', "value" => $image_id]),
|
||||
INPUT(["type" => 'submit', "value" => 'Delete', "onclick" => 'return confirm("Delete the image?");', "id" => "image_delete_button"]),
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user