This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/holiday/main.php

32 lines
760 B
PHP
Raw Normal View History

2021-12-14 18:32:47 +00:00
<?php
declare(strict_types=1);
namespace Shimmie2;
class Holiday extends Extension
{
2020-02-04 00:46:36 +00:00
/** @var HolidayTheme */
2023-06-27 14:56:49 +00:00
protected Themelet $theme;
2020-02-04 00:46:36 +00:00
public function onInitExt(InitExtEvent $event)
{
global $config;
$config->set_default_bool("holiday_aprilfools", false);
}
2012-01-18 09:55:00 +00:00
public function onSetupBuilding(SetupBuildingEvent $event)
{
$sb = $event->panel->create_new_block("Holiday Theme");
$sb->add_bool_option("holiday_aprilfools", "Enable April Fools");
}
2012-01-18 09:55:00 +00:00
public function onPageRequest(PageRequestEvent $event)
{
global $config;
if (date('d/m') == '01/04' && $config->get_bool("holiday_aprilfools")) {
$this->theme->display_holiday("aprilfools");
}
}
2012-01-18 09:55:00 +00:00
}