set_title("Image {$image->id}: ".html_escape($image->get_tag_list())); $page->set_heading(html_escape($image->get_tag_list())); $page->add_block(new Block(null, $this->build_pin($image), "subtoolbar", 0)); $page->add_block(new Block(null, $this->build_info($image, $editor_parts), "left", 20)); } public function display_admin_block(Page $page, $parts) { if (count($parts) > 0) { $page->add_block(new Block("Image Controls", join("
", $parts), "drawer", 50)); } } protected function build_pin(Image $image) { global $database; if (isset($_GET['search'])) { $search_terms = explode(' ', $_GET['search']); $query = "search=".url_escape($_GET['search']); } else { $search_terms = []; $query = null; } $h_prev = 'id}", $query).'">Prev'; $h_index = "Current"; $h_next = 'id}", $query).'">Next'; return $h_prev.$h_index.$h_next; } protected function build_info(Image $image, $editor_parts) { global $user; if (count($editor_parts) == 0) { return ($image->is_locked() ? "
[Image Locked]" : ""); } $html = make_form(make_link("post/set"))." "; foreach ($editor_parts as $part) { $html .= $part; } if ( (!$image->is_locked() || $user->can("edit_image_lock")) && $user->can("edit_image_tag") ) { $html .= " "; } $html .= "
"; return $html; } }