diff --git a/ext/pools/main.php b/ext/pools/main.php index 93e395f2..d4d38de7 100644 --- a/ext/pools/main.php +++ b/ext/pools/main.php @@ -473,7 +473,7 @@ class Pools extends Extension $pools = $database->get_pairs("SELECT id,title FROM pools WHERE user_id=:id ORDER BY title", ["id" => $user->id]); } if (count($pools) > 0) { - $event->add_part($this->theme->get_adder_html($event->image, $pools)); + $event->add_part((string)$this->theme->get_adder_html($event->image, $pools)); } } } diff --git a/ext/pools/theme.php b/ext/pools/theme.php index 50c83516..7f9e4ea2 100644 --- a/ext/pools/theme.php +++ b/ext/pools/theme.php @@ -42,14 +42,15 @@ class PoolsTheme extends Themelet } } - public function get_adder_html(Image $image, array $pools): string + public function get_adder_html(Image $image, array $pools): HTMLElement { - $selector = $this->build_selector("pool_id", $pools); - return "\n" . make_form(make_link("pool/add_post")) . $selector . " - - - - "; + $form = make_form_microhtml(make_link("pool/add_post")); + + $form->appendChild($this->build_selector("pool_id", $pools)); + $form->appendChild(INPUT(["type"=>"hidden", "name"=>"image_id", "value"=>$image->id])); + $form->appendChild(INPUT(["type"=>"submit", "value"=>"Add Post to Pool"])); + + return $form; } /**