- Setup block added for Random Images List
This commit is contained in:
		
							parent
							
								
									8e6fe9f7e3
								
							
						
					
					
						commit
						a4b29f0254
					
				| @ -6,6 +6,8 @@ | |||||||
|  * License: GPLv2 |  * License: GPLv2 | ||||||
|  * Description: Allows displaying a page with random images |  * Description: Allows displaying a page with random images | ||||||
|  * Documentation:  |  * Documentation:  | ||||||
|  |  * Random image list can be accessed through www.yoursite.com/random | ||||||
|  |  * It is recommended that you create a link to this page so users know it exists. | ||||||
|  */ |  */ | ||||||
| 
 | 
 | ||||||
| class RandomList extends Extension { | class RandomList extends Extension { | ||||||
| @ -34,6 +36,21 @@ class RandomList extends Extension { | |||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|          |          | ||||||
|  |         public function onInitExt(InitExtEvent $event) { | ||||||
|  |             global $config; | ||||||
|  |             $config->set_default_int("random_images_list_count", 12); | ||||||
|  |         } | ||||||
|  |          | ||||||
|  |         public function onSetupBuilding(SetupBuildingEvent $event) { | ||||||
|  | 		$sb = new SetupBlock("Random Images List"); | ||||||
|  |                  | ||||||
|  |                 // custom headers
 | ||||||
|  | 		$sb->add_int_option("random_images_list_count",  | ||||||
|  |                         "Amount of Random images to display"); | ||||||
|  |                  | ||||||
|  | 		$event->panel->add_block($sb); | ||||||
|  | 	} | ||||||
|  |          | ||||||
|         private function build_random_html(Image $image, $query=null) { |         private function build_random_html(Image $image, $query=null) { | ||||||
| 		$i_id = int_escape($image->id); | 		$i_id = int_escape($image->id); | ||||||
| 		$h_view_link = make_link("post/view/$i_id", $query); | 		$h_view_link = make_link("post/view/$i_id", $query); | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user