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/contrib/holiday/main.php

33 lines
960 B
PHP
Raw Normal View History

2012-01-18 09:55:00 +00:00
<?php
/**
* Name: Holiday Theme
* Author: DakuTree <thedakutree@codeanimu.net>
* Link: http://www.codeanimu.net
* License: GPLv2
* Description: Use an additional stylesheet on certain holidays.
*/
class Holiday extends Extension {
public function onInitExt(InitExtEvent $event) {
2012-01-18 09:55:00 +00:00
global $config;
$config->set_default_bool("holiday_aprilfools", false);
}
public function onSetupBuilding(SetupBuildingEvent $event) {
2012-01-18 09:55:00 +00:00
global $config;
$sb = new SetupBlock("Holiday Theme");
$sb->add_bool_option("holiday_aprilfools", "Enable April Fools");
$event->panel->add_block($sb);
}
public function onPageRequest(PageRequestEvent $event) {
2012-01-18 09:55:00 +00:00
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);
}
}
}
}
?>