From cafab6b8de9d4630433faec3bbd77a3a66495342 Mon Sep 17 00:00:00 2001 From: Giraffaman Date: Sat, 13 Apr 2024 00:56:09 +0200 Subject: [PATCH] --- ext/rating/main.php | 5 ++++- ext/rating/theme.php | 2 +- ext/upload/theme.php | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ext/rating/main.php b/ext/rating/main.php index d6fd30c99..ecc51a473 100644 --- a/ext/rating/main.php +++ b/ext/rating/main.php @@ -530,7 +530,10 @@ public function onUploadHeaderBuilding(UploadHeaderBuildingEvent $event): void public function onUploadSpecificBuilding(UploadSpecificBuildingEvent $event): void { - $event->add_part($this->theme->get_upload_specific_rater_html($event->suffix)); + global $config + if($config->get_bool(UploadConfig::ALLOW_SPECIFIC_RATINGS)) { + $event->add_part($this->theme->get_upload_specific_rater_html($event->suffix)); + } } /** diff --git a/ext/rating/theme.php b/ext/rating/theme.php index 05b0d511a..fb3e12f25 100644 --- a/ext/rating/theme.php +++ b/ext/rating/theme.php @@ -31,7 +31,7 @@ public function get_image_rater_html(int $image_id, string $rating, bool $can_ra public function get_upload_specific_rater_html(string $suffix): HTMLElement { - return TD($this->get_selection_rater_html(name:"rating{$suffix}", selected_options: [""])); + return TD($this->get_selection_rater_html(name:"rating{$suffix}", selected_options: ["?"])); } /** diff --git a/ext/upload/theme.php b/ext/upload/theme.php index 08609ce29..e5418211a 100644 --- a/ext/upload/theme.php +++ b/ext/upload/theme.php @@ -127,7 +127,9 @@ protected function build_upload_list(): HTMLElement } for ($i = 0; $i < $form_count; $i++) { $specific_fields = emptyHTML(); - $usfbe = send_event(new UploadSpecificBuildingEvent((string)$i)); + if($config->get_bool(UploadConfig::ALLOW_SPECIFIC_TAGS)) { + $usfbe = send_event(new UploadSpecificBuildingEvent((string)$i)); + } foreach ($usfbe->get_parts() as $part) { $specific_fields->appendChild($part); }