From c1f16db62d347eac5255f7584713b268b9a868bf Mon Sep 17 00:00:00 2001 From: xzilla Date: Sat, 24 Mar 2007 02:33:59 +0000 Subject: [PATCH] rename prepareSQL to replaceDecorator (ioguix) --- libraries/decorator.inc.php | 18 +++++++++--------- tblproperties.php | 4 ++-- viewproperties.php | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/libraries/decorator.inc.php b/libraries/decorator.inc.php index a93e66ca..8207b230 100644 --- a/libraries/decorator.inc.php +++ b/libraries/decorator.inc.php @@ -1,5 +1,5 @@ q = $sql; + function replaceDecorator($str, $params) { + $this->s = $str; $this->p = $params; } function value($fields) { - $req = $this->q; + $str = $this->s; foreach ($this->p as $k => $v) { - $req = str_replace($k, value($v, $fields), $req); + $str = str_replace($k, value($v, $fields), $str); } - return $req; + return $str; } } ?> diff --git a/tblproperties.php b/tblproperties.php index 2dc67a4e..bf61385f 100644 --- a/tblproperties.php +++ b/tblproperties.php @@ -3,7 +3,7 @@ /** * List tables in a database * - * $Id: tblproperties.php,v 1.74 2007/01/22 16:33:01 soranzo Exp $ + * $Id: tblproperties.php,v 1.75 2007/03/24 02:33:59 xzilla Exp $ */ // Include application functions @@ -568,7 +568,7 @@ array( 'table' => $_REQUEST['table'], 'column' => field('attname'), - 'query' => prepareSQL( + 'query' => replace( "SELECT %column%, count(*) AS \"count\" FROM %table% GROUP BY %column% ORDER BY %column%", array ( '%column%' => field('attname'), diff --git a/viewproperties.php b/viewproperties.php index 9c496f4e..1497775f 100755 --- a/viewproperties.php +++ b/viewproperties.php @@ -3,7 +3,7 @@ /** * List views in a database * - * $Id: viewproperties.php,v 1.23 2007/01/23 14:12:29 soranzo Exp $ + * $Id: viewproperties.php,v 1.24 2007/03/24 02:33:59 xzilla Exp $ */ // Include application functions @@ -264,7 +264,7 @@ array( 'view' => $_REQUEST['view'], 'column' => field('attname'), - 'query' => prepareSQL( + 'query' => replace( "SELECT %column%, count(*) AS \"count\" FROM %view% GROUP BY %column% ORDER BY %column%", array ( '%column%' => field('attname'), -- 2.39.5