[TYPO3-dev] Status report for xaJax

Elmar Hinz elmar.DOT.hinz at team.MINUS.red.DOT.net
Mon Mar 20 12:03:09 CET 2006


Elmar Hinz schrieb:

Browser (xajax js) sends utf8 parameters as request. First I transform
them back to iso-8859-1:

> 27 	  if(is_array($vars['tx_sbpro_pi1'])){
> 28 	    foreach($vars['tx_sbpro_pi1'] as $key => $value)
> 29 	      $vars['tx_sbpro_pi1'][$key] = utf8_decode($value);
> 30 	  }

Set it to Controller Class and call the controller with does the usual
stuff and returns the output:

> 31 	  $ControllerClass->piVars = $vars['tx_sbpro_pi1'];
> 32 	  $out = $ControllerClass->controller();
> 33
(HINT: The $ControllerClass will usually be $self. I used an external
one.)

Non ascii caracters needs to be transformed to html entities, else
I.E. doesn't work. (Are there better solutions?).

> 34 	  $tbl=get_html_translation_table(HTML_ENTITIES);
> 35 	  unset ($tbl["<"]);
> 36 	  unset ($tbl[">"]);
> 37 	  unset ($tbl["'"]);
> 38 	  unset ($tbl['"']);
> 39 	  unset ($tbl['&']);
> 40 	  $out =  str_replace(array_keys($tbl),array_values($tbl),$out);
> 41

The prepared content is sent to Browser:

> 42 	  $objResponse = new xajaxResponse();
> 43 	  $objResponse->addAssign('tx-sbpro-pi1', 'innerHTML' , $out);
> 44 	  return $objResponse;
> 
> 
> Regards
> 
> Elmar
> 
> 
> 
> 




More information about the TYPO3-dev mailing list