From fe2017551d2231eae116d6bcda79630f2d619f31 Mon Sep 17 00:00:00 2001 From: Robert Sesek Date: Sun, 16 Oct 2005 20:02:46 +0000 Subject: [PATCH] Use getobject() system --- template.php | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/template.php b/template.php index 90762d8..5094d39 100644 --- a/template.php +++ b/template.php @@ -78,7 +78,7 @@ class Template * The name of the function phrases are fetched with * @var string */ - var $langcall = '$GLOBALS[\'_isso\']->lang->string'; + var $langcall = '$this->registry->getobject(\'localize\')->string'; /** * The name of the function phrases are sprintf() parsed with @@ -132,8 +132,8 @@ class Template } else { - $templates = $this->registry->db->query("SELECT * FROM " . $this->tablename . " WHERE " . $this->namecolumn . " IN ('" . implode("', '", $namearray) . "')" . (($this->extrawhere) ? $this->extrawhere : '')); - while ($template = $this->registry->db->fetch_array($templates)) + $templates = $this->registry->getobject('db_mysql')->query("SELECT * FROM " . $this->tablename . " WHERE " . $this->namecolumn . " IN ('" . implode("', '", $namearray) . "')" . (($this->extrawhere) ? $this->extrawhere : '')); + while ($template = $this->registry->getobject('db_mysql')->fetch_array($templates)) { $template = $this->_parse($template); $this->cache[ $template[ $this->namecolumn ] ] = $template[ $this->datacolumn ]; @@ -191,10 +191,10 @@ class Template if ($this->registry->debug AND isset($_GET['query'])) { - if (is_array($this->registry->db->history)) + if (is_array($this->registry->getobject('db_mysql')->history)) { echo '
';
-				foreach ($this->registry->db->history AS $query)
+				foreach ($this->registry->getobject('db_mysql')->history AS $query)
 				{
 					echo $query . "\n\n
\n\n"; } @@ -299,16 +299,16 @@ class Template $debug .= "\n\t
  • Source Control: $scinfo
  • "; // query information - if (isset($this->registry->db) AND is_object($this->registry->db)) + if (is_object($this->registry->getobject('db_mysql'))) { - $debug .= "\n\t
  • Total Queries: " . sizeof($this->registry->db->history) . " (registry->sanitize($_SERVER['REQUEST_URI']) . ((strpos($_SERVER['REQUEST_URI'], '?') !== false) ? '&query=1' : '?query=1') . "\">?)
  • "; + $debug .= "\n\t
  • Total Queries: " . sizeof($this->registry->getobject('db_mysql')->history) . " (registry->sanitize($_SERVER['REQUEST_URI']) . ((strpos($_SERVER['REQUEST_URI'], '?') !== false) ? '&query=1' : '?query=1') . "\">?)
  • "; } // total execution time if (defined('ISSO_MT_START')) { - $this->registry->load('functions'); - $debug .= "\n\t
  • Total Execution Time: " . round($this->registry->funct->fetch_microtime_diff(ISSO_MT_START), 10) . "
  • "; + $this->registry->load('functions', 'functions'); + $debug .= "\n\t
  • Total Execution Time: " . round($this->registry->getobject('functions')->fetch_microtime_diff(ISSO_MT_START), 10) . "
  • "; } // debug notices @@ -355,7 +355,7 @@ class Template */ function _load($name) { - if ($template = $this->registry->db->query("SELECT * FROM " . $this->tablename . " WHERE " . $this->namecolumn . " = '$name'" . (($this->extrawhere) ? $this->extrawhere : ''))) + if ($template = $this->registry->getobject('db_mysql')->query("SELECT * FROM " . $this->tablename . " WHERE " . $this->namecolumn . " = '$name'" . (($this->extrawhere) ? $this->extrawhere : ''))) { return $template[ $this->datacolumn ]; } -- 2.22.5