From 2ac9898a767e730d842f57858a61381df245dde5 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 9 Jun 2002 21:31:01 +0000 Subject: [PATCH] changed init to be used to set complete template data, has to be as array in $name --- etemplate/inc/class.soetemplate.inc.php | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/etemplate/inc/class.soetemplate.inc.php b/etemplate/inc/class.soetemplate.inc.php index ef24c59d83..34f200d35c 100644 --- a/etemplate/inc/class.soetemplate.inc.php +++ b/etemplate/inc/class.soetemplate.inc.php @@ -107,14 +107,14 @@ /*! @function init @abstract initialises all internal data-structures of the eTemplate and sets the keys - @param $name name of the eTemplate or array with the keys + @param $name name of the eTemplate or array with the keys or all data @param $template,$lang,$group,$version see class @param $rows,$cols initial size of the template */ function init($name='',$template='',$lang='',$group=0,$version='',$rows=1,$cols=1) { - reset($this->db_key_cols); - while (list($db_col,$col) = each($this->db_key_cols)) + reset($this->db_cols); + while (list($db_col,$col) = each($this->db_cols)) { $this->$col = is_array($name) ? $name[$col] : $$col; } @@ -126,6 +126,10 @@ { $this->lang = ''; } + if (is_array($name) && isset($name['data'])) + { + return; // data already set + } $this->size = $this->style = ''; $this->data = array(); $this->rows = $rows < 0 ? 1 : $rows;