*image_ad* is blocked by opera, which makes use of image_admin a pain...

This commit is contained in:
Shish 2012-04-01 16:06:11 +01:00
parent ab128b4b24
commit 664e6fa509
2 changed files with 12 additions and 12 deletions

View File

@ -150,15 +150,7 @@ class ImageIO extends Extension {
}
public function onPageRequest(PageRequestEvent $event) {
if($event->page_matches("image")) {
$num = int_escape($event->get_arg(0));
$this->send_file($num, "image");
}
if($event->page_matches("thumb")) {
$num = int_escape($event->get_arg(0));
$this->send_file($num, "thumb");
}
if($event->page_matches("image_admin/delete")) {
if($event->page_matches("image/delete")) {
global $page, $user;
if($user->can("delete_image") && isset($_POST['image_id']) && $user->check_auth_token()) {
$image = Image::by_id($_POST['image_id']);
@ -174,7 +166,7 @@ class ImageIO extends Extension {
}
}
}
if($event->page_matches("image_admin/replace")) {
else if($event->page_matches("image/replace")) {
global $page, $user;
if($user->can("replace_image") && isset($_POST['image_id']) && $user->check_auth_token()) {
$image = Image::by_id($_POST['image_id']);
@ -187,6 +179,14 @@ class ImageIO extends Extension {
}
}
}
else if($event->page_matches("image")) {
$num = int_escape($event->get_arg(0));
$this->send_file($num, "image");
}
else if($event->page_matches("thumb")) {
$num = int_escape($event->get_arg(0));
$this->send_file($num, "thumb");
}
}
public function onImageAdminBlockBuilding(ImageAdminBlockBuildingEvent $event) {

View File

@ -10,7 +10,7 @@ class ImageIOTheme {
global $config;
$html = "
".make_form(make_link("image_admin/delete"))."
".make_form(make_link("image/delete"))."
<input type='hidden' name='image_id' value='$image_id' />
<input type='submit' value='Delete' onclick='return confirm(\"Delete the image?\");' />
</form>
@ -25,7 +25,7 @@ class ImageIOTheme {
* @param $image_id The image to replace
*/
public function get_replace_html(/*int*/ $image_id) {
$html = make_form(make_link("image_admin/replace"))."
$html = make_form(make_link("image/replace"))."
<input type='hidden' name='image_id' value='$image_id' />
<input type='submit' value='Replace' />
</form>";