From b91f20875ae788b44087a8ca67c2e5b2ded5871d Mon Sep 17 00:00:00 2001 From: Shish Date: Sun, 26 May 2019 16:15:43 +0100 Subject: [PATCH] put upload block on every page --- ext/upload/main.php | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/ext/upload/main.php b/ext/upload/main.php index 5ac90ac3..64e6ae91 100644 --- a/ext/upload/main.php +++ b/ext/upload/main.php @@ -82,18 +82,6 @@ class Upload extends Extension { } } - public function onPostListBuilding(PostListBuildingEvent $event) { - global $user, $page; - if($user->can("create_image")) { - if($this->is_full) { - $this->theme->display_full($page); - } - else { - $this->theme->display_block($page); - } - } - } - public function onSetupBuilding(SetupBuildingEvent $event) { $tes = array(); $tes["Disabled"] = "none"; @@ -130,6 +118,15 @@ class Upload extends Extension { public function onPageRequest(PageRequestEvent $event) { global $database, $page, $user; + if($user->can("create_image")) { + if($this->is_full) { + $this->theme->display_full($page); + } + else { + $this->theme->display_block($page); + } + } + if($event->page_matches("upload/replace")) { // check if the user is an administrator and can upload files. if(!$user->can("replace_image")) {