scorify the news extension
This commit is contained in:
parent
fc9eddd08b
commit
8dfb7e5ed3
@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user