set_title("Admin Tools"); $page->set_heading("Admin Tools"); $page->add_block(new NavBlock()); } protected function button(/*string*/ $name, /*string*/ $action, /*boolean*/ $protected=false) { $c_protected = $protected ? " protected" : ""; $html = make_form(make_link("admin/$action"), "POST", false, false, false, "admin$c_protected"); if($protected) { $html .= ""; $html .= ""; } else { $html .= ""; } $html .= "\n"; return $html; } /* * Show a form which links to admin_utils with POST[action] set to one of: * 'lowercase all tags' * 'recount tag use' * 'purge unused tags' */ public function display_form() { global $page, $database; $html = ""; $html .= $this->button("All tags to lowercase", "lowercase_all_tags", true); $html .= $this->button("Recount tag use", "recount_tag_user", false); $html .= $this->button("Purge unused tags", "purge_unused_tags", true); $html .= $this->button("Download all images", "image_dump", false); if($database->engine->name == "mysql") { $html .= $this->button("Download database contents", "database_dump", false); $html .= $this->button("Reset image IDs", "reset_image_ids", true); } $page->add_block(new Block("Misc Admin Tools", $html)); } public function display_dbq($terms) { global $page; $h_terms = html_escape($terms); $html = make_form(make_link("admin/delete_by_query"), "POST") . " "; $page->add_block(new Block("List Controls", $html, "left")); } } ?>