From 6e6a6bdd16b1cd33a5bd1e70c1d42d879b283e83 Mon Sep 17 00:00:00 2001
From: Shish <webmaster@shishnet.org>
Date: Tue, 20 Jan 2009 03:17:49 -0800
Subject: [PATCH] scoreyness

---
 core/page.class.php              | 2 +-
 themes/danbooru/layout.class.php | 6 ++++--
 themes/default/layout.class.php  | 6 ++++--
 themes/futaba/layout.class.php   | 6 ++++--
 themes/minimal/layout.class.php  | 6 ++++--
 5 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/core/page.class.php b/core/page.class.php
index 3bd5c2ca..b22fff3c 100644
--- a/core/page.class.php
+++ b/core/page.class.php
@@ -79,7 +79,7 @@ class GenericPage {
 				header("Cache-control: no-cache");
 				usort($this->blocks, "blockcmp");
 				$layout = new Layout();
-				$layout->display_page($this);
+				$layout->display_page($context);
 				break;
 			case "data":
 				if(!is_null($this->filename)) {
diff --git a/themes/danbooru/layout.class.php b/themes/danbooru/layout.class.php
index b3320201..4231da2a 100644
--- a/themes/danbooru/layout.class.php
+++ b/themes/danbooru/layout.class.php
@@ -42,8 +42,10 @@ Tips
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 class Layout {
-	public function display_page($page) {
-		global $config;
+	public function display_page($context) {
+		$page = $context->page;
+		$config = $context->config;
+
 		$theme_name = $config->get_string('theme');
 		$base_href = $config->get_string('base_href');
 		$data_href = get_base_href();
diff --git a/themes/default/layout.class.php b/themes/default/layout.class.php
index 07b61a72..167011c8 100644
--- a/themes/default/layout.class.php
+++ b/themes/default/layout.class.php
@@ -1,8 +1,10 @@
 <?php
 
 class Layout {
-	function display_page($page) {
-		global $config;
+	function display_page($context) {
+		$page = $context->page;
+		$config = $context->config;
+
 		$theme_name = $config->get_string('theme', 'default');
 		$data_href = get_base_href();
 		$contact_link = $config->get_string('contact_link');
diff --git a/themes/futaba/layout.class.php b/themes/futaba/layout.class.php
index a1d27860..0a6ea41c 100644
--- a/themes/futaba/layout.class.php
+++ b/themes/futaba/layout.class.php
@@ -1,8 +1,10 @@
 <?php
 
 class Layout {
-	function display_page($page) {
-		global $config;
+	function display_page($context) {
+		$page = $context->page;
+		$config = $context->config;
+
 		$theme_name = $config->get_string('theme', 'default');
 		$data_href = get_base_href();
 		$contact_link = $config->get_string('contact_link');
diff --git a/themes/minimal/layout.class.php b/themes/minimal/layout.class.php
index 4a62a41d..306da52f 100644
--- a/themes/minimal/layout.class.php
+++ b/themes/minimal/layout.class.php
@@ -1,8 +1,10 @@
 <?php
 
 class Layout {
-	function display_page($page) {
-		global $config;
+	function display_page($context) {
+		$page = $context->page;
+		$config = $context->config;
+
 		$theme_name = $config->get_string('theme', 'default');
 		$data_href = get_base_href();
 		$contact_link = $config->get_string('contact_link');