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_hash_ban/theme.php

33 lines
933 B
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
2020-01-26 13:19:35 +00:00
use function MicroHTML\INPUT;
class ImageBanTheme extends Themelet
{
/*
* Show all the bans
*/
public function display_bans(Page $page, $table, $paginator): void
{
2020-10-26 15:16:21 +00:00
$page->set_title("Post Bans");
$page->set_heading("Post Bans");
2019-11-29 01:52:24 +00:00
$page->add_block(new NavBlock());
2020-10-26 15:16:21 +00:00
$page->add_block(new Block("Edit Post Bans", $table . $paginator));
}
/*
* Display a link to delete an image
*/
public function get_buttons_html(Image $image): string
{
2020-01-26 13:19:35 +00:00
return (string)SHM_SIMPLE_FORM(
2020-01-30 10:31:11 +00:00
"image_hash_ban/add",
2020-01-26 13:19:35 +00:00
INPUT(["type"=>'hidden', "name"=>'c_hash', "value"=>$image->hash]),
INPUT(["type"=>'hidden', "name"=>'c_image_id', "value"=>$image->id]),
INPUT(["type"=>'text', "name"=>'c_reason']),
2020-10-26 15:16:21 +00:00
INPUT(["type"=>'submit', "value"=>'Ban Hash and Delete Post']),
2020-01-26 13:19:35 +00:00
);
}
}