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:
parent
619d18c8f3
commit
d6f5b3fb79
@ -16,7 +16,7 @@ class Home extends Extension {
|
|||||||
if(is_a($event, 'PageRequestEvent') && ($event->page_name == "home"))
|
if(is_a($event, 'PageRequestEvent') && ($event->page_name == "home"))
|
||||||
{
|
{
|
||||||
// this is a request to display this page so output the page.
|
// 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'))
|
if(is_a($event, 'SetupBuildingEvent'))
|
||||||
{
|
{
|
||||||
@ -41,7 +41,7 @@ class Home extends Extension {
|
|||||||
global $database;
|
global $database;
|
||||||
global $config;
|
global $config;
|
||||||
$base_href = $config->get_string('base_href');
|
$base_href = $config->get_string('base_href');
|
||||||
$data_href = $config->get_string('data_href');
|
$data_href = get_base_href();
|
||||||
$sitename = $config->get_string('title');
|
$sitename = $config->get_string('title');
|
||||||
$contact_link = $config->get_string('contact_link');
|
$contact_link = $config->get_string('contact_link');
|
||||||
$counter_dir = $config->get_string('home_counter', 'default');
|
$counter_dir = $config->get_string('home_counter', 'default');
|
||||||
@ -74,7 +74,7 @@ class Home extends Extension {
|
|||||||
$main_links
|
$main_links
|
||||||
</div>
|
</div>
|
||||||
<div class='space'>
|
<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 id='search_input' name='search' size='55' type='text' value='' autocomplete='off' /><br/>
|
||||||
<input type='submit' value='Search'/>
|
<input type='submit' value='Search'/>
|
||||||
</form>
|
</form>
|
||||||
@ -92,18 +92,19 @@ class Home extends Extension {
|
|||||||
</div>";
|
</div>";
|
||||||
}
|
}
|
||||||
|
|
||||||
private function output_pages()
|
private function output_pages($page)
|
||||||
{
|
{
|
||||||
// output a sectionalised list of all the main pages on the site.
|
// output a sectionalised list of all the main pages on the site.
|
||||||
global $config;
|
global $config;
|
||||||
$base_href = $config->get_string('base_href');
|
$base_href = $config->get_string('base_href');
|
||||||
$data_href = $config->get_string('data_href');
|
$data_href = get_base_href();
|
||||||
$sitename = $config->get_string('title');
|
$sitename = $config->get_string('title');
|
||||||
$theme_name = $config->get_string('theme');
|
$theme_name = $config->get_string('theme');
|
||||||
|
|
||||||
$body = $this->get_body();
|
$body = $this->get_body();
|
||||||
|
|
||||||
print <<<EOD
|
$page->set_mode("data");
|
||||||
|
$page->set_data(<<<EOD
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>$sitename</title>
|
<title>$sitename</title>
|
||||||
@ -117,11 +118,11 @@ class Home extends Extension {
|
|||||||
div#front-page li {list-style-type: none; margin: 0;}
|
div#front-page li {list-style-type: none; margin: 0;}
|
||||||
</style>
|
</style>
|
||||||
<body>
|
<body>
|
||||||
$body
|
$body
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
EOD;
|
EOD
|
||||||
exit;
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,7 @@ function tag_explode($tags) {
|
|||||||
function make_link($page=null, $query=null) {
|
function make_link($page=null, $query=null) {
|
||||||
global $config;
|
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=');
|
$base = $config->get_string('base_href', './index.php?q=');
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ class SetupBlock extends Block {
|
|||||||
|
|
||||||
class Setup extends Extension {
|
class Setup extends Extension {
|
||||||
var $theme;
|
var $theme;
|
||||||
// event handling {{{
|
|
||||||
public function receive_event($event) {
|
public function receive_event($event) {
|
||||||
if(is_null($this->theme)) $this->theme = get_theme_object("setup", "SetupTheme");
|
if(is_null($this->theme)) $this->theme = get_theme_object("setup", "SetupTheme");
|
||||||
|
|
||||||
@ -162,6 +162,7 @@ class Setup extends Extension {
|
|||||||
$sb->position = 0;
|
$sb->position = 0;
|
||||||
$sb->add_text_option("title", "Site title: ");
|
$sb->add_text_option("title", "Site title: ");
|
||||||
$sb->add_text_option("front_page", "<br>Front page: ");
|
$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("base_href", "<br>Base URL: ");
|
||||||
$sb->add_text_option("contact_link", "<br>Contact URL: ");
|
$sb->add_text_option("contact_link", "<br>Contact URL: ");
|
||||||
$sb->add_choice_option("theme", $themes, "<br>Theme: ");
|
$sb->add_choice_option("theme", $themes, "<br>Theme: ");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user