diff --git a/ext/tag_edit/main.php b/ext/tag_edit/main.php index 0c74993d..4b35f9a6 100644 --- a/ext/tag_edit/main.php +++ b/ext/tag_edit/main.php @@ -66,7 +66,13 @@ class TagEdit implements Extension { if($event instanceof ImageInfoBoxBuildingEvent) { global $user; - $event->add_part($this->theme->get_editor_html($event->image, $user), 40); + global $config; + if($config->get_bool("tag_edit_anon") || !$user->is_anonymous()) { + $event->add_part($this->theme->get_tag_editor_html($event->image), 40); + } + if($config->get_bool("source_edit_anon") || !$user->is_anonymous()) { + $event->add_part($this->theme->get_source_editor_html($event->image), 41); + } } if($event instanceof SetupBuildingEvent) { diff --git a/ext/tag_edit/theme.php b/ext/tag_edit/theme.php index 2e32c426..13838605 100644 --- a/ext/tag_edit/theme.php +++ b/ext/tag_edit/theme.php @@ -18,28 +18,14 @@ class TagEditTheme extends Themelet { $page->add_block(new Block("Mass Tag Edit", $html)); } - public function get_editor_html($image, $user) { - $html = ""; + public function get_tag_editor_html($image) { + $h_tags = html_escape($image->get_tag_list()); + return "Tags"; + } - - global $config; - if($config->get_bool("tag_edit_anon") || !$user->is_anonymous()) { - $h_tags = html_escape($image->get_tag_list()); - $h_source = html_escape($image->get_source()); - $i_image_id = int_escape($image->id); - - $source_edit = ""; - if($config->get_bool("source_edit_anon") || !$user->is_anonymous()) { - $source_edit = "Source"; - } - - $html .= " - Tags - $source_edit - "; - } - - return $html; + public function get_source_editor_html($image) { + $h_source = html_escape($image->get_source()); + return "Source"; } } ?> diff --git a/ext/view/theme.php b/ext/view/theme.php index f6e9e7bb..7ff09570 100644 --- a/ext/view/theme.php +++ b/ext/view/theme.php @@ -90,6 +90,8 @@ class ViewImageTheme extends Themelet { } protected function build_image_editor($image, $editor_parts) { + if(count($editor_parts) == 0) return ""; + if(isset($_GET['search'])) {$h_query = "search=".url_escape($_GET['search']);} else {$h_query = "";}