put the bulk rater on the search results
This commit is contained in:
parent
49c0d09281
commit
b9476c1ff4
@ -49,9 +49,13 @@ class Ratings extends Extension {
|
||||
$event->panel->add_block($sb);
|
||||
}
|
||||
|
||||
public function onAdminBuilding(AdminBuildingEvent $event) {
|
||||
$this->theme->display_bulk_rater();
|
||||
public function onPostListBuilding(PostListBuildingEvent $event) {
|
||||
global $user;
|
||||
if($user->is_admin() && !empty($event->search_terms)) {
|
||||
$this->theme->display_bulk_rater(implode(" ", $event->search_terms));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function onDisplayingImage(DisplayingImageEvent $event) {
|
||||
global $user, $database, $page;
|
||||
@ -144,7 +148,7 @@ class Ratings extends Extension {
|
||||
# on image_tags.tag_id = tags.id where tags.tag = ?);
|
||||
# ", array($_POST["rating"], $_POST["tag"]));
|
||||
$page->set_mode("redirect");
|
||||
$page->set_redirect(make_link("admin"));
|
||||
$page->set_redirect(make_link("post/list"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -19,35 +19,21 @@ class RatingsTheme extends Themelet {
|
||||
return $html;
|
||||
}
|
||||
|
||||
public function display_bulk_rater() {
|
||||
public function display_bulk_rater($terms) {
|
||||
global $page;
|
||||
$html = "
|
||||
".make_form(make_link("admin/bulk_rate"))."
|
||||
<table class='form'>
|
||||
<tr>
|
||||
<th>Search</th>
|
||||
<td>
|
||||
<input type='text' name='query'>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Rating</th>
|
||||
<td>
|
||||
<select name='rating'>
|
||||
<option value='s'>Safe</option>
|
||||
<option value='q'>Questionable</option>
|
||||
<option value='e'>Explicit</option>
|
||||
<option value='u'>Unrated</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='2'><input type='submit' value='Go'></td>
|
||||
</tr>
|
||||
</table>
|
||||
<input type='hidden' name='query' value='".html_escape($terms)."'>
|
||||
<select name='rating'>
|
||||
<option value='s'>Safe</option>
|
||||
<option value='q'>Questionable</option>
|
||||
<option value='e'>Explicit</option>
|
||||
<option value='u'>Unrated</option>
|
||||
</select>
|
||||
<input type='submit' value='Go'>
|
||||
</form>
|
||||
";
|
||||
$page->add_block(new Block("Bulk Rating", $html));
|
||||
$page->add_block(new Block("List Controls", $html, "left"));
|
||||
}
|
||||
|
||||
public function rating_to_name(/*string*/ $rating) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user