@@ -749,8 +749,9 @@ protected function _parseTemplate()
749749
750750		if  (preg_match_all ('#<jdoc:include\ type="([^"]+)"(.*)\/>#iU ' , $ this _template , $ matches
751751		{
752- 			$ template_tags_firstarray ();
753- 			$ template_tags_lastarray ();
752+ 			$ messages
753+ 			$ template_tags_first
754+ 			$ template_tags_last
754755
755756			// Step through the jdocs in reverse order. 
756757			for  ($ icount ($ matches0 ]) - 1 ; $ i0 ; $ i
@@ -760,20 +761,21 @@ protected function _parseTemplate()
760761				$ name$ attribs'name ' ] ?? null ;
761762
762763				// Separate buffers to be executed first and last 
763- 				if  ($ type'module '  || $ type'modules ' )
764+ 				if  ($ type=  'module '  || $ type= == 'modules ' )
764765				{
765- 					$ template_tags_first$ matches0 ][$ iarray ('type '  => $ type'name '  => $ name'attribs '  => $ attribs
766+ 					$ template_tags_first$ matches0 ][$ i'type '  => $ type'name '  => $ name'attribs '  => $ attribs
767+ 				}
768+ 				elseif  ($ type'message ' )
769+ 				{
770+ 					$ messages$ matches0 ][$ i'type '  => $ type'name '  => $ name'attribs '  => $ attribs
766771				}
767772				else 
768773				{
769- 					$ template_tags_last$ matches0 ][$ iarray ( 'type '  => $ type'name '  => $ name'attribs '  => $ attribs) ;
774+ 					$ template_tags_last$ matches0 ][$ i[ 'type '  => $ type'name '  => $ name'attribs '  => $ attribs] ;
770775				}
771776			}
772777
773- 			// Reverse the last array so the jdocs are in forward order. 
774- 			$ template_tags_lastarray_reverse ($ template_tags_last
775- 
776- 			$ this _template_tags  = $ template_tags_first$ template_tags_last
778+ 			$ this _template_tags  = $ template_tags_first$ messagesarray_reverse ($ template_tags_last
777779		}
778780
779781		return  $ this 
@@ -788,8 +790,8 @@ protected function _parseTemplate()
788790	 */ 
789791	protected  function  _renderTemplate ()
790792	{
791- 		$ replacearray () ;
792- 		$ witharray () ;
793+ 		$ replace[] ;
794+ 		$ with[] ;
793795
794796		foreach  ($ this _template_tags  as  $ jdoc$ args
795797		{
0 commit comments