put upload block on every page
This commit is contained in:
		
							parent
							
								
									f4c18930ce
								
							
						
					
					
						commit
						b91f20875a
					
				| @ -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) { | 	public function onSetupBuilding(SetupBuildingEvent $event) { | ||||||
| 		$tes = array(); | 		$tes = array(); | ||||||
| 		$tes["Disabled"] = "none"; | 		$tes["Disabled"] = "none"; | ||||||
| @ -130,6 +118,15 @@ class Upload extends Extension { | |||||||
| 	public function onPageRequest(PageRequestEvent $event) { | 	public function onPageRequest(PageRequestEvent $event) { | ||||||
| 		global $database, $page, $user; | 		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")) { | 		if($event->page_matches("upload/replace")) { | ||||||
| 			// check if the user is an administrator and can upload files.
 | 			// check if the user is an administrator and can upload files.
 | ||||||
| 			if(!$user->can("replace_image")) { | 			if(!$user->can("replace_image")) { | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user