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

25 lines
583 B
PHP
Raw Normal View History

<?php
class News extends Extension {
var $theme;
public function receive_event($event) {
if(is_null($this->theme)) $this->theme = get_theme_object("news", "NewsTheme");
if(is_a($event, 'PostListBuildingEvent')) {
global $config;
if(strlen($config->get_string("news_text")) > 0) {
$this->theme->display_news($event->page, $config->get_string("news_text"));
}
}
if(is_a($event, 'SetupBuildingEvent')) {
$sb = new SetupBlock("News");
$sb->add_longtext_option("news_text");
$event->panel->add_block($sb);
}
}
}
add_event_listener(new News());
?>