From 8c551d0da9d098ed7f560dc90def59e38223e793 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 23 Oct 2005 06:49:23 +0000 Subject: [PATCH] Added webpath system so that images will work --- kernel.php | 6 ++++++ printer.css => printer.css.php | 23 ++++++++++++++++++++--- printer.php | 8 ++++---- 3 files changed, 30 insertions(+), 7 deletions(-) rename printer.css => printer.css.php (93%) diff --git a/kernel.php b/kernel.php index d8acd3c..f160783 100644 --- a/kernel.php +++ b/kernel.php @@ -158,6 +158,12 @@ class Shared_Object_Framework */ var $apppath = ''; + /** + * Web path used to get the web location of the installation of ISSO; only used for Printer module + * @var string + */ + var $webpath = ''; + /** * Name of the current application * @var string diff --git a/printer.css b/printer.css.php similarity index 93% rename from printer.css rename to printer.css.php index be26300..220e7fc 100755 --- a/printer.css +++ b/printer.css.php @@ -1,3 +1,4 @@ +registry, 'load'); + +if (!$included) +{ + $path = ($_SERVER['SCRIPT_URL'] ? $_SERVER['SCRIPT_URL'] : $_SERVER['REQUEST_URI']); + $this->registry->webpath = dirname($path) . '/'; +} + +$css = <<registry->webpath}images/tcat.gif); border-bottom: outset 1px; } @@ -66,7 +76,7 @@ td.thead, .thead td, .alt3 { color: #D6E1EC; font-weight: bold; - background: #445B78 url(images/thead.gif); + background: #445B78 url({$this->registry->webpath}images/thead.gif); border: inset 1px; } @@ -261,10 +271,17 @@ input, textarea, select, option background: #364D6F; color: #AABBD3; } +CSS; + +if (!$included) +{ + echo $css; +} /*=====================================================================*\ || ################################################################### || # $HeadURL$ || # $Id$ || ################################################################### -\*=====================================================================*/ \ No newline at end of file +\*=====================================================================*/ +?> \ No newline at end of file diff --git a/printer.php b/printer.php index 76b6b90..103e26b 100644 --- a/printer.php +++ b/printer.php @@ -181,10 +181,10 @@ EOD; */ function css_imbed($path) { - $data = file_get_contents($path); - $data = preg_replace('#/\*(.*?)\*/(\r|\n)*#s', '', $data); - $data = trim($data); - $this->css .= "\n\t"; + $data = require_once($path); + $css = preg_replace('#/\*(.*?)\*/(\r|\n)*#s', '', $css); + $css = trim($css); + $this->css .= "\n\t"; } /** -- 2.22.5