[TYPO3-dev] Backend ajax: mID approach

Maximo Cuadros mcuadros at gmail.com
Sat Feb 10 16:09:09 CET 2007


Yes its a good idea but then u need change ur code, i tried to change
alt_ajax_doc.php for not disturb and make that more ppl change his
code.

U can change ur IRRE code to fit mID? Or maybe i make this way just
for my ajax funtions and if all is approved u change ur code?

Best regards

On 2/10/07, Oliver Hader <oh at inpublica.de> wrote:
> Hi Maximo,
>
> Maximo Cuadros wrote:
> > Hi,
> >
> > I updated the code plz check at:
> > http://rafb.net/p/EogyLM22.html
> >
> > Olver we can call mID as u want, this is not important.
>
> That shouldn't also be a problem for me, too. ;-)
>
> A call to the PHP AJAX should could IMO like this:
> typo3/alt_doc_ajax.php?mID=IRRE&mACT=createNewRecord&ajax[0]=argument0&ajax[1]=...
>
> So this leads to a general structure:
> $TYPO3_CONF_VARS['BE']['mID_include'][<package>][<action>] = array(
>         'handler' => '<handler>',
>         'required' => array('<php-class-file-1>', '<php-class-file-2>'),
>         'encodeUTF8' => <boolean>
> );
>
> I think we do not need a key 'init'. The incoming AJAX call will be
> delegated to the handler-function and this one has to take care about
> initialisation of its special environment. alt_doc_ajax.php is just
> doing the necessary abstract stuff.
>
> The key 'encodeUTF8' will perform a charset conversion to UTF-8 of the
> result. Possibly only some parts of the result must be encoded, thus the
> developer can decide. This assumes that AJAX responses are always
> returned as UTF-8, of course.
>
> The extended Backus-Naur (eBNF) form of the key 'handler':
> handler ::= <static> | <instance>
> static ::= <class> "::" <function>
> instance ::= (<variable>|<class>) "->" {<object> "->"} <method>
> variable ::= "$" <valid-php-identifier>
> class ::= <valid-php-identifier>
> object ::= <valid-php-identifier>
> method ::= <valid-php-identifier>
> (* @see http://www.php.net/manual/en/language.variables.php *)
> valid-php-identifier = ? chars that are valid in PHP for variables ?
>
> Examples:
> "$this->tceforms->inline->createNewRecord"
> "t3lib_TCEforms->inline->createNewRecord"
> "t3lib_div::someOtherFunction"
>
> Thus there has to be a general method which takes care about the string
> provided in the key 'handler' and creates the instances. Finally this
> path to the handler function/method is called via "call_user_func_array"
> as it is like now.
>
> So, here go with an example:
> $TYPO3_CONF_VARS['BE']['mID_include']['IRRE']['createNewRecord']=array(
>         'handler' => 't3lib_TCEforms->inline->createNewRecord',
>         'required' => array(PATH_t3lib.'class.t3lib_tceforms.php'),
>         'encodeUTF8' => false
> );
>
> What do you think?
>
>
> olly
> --
> Oliver Hader
> http://inpublica.de/
> _______________________________________________
> TYPO3-dev mailing list
> TYPO3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>




More information about the TYPO3-dev mailing list