[TYPO3-core] RFC:Feature #7266: new method to find a specific AjaxCall

Steffen Kamper steffen at sk-typo3.de
Thu Jan 24 18:17:59 CET 2008


Hi,

This is an SVN patch request.

Type: Feature

Bugtracker references:
http://bugs.typo3.org/view.php?id=7266

Branches:
Trunk

Problem:
with the new Ajax-Interface there is a new standard for ajaxcalls in BE.
The ajaxID has this syntax:
classname::methodename

In BE many classes use this interface. In any case they have to differ if 
they are called from Ajax or not, eg to do some additional initialising of 
needed Objects.

At the moment they do it this way:

if(TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX) { ... }

But this is wrong, these flags are set if any AjaxCall was started before. 
So may be this can fail.

Solution:
For this case i introduce a new static function in 
t3lib_div::findAjaxCall($classname) which returns true, if the classname is 
part of the ajaxId, and the determination could be done by this call:

if (t3lib_div::findAjaxCall('SC_alt_db_navframe') { ...}

Additional:
you can try this in backend.php, simply add this:
if ((TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_AJAX)) debug("jetzt");

You will see the debug output every time.

These classes uses this kind of determination:
alt_db_navframe.php
alt_file_navframe.php
class.filelistfoldertree.php
class.webpagetree.php
class.shortcutmenu.php

vg  Steffen 


begin 666 20080124_findAjaxCall.diff
M26YD97 at Z('0S;&EB+V-L87-S+G0S;&EB7V1I=BYP:' -"CT]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]
M/3T]/3T]/3T]/3T-"BTM+2!T,VQI8B]C;&%S<RYT,VQI8E]D:78N<&AP"2AR
M979I<VEO;B R.34V*0T**RLK('0S;&EB+V-L87-S+G0S;&EB7V1I=BYP:' )
M*'=O<FMI;F<@8V]P>2D-"D! ("TT-S,Y+#@@*S0W,SDL,C, at 0$ -"B )"7T*
M( D)<F5T=7)N("=<)R<N)'9A;'5E+B=<)R<["B )?0HM"BT**PD**PDO*BH*
M*PD@*B!S96%R8V@@9F]R(&%N($%J87@@8V%L;"!O9B!A(&=I=F5N(&-L87-S
M"BL)("H at 96<@06IA>"!#86QL('=I=&@@86IA>$ED(%-#7V%L=%]D8E]N879F
M<F%M93HZ97AP86YD0V]L;&%P<V4@=7-E(&-L87-S(%-#7V%L=%]D8E]N879F
M<F%M92P@<V\@=&AE(&-A;&P at 8V]U;&0 at 8F4@=7-E9"!F;W(@=&AI<R!C;&%S
M<SH**PD@*B!I9B H=#-L:6)?9&EV.CIF:6YD06IA>$-A;&PH)U-#7V%L=%]D
M8E]N879F<F%M92<I('L at +BXN?0HK"2 J"BL)("H at 0'!A<F%M"7-T<FEN9PD)
M5&AE('-T<FEN9R!T;R!E;F-O9&4N"BL)("H at 0')E='5R;@EB;V]L96%N"0ER
M971U<FX@=')U92!I9B!!:F%X0V%L;"!W87, at 9F]U;F0**PD@*B\**PEF=6YC
M=&EO;B!F:6YD06IA>$-A;&PH)&-L87-S;F%M92D@>PHK"0DD86IA>$E$(#T@
M=#-L:6)?9&EV.CI?1T(H)V%J87A)1"<I.PHK"0DD<&%R=',@/2!E>'!L;V1E
M*"<Z.B<L)&%J87A)1"D["BL)"6EF*" H5%E03S-?4D5154535%194$4@)B!4
M65!/,U]215%515-45%E015]!2D%8*2 F)B D8VQA<W-N86UE(#T]/2 D<&%R
M='-;,%TI('L**PD)"7)E='5R;B!T<G5E.PHK"0E]"BL)"7)E='5R;B!F86QS
093L**PE]"B!]"B *(#\^"@``
`
end



More information about the TYPO3-team-core mailing list