From aa22cef37dc884910a27703cf64a4cf9f43627b0 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sun, 6 Jul 2003 20:07:19 +0000 Subject: [PATCH] added parameter to exec to return the html, used for hook_home --- etemplate/inc/class.uietemplate.inc.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/etemplate/inc/class.uietemplate.inc.php b/etemplate/inc/class.uietemplate.inc.php index c58f5c81b3..623d69c290 100644 --- a/etemplate/inc/class.uietemplate.inc.php +++ b/etemplate/inc/class.uietemplate.inc.php @@ -86,10 +86,12 @@ @param options for field 'name'. ($content['options-name'] is possible too !!!) @param $readonlys Array with field-names as keys for fields with should be readonly @param (eg. to implement ACL grants on field-level or to remove buttons not applicable) - @param $preserv Array with vars which should be transported to the $method-call (eg. an id) array('id' => $id) sets $HTTP_POST_VARS['id'] for the $method-call + @param $preserv Array with vars which should be transported to the $method-call (eg. an id) array('id' => $id) + sets $HTTP_POST_VARS['id'] for the $method-call + @param $return_html if true, dont show the page, just return the html @result nothing */ - function exec($method,$content,$sel_options='',$readonlys='',$preserv='',$changes='') + function exec($method,$content,$sel_options='',$readonlys='',$preserv='',$changes='',$return_html=False) { //echo "
globals[java_script] = '".$GLOBALS['phpgw_info']['etemplate']['java_script']."', this->java_script() = '".$this->java_script()."'\n"; if (!$sel_options) @@ -116,7 +118,7 @@ if ($this->stable) { $hooked = $GLOBALS['phpgw']->template->get_var('phpgw_body'); - if (!@$GLOBALS['phpgw_info']['etemplate']['hooked']) + if (!@$GLOBALS['phpgw_info']['etemplate']['hooked'] && !$return_html) { $GLOBALS['phpgw_info']['flags']['java_script'] = $this->include_java_script(2); $GLOBALS['phpgw']->common->phpgw_header(); @@ -166,6 +168,10 @@ 'hooked' => $hooked ),$id); + if ($return_html) + { + return $html; + } if ($this->stable) { if (!@$GLOBALS['phpgw_info']['etemplate']['hooked'])