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

37 lines
975 B
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
namespace Shimmie2;
2023-07-10 18:03:54 +00:00
use MicroHTML\HTMLElement;
use function MicroHTML\emptyHTML;
2024-02-11 14:51:55 +00:00
use function MicroHTML\{BUTTON,P};
2019-10-14 18:35:33 +00:00
class ApprovalTheme extends Themelet
{
2023-07-10 18:03:54 +00:00
public function get_help_html(): HTMLElement
2019-10-14 18:35:33 +00:00
{
2023-07-10 18:03:54 +00:00
return emptyHTML(
P("Search for posts that are approved/not approved."),
SHM_COMMAND_EXAMPLE("approved:yes", "Returns posts that have been approved."),
SHM_COMMAND_EXAMPLE("approved:no", "Returns posts that have not been approved.")
);
2019-10-14 18:35:33 +00:00
}
public function display_admin_form(): void
2019-10-14 18:35:33 +00:00
{
global $page;
2019-10-14 19:40:15 +00:00
2023-07-10 18:03:54 +00:00
$form = SHM_SIMPLE_FORM(
2020-01-30 10:31:11 +00:00
"admin/approval",
2023-11-11 21:49:12 +00:00
BUTTON(["name" => 'approval_action', "value" => 'approve_all'], "Approve All Posts"),
2023-07-10 18:03:54 +00:00
" ",
2023-11-11 21:49:12 +00:00
BUTTON(["name" => 'approval_action', "value" => 'disapprove_all'], "Disapprove All Posts"),
2020-01-26 23:12:48 +00:00
);
2023-07-10 18:03:54 +00:00
$page->add_block(new Block("Approval", $form));
2019-10-14 18:35:33 +00:00
}
}