approved===true) { $html = SHM_SIMPLE_FORM( 'disapprove_image/'.$image->id, INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image->id]), SHM_SUBMIT("Disapprove") ); } else { $html = SHM_SIMPLE_FORM( 'approve_image/'.$image->id, INPUT(["type"=>'hidden', "name"=>'image_id', "value"=>$image->id]), SHM_SUBMIT("Approve") ); } return (string)$html; } public function get_help_html() { return '

Search for images that are approved/not approved.

approved:yes

Returns images that have been approved.

approved:no

Returns images that have not been approved.

'; } public function display_admin_block(SetupBuildingEvent $event) { $sb = new SetupBlock("Approval"); $sb->add_bool_option(ApprovalConfig::IMAGES, "Images: "); $event->panel->add_block($sb); } public function display_admin_form() { global $page; $html = (string)SHM_SIMPLE_FORM( "admin/approval", BUTTON(["name"=>'approval_action', "value"=>'approve_all'], "Approve All Images"), BR(), BUTTON(["name"=>'approval_action', "value"=>'disapprove_all'], "Disapprove All Images"), ); $page->add_block(new Block("Approval", $html)); } }