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);
|
$event->panel->add_block($sb);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onAdminBuilding(AdminBuildingEvent $event) {
|
public function onPostListBuilding(PostListBuildingEvent $event) {
|
||||||
$this->theme->display_bulk_rater();
|
global $user;
|
||||||
|
if($user->is_admin() && !empty($event->search_terms)) {
|
||||||
|
$this->theme->display_bulk_rater(implode(" ", $event->search_terms));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function onDisplayingImage(DisplayingImageEvent $event) {
|
public function onDisplayingImage(DisplayingImageEvent $event) {
|
||||||
global $user, $database, $page;
|
global $user, $database, $page;
|
||||||
@ -144,7 +148,7 @@ class Ratings extends Extension {
|
|||||||
# on image_tags.tag_id = tags.id where tags.tag = ?);
|
# on image_tags.tag_id = tags.id where tags.tag = ?);
|
||||||
# ", array($_POST["rating"], $_POST["tag"]));
|
# ", array($_POST["rating"], $_POST["tag"]));
|
||||||
$page->set_mode("redirect");
|
$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;
|
return $html;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function display_bulk_rater() {
|
public function display_bulk_rater($terms) {
|
||||||
global $page;
|
global $page;
|
||||||
$html = "
|
$html = "
|
||||||
".make_form(make_link("admin/bulk_rate"))."
|
".make_form(make_link("admin/bulk_rate"))."
|
||||||
<table class='form'>
|
<input type='hidden' name='query' value='".html_escape($terms)."'>
|
||||||
<tr>
|
<select name='rating'>
|
||||||
<th>Search</th>
|
<option value='s'>Safe</option>
|
||||||
<td>
|
<option value='q'>Questionable</option>
|
||||||
<input type='text' name='query'>
|
<option value='e'>Explicit</option>
|
||||||
</td>
|
<option value='u'>Unrated</option>
|
||||||
</tr>
|
</select>
|
||||||
<tr>
|
<input type='submit' value='Go'>
|
||||||
<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>
|
|
||||||
</form>
|
</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) {
|
public function rating_to_name(/*string*/ $rating) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user