From 664e6fa50905af476e6ab4125c769d2893425407 Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 1 Apr 2012 16:06:11 +0100 Subject: [PATCH] *image_ad* is blocked by opera, which makes use of image_admin a pain... --- ext/image/main.php | 20 ++++++++++---------- ext/image/theme.php | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ext/image/main.php b/ext/image/main.php index 20ac615d..98f041fc 100644 --- a/ext/image/main.php +++ b/ext/image/main.php @@ -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) { diff --git a/ext/image/theme.php b/ext/image/theme.php index 02dddc8e..03f275c3 100644 --- a/ext/image/theme.php +++ b/ext/image/theme.php @@ -10,7 +10,7 @@ class ImageIOTheme { global $config; $html = " - ".make_form(make_link("image_admin/delete"))." + ".make_form(make_link("image/delete"))." @@ -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"))." ";