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

29 lines
861 B
PHP
Raw Normal View History

2012-01-18 09:55:00 +00:00
<?php
class Holiday extends Extension
{
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 = new SetupBlock("Holiday Theme");
$sb->add_bool_option("holiday_aprilfools", "Enable April Fools");
$event->panel->add_block($sb);
}
2012-01-18 09:55:00 +00:00
public function onPageRequest(PageRequestEvent $event)
{
global $config;
$date = /*date('d/m') == '01/01' ||date('d/m') == '14/02' || */date('d/m') == '01/04'/* || date('d/m') == '24/12' || date('d/m') == '25/12' || date('d/m') == '31/12'*/;
if ($date) {
if ($config->get_bool("holiday_aprilfools")) {
$this->theme->display_holiday($date);
}
}
}
2012-01-18 09:55:00 +00:00
}