tidy up some ancient base_href / data_href messes; base_href as a config variable is no longer used

This commit is contained in:
Shish
2012-01-20 03:29:29 +00:00
parent 18e36f9b31
commit 49e7bfa1b2
9 changed files with 13 additions and 16 deletions

View File

@@ -28,14 +28,13 @@ class Home extends SimpleExtension {
public function onPageRequest(PageRequestEvent $event) {
global $config, $page;
if($event->page_matches("home")) {
$base_href = $config->get_string('base_href');
$data_href = get_base_href();
$base_href = get_base_href();
$sitename = $config->get_string('title');
$theme_name = $config->get_string('theme');
$body = $this->get_body();
$this->theme->display_page($page, $sitename, $data_href, $theme_name, $body);
$this->theme->display_page($page, $sitename, $base_href, $theme_name, $body);
}
}
@@ -58,8 +57,7 @@ class Home extends SimpleExtension {
// returns just the contents of the body
global $database;
global $config;
$base_href = $config->get_string('base_href');
$data_href = get_base_href();
$base_href = get_base_href();
$sitename = $config->get_string('title');
$contact_link = $config->get_string('contact_link');
$counter_dir = $config->get_string('home_counter', 'default');
@@ -71,7 +69,7 @@ class Home extends SimpleExtension {
$counter_text = "";
for($n=0; $n<strlen($strtotal); $n++) {
$cur = $strtotal[$n];
$counter_text .= " <img alt='$cur' src='$data_href/ext/home/counters/$counter_dir/$cur.gif' /> ";
$counter_text .= " <img alt='$cur' src='$base_href/ext/home/counters/$counter_dir/$cur.gif' /> ";
}
// get the homelinks and process them

View File

@@ -1,14 +1,14 @@
<?php
class HomeTheme extends Themelet {
public function display_page(Page $page, $sitename, $data_href, $theme_name, $body) {
public function display_page(Page $page, $sitename, $base_href, $theme_name, $body) {
$page->set_mode("data");
$page->set_data(<<<EOD
<html>
<head>
<title>$sitename</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<link rel='stylesheet' href='$data_href/themes/$theme_name/style.css' type='text/css'>
<link rel='stylesheet' href='$base_href/themes/$theme_name/style.css' type='text/css'>
</head>
<style>
div#front-page h1 {font-size: 4em; margin-top: 2em; margin-bottom: 0px; text-align: center; border: none; background: none; box-shadow: none; -webkit-box-shadow: none; -moz-box-shadow: none;}