Return form including etemplate-data if the output_mode is set to 1

This commit is contained in:
Hadi Nategh 2017-03-15 16:54:58 +01:00
parent bacc951bba
commit 2b0fecd8bd

View File

@ -257,9 +257,10 @@ class Etemplate extends Etemplate\Widget\Template
$load_array['response'] = Json\Response::get()->returnResult(); $load_array['response'] = Json\Response::get()->returnResult();
} }
// <iframe> and <form> tags added only to get browser autocomplete handling working again // <iframe> and <form> tags added only to get browser autocomplete handling working again
echo '<form target="egw_iframe_autocomplete_helper" action="'.$form_action.'" id="'.$dom_id.'" class="et2_container" data-etemplate="'. $form = '<form target="egw_iframe_autocomplete_helper" action="'.$form_action.'" id="'.$dom_id.'" class="et2_container" data-etemplate="'.
htmlspecialchars(Json\Response::json_encode($load_array), ENT_COMPAT, Translation::charset(), true).'"></form>'."\n". htmlspecialchars(Json\Response::json_encode($load_array), ENT_COMPAT, Translation::charset(), true).'"></form>'."\n".
'<iframe name="egw_iframe_autocomplete_helper" style="width:0;height:0;position: absolute;visibility:hidden;"></iframe>'; '<iframe name="egw_iframe_autocomplete_helper" style="width:0;height:0;position: absolute;visibility:hidden;"></iframe>';
echo $form;
if ($output_mode == 2) if ($output_mode == 2)
{ {
@ -267,6 +268,7 @@ class Etemplate extends Etemplate\Widget\Template
echo $GLOBALS['egw']->framework->footer(); echo $GLOBALS['egw']->framework->footer();
} }
ob_flush(); ob_flush();
if ($output_mode == 1) return $form;
} }
self::$request = null; self::$request = null;
} }