From d77a1d2b33c6834d467475d213e4bf558bb1d1d5 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Fri, 24 Aug 2007 06:16:11 +0000 Subject: [PATCH] fixed bug reported by Raphael Alla: registered javascript files get lost if etemplate loops --- etemplate/inc/class.uietemplate.inc.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/etemplate/inc/class.uietemplate.inc.php b/etemplate/inc/class.uietemplate.inc.php index 7f0bfc593e..21067e6e6e 100644 --- a/etemplate/inc/class.uietemplate.inc.php +++ b/etemplate/inc/class.uietemplate.inc.php @@ -326,6 +326,7 @@ 'java_script' => $GLOBALS['egw_info']['etemplate']['java_script'], 'java_script_from_flags' => $GLOBALS['egw_info']['flags']['java_script'], 'java_script_body_tags' => $GLOBALS['egw']->js->body, + 'java_script_files' => $GLOBALS['egw']->js->files, 'include_xajax' => $GLOBALS['egw_info']['flags']['include_xajax'], 'dom_enabled' => $GLOBALS['egw_info']['etemplate']['dom_enabled'], 'hooked' => $hooked ? $hooked : $GLOBALS['egw_info']['etemplate']['hook_content'], @@ -488,6 +489,15 @@ foreach($sess as $key => $val) $GLOBALS['egw']->js->body[$tag] .= $code; } } + if (is_array($session_data['java_script_files'])) + { + if( !is_object($GLOBALS['egw']->js)) + { + $GLOBALS['egw']->js =& CreateObject('phpgwapi.javascript'); + } + $GLOBALS['egw']->js->files = !is_array($GLOBALS['egw']->js->files) ? $session_data['java_script_files'] : + $this->complete_array_merge($GLOBALS['egw']->js->files,$session_data['java_script_files']); + } //echo "

process_exec($this->name): loop is set, content=

\n"; _debug_array($content); return $this->exec($session_data['method'],$session_data['content'],$session_data['sel_options'], @@ -1015,8 +1025,9 @@ foreach($sess as $key => $val) ); } break; - case 'html': // size: [link],[link_target],[link_popup_size],[link_title] - list($extra_link,$extra_link_target,$extra_link_popup,$extra_link_title) = explode(',',$cell_options); + case 'html': // size: [link],[link_target],[link_popup_size],[link_title],[activate_links] + list($extra_link,$extra_link_target,$extra_link_popup,$extra_link_title,$activate_links) = explode(',',$cell_options); + if ($activate_links) $value = $this->html->activate_links($value); $html .= $value; break; case 'int': // size: [min],[max],[len],[precission/sprint format]