scorify the news extension

This commit is contained in:
Shish 2009-01-04 08:35:39 -08:00
parent fc9eddd08b
commit 8dfb7e5ed3
2 changed files with 3 additions and 4 deletions

View File

@ -13,9 +13,8 @@ class News implements Extension {
if(is_null($this->theme)) $this->theme = get_theme_object($this);
if($event instanceof PostListBuildingEvent) {
global $config;
if(strlen($config->get_string("news_text")) > 0) {
$this->theme->display_news($event->page, $config->get_string("news_text"));
if(strlen($event->context->config->get_string("news_text")) > 0) {
$this->theme->display_news($event->page, $event->context->config->get_string("news_text"));
}
}

View File

@ -4,7 +4,7 @@ class NewsTheme extends Themelet {
/*
* Show $text on the $page
*/
public function display_news($page, $text) {
public function display_news(Page $page, $text) {
$page->add_block(new Block("Note", $text, "left", 5));
}
}