pool adder MicroHTML

This commit is contained in:
Luana 2023-06-29 14:58:41 -03:00 committed by Shish
parent 98aca16e73
commit d47df46a7f
2 changed files with 9 additions and 8 deletions

View file

@ -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));
}
}
}

View file

@ -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 . "
<input type='hidden' name='image_id' value='{$image->id}'>
<input type='submit' value='Add Post to Pool'>
</form>
";
$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;
}
/**