From 84d232ca0d7390fa2317679cfe0a9c4a054504b8 Mon Sep 17 00:00:00 2001 From: Luana Date: Wed, 28 Jun 2023 16:40:39 -0300 Subject: [PATCH] build_selector returns HTMLElement --- core/basethemelet.php | 4 ++-- ext/pools/theme.php | 5 ++--- ext/rating/theme.php | 6 +++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/core/basethemelet.php b/core/basethemelet.php index 3461eed3..1d3735f6 100644 --- a/core/basethemelet.php +++ b/core/basethemelet.php @@ -202,7 +202,7 @@ class BaseThemelet * @param bool $empty_option Whether the first option should be an empty one. * @param array $selected_options The values of options that should be pre-selected. */ - protected function build_selector(string $name, array $options, bool $required=false, bool $multiple=false, bool $empty_option=false, array $selected_options=[]): string + protected function build_selector(string $name, array $options, bool $required=false, bool $multiple=false, bool $empty_option=false, array $selected_options=[]): HTMLElement { $attrs = []; if ($required) { @@ -228,6 +228,6 @@ class BaseThemelet } } - return (string)$s; + return $s; } } diff --git a/ext/pools/theme.php b/ext/pools/theme.php index 9dd7962f..f0c0eca1 100644 --- a/ext/pools/theme.php +++ b/ext/pools/theme.php @@ -41,8 +41,7 @@ class PoolsTheme extends Themelet public function get_adder_html(Image $image, array $pools): string { $selector = $this->build_selector("pool_id", $pools); - return "\n" . make_form(make_link("pool/add_post")) . " - $selector + return "\n" . make_form(make_link("pool/add_post")) . $selector . " @@ -388,7 +387,7 @@ class PoolsTheme extends Themelet public function get_bulk_pool_selector(array $options): string { - return $this->build_selector("bulk_pool_select", $options, required: true, empty_option: true); + return (string)$this->build_selector("bulk_pool_select", $options, required: true, empty_option: true); } public function get_bulk_pool_input(array $search_terms): string diff --git a/ext/rating/theme.php b/ext/rating/theme.php index 895a3633..f33ed906 100644 --- a/ext/rating/theme.php +++ b/ext/rating/theme.php @@ -33,8 +33,8 @@ class RatingsTheme extends Themelet $html = make_form(make_link("admin/update_ratings")).""; - $html .= ""; - $html .= ""; + $html .= ""; + $html .= ""; $html .= "
Change".$this->build_selector("rating_old", $current_ratings, required: true)."
To".$this->build_selector("rating_new", Ratings::get_ratings_dict(), required: true)."
Change" . $this->build_selector("rating_old", $current_ratings, required: true) . "
To" . $this->build_selector("rating_new", Ratings::get_ratings_dict(), required: true) . "
\n"; @@ -44,7 +44,7 @@ class RatingsTheme extends Themelet public function get_selection_rater_html(array $selected_options, bool $multiple = false): string { - return $this->build_selector("rating", Ratings::get_ratings_dict(), multiple: $multiple, empty_option: false, selected_options: $selected_options); + return (string)$this->build_selector("rating", Ratings::get_ratings_dict(), multiple: $multiple, empty_option: false, selected_options: $selected_options); } public function get_help_html(array $ratings): string