@@ -54,6 +54,9 @@ function smarty_compiler_widget($arrParams, $smarty){
5454 if ($ strName ){
5555 $ strCode .= '$_tpl_path=FISResource::getUri( ' . $ strName . ',$_smarty_tpl->smarty); ' ;
5656 $ strCode .= 'if(isset($_tpl_path)){ ' ;
57+
58+ $ strCode .= 'if (array_key_exists( \'fis_debug \', $_GET)) {echo "<!--widget start ' .str_replace ("\"" , '\" ' , $ strName ).'-->\n";} ' ;
59+
5760 if ($ bHasCall ){
5861 $ strCode .= '$_smarty_tpl->getSubTemplate($_tpl_path, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, $_smarty_tpl->caching, $_smarty_tpl->cache_lifetime, ' . $ strFuncParams . ', Smarty::SCOPE_LOCAL); ' ;
5962 $ strCode .= 'if(is_callable( ' . $ strTplFuncName . ')){ ' ;
@@ -64,6 +67,9 @@ function smarty_compiler_widget($arrParams, $smarty){
6467 } else {
6568 $ strCode .= 'echo $_smarty_tpl->getSubTemplate($_tpl_path, $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, $_smarty_tpl->caching, $_smarty_tpl->cache_lifetime, ' . $ strFuncParams . ', Smarty::SCOPE_LOCAL); ' ;
6669 }
70+
71+ $ strCode .= 'if (array_key_exists( \'fis_debug \', $_GET)) {echo "\n<!--widget end ' .str_replace ("\"" , '\" ' , $ strName ).'-->";} ' ;
72+
6773 $ strCode .= '}else{ ' ;
6874 $ strCode .= 'trigger_error( \'unable to locale resource " \'. ' . $ strName . '. \'" \', E_USER_ERROR); ' ;
6975 $ strCode .= '} ' ;
@@ -84,6 +90,9 @@ function getWidgetStrCode($path, $arrParams){
8490 $ path = trim ($ path ,"\"" );
8591 $ fn = '"smarty_template_function_fis_ ' . strtr (substr ($ path , 0 , strrpos ($ path , '/ ' )), '/ ' , '_ ' ) . '" ' ;
8692 $ strCode = '<?php ' ;
93+
94+ $ strCode .= 'if (array_key_exists( \'fis_debug \', $_GET)) {echo "<!--widget start ' .str_replace ("\"" , '\" ' , $ path ).'-->\n";} ' ;
95+
8796 $ strCode .= 'if(is_callable( ' . $ fn . ')){ ' ;
8897 $ strCode .= 'return call_user_func( ' . $ fn . ',$_smarty_tpl, ' . $ strFuncParams . '); ' ;
8998 $ strCode .= '}else{ ' ;
@@ -93,6 +102,9 @@ function getWidgetStrCode($path, $arrParams){
93102 $ strCode .= '}else{ ' ;
94103 $ strCode .= 'echo $fis_widget_output; ' ;
95104 $ strCode .= '} ' ;
105+
106+ $ strCode .= 'if (array_key_exists( \'fis_debug \', $_GET)) {echo "\n<!--widget end ' .str_replace ("\"" , '\" ' , $ path ).'-->";} ' ;
107+
96108 $ strCode .= '}?> ' ;
97109 return $ strCode ;
98110}
0 commit comments