split front_page into front_page and main_page

git-svn-id: file:///home/shish/svn/shimmie2/trunk@391 7f39781d-f577-437e-ae19-be835c7a54ca
This commit is contained in:
shish 2007-07-28 19:33:16 +00:00
parent 619d18c8f3
commit d6f5b3fb79
3 changed files with 15 additions and 13 deletions

View File

@ -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
</div>
<div class='space'>
<form action='".make_link()."' method='GET'>
<form action='".make_link("post/list")."' method='GET'>
<input id='search_input' name='search' size='55' type='text' value='' autocomplete='off' /><br/>
<input type='submit' value='Search'/>
</form>
@ -92,18 +92,19 @@ class Home extends Extension {
</div>";
}
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 <<<EOD
$body = $this->get_body();
$page->set_mode("data");
$page->set_data(<<<EOD
<html>
<head>
<title>$sitename</title>
@ -117,11 +118,11 @@ class Home extends Extension {
div#front-page li {list-style-type: none; margin: 0;}
</style>
<body>
$body
$body
</body>
</html>
EOD;
exit;
EOD
);
}
}

View File

@ -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=');

View File

@ -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", "<br>Front page: ");
$sb->add_text_option("main_page", "<br>Main page: ");
$sb->add_text_option("base_href", "<br>Base URL: ");
$sb->add_text_option("contact_link", "<br>Contact URL: ");
$sb->add_choice_option("theme", $themes, "<br>Theme: ");