diff --git a/contrib/home/main.php b/contrib/home/main.php index eec55f9a..77686219 100644 --- a/contrib/home/main.php +++ b/contrib/home/main.php @@ -16,7 +16,7 @@ class Home extends Extension { if(is_a($event, 'PageRequestEvent') && ($event->page_name == "home")) { // this is a request to display this page so output the page. - $this->output_pages(); + $this->output_pages($event->page); } if(is_a($event, 'SetupBuildingEvent')) { @@ -41,7 +41,7 @@ class Home extends Extension { global $database; global $config; $base_href = $config->get_string('base_href'); - $data_href = $config->get_string('data_href'); + $data_href = get_base_href(); $sitename = $config->get_string('title'); $contact_link = $config->get_string('contact_link'); $counter_dir = $config->get_string('home_counter', 'default'); @@ -74,7 +74,7 @@ class Home extends Extension { $main_links
-
+
@@ -92,18 +92,19 @@ class Home extends Extension {
"; } - private function output_pages() + private function output_pages($page) { // output a sectionalised list of all the main pages on the site. global $config; $base_href = $config->get_string('base_href'); - $data_href = $config->get_string('data_href'); + $data_href = get_base_href(); $sitename = $config->get_string('title'); $theme_name = $config->get_string('theme'); - $body = $this->get_body(); - - print <<get_body(); + + $page->set_mode("data"); + $page->set_data(<< $sitename @@ -117,11 +118,11 @@ class Home extends Extension { div#front-page li {list-style-type: none; margin: 0;} - $body + $body -EOD; - exit; +EOD +); } } diff --git a/core/util.inc.php b/core/util.inc.php index 8f7b76c0..3f7ad190 100644 --- a/core/util.inc.php +++ b/core/util.inc.php @@ -95,7 +95,7 @@ function tag_explode($tags) { function make_link($page=null, $query=null) { global $config; - if(is_null($page)) $page = $config->get_string('front_page', 'post/list'); + if(is_null($page)) $page = $config->get_string('main_page', 'post/list'); $base = $config->get_string('base_href', './index.php?q='); diff --git a/ext/setup/main.php b/ext/setup/main.php index 63393d51..ebbaeb2a 100644 --- a/ext/setup/main.php +++ b/ext/setup/main.php @@ -124,7 +124,7 @@ class SetupBlock extends Block { class Setup extends Extension { var $theme; -// event handling {{{ + public function receive_event($event) { if(is_null($this->theme)) $this->theme = get_theme_object("setup", "SetupTheme"); @@ -162,6 +162,7 @@ class Setup extends Extension { $sb->position = 0; $sb->add_text_option("title", "Site title: "); $sb->add_text_option("front_page", "
Front page: "); + $sb->add_text_option("main_page", "
Main page: "); $sb->add_text_option("base_href", "
Base URL: "); $sb->add_text_option("contact_link", "
Contact URL: "); $sb->add_choice_option("theme", $themes, "
Theme: ");