- Setup block added for Random Images List
This commit is contained in:
parent
8e6fe9f7e3
commit
a4b29f0254
1 changed files with 18 additions and 1 deletions
|
@ -5,7 +5,9 @@
|
|||
* Link: http://www.drudexsoftware.com
|
||||
* License: GPLv2
|
||||
* 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 {
|
||||
|
@ -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) {
|
||||
$i_id = int_escape($image->id);
|
||||
$h_view_link = make_link("post/view/$i_id", $query);
|
||||
|
|
Reference in a new issue