forked from Cavemanon/cavepaintings
tidy up some ancient base_href / data_href messes; base_href as a config variable is no longer used
This commit is contained in:
@@ -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
|
||||
|
@@ -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;}
|
||||
|
Reference in New Issue
Block a user