[TYPO3-core] RFC: #6829 - New general template-class usable for FE+BE

Steffen Kamper steffen at sk-typo3.de
Sun Nov 25 15:15:43 CET 2007


ok, i did a new patch.
I only copied 2 of the functions to t3lib_parsehtml (2 functions still 
exists there)

So we have same functionality eithout a new class, using t3lib_parsehtml

require_once (PATH_t3lib.'class.t3lib_parsehtml.php');

t3lib_parsehtml::getSubpart($content, $marker)
t3lib_parsehtml::substituteSubpart($content,$marker,$subpartContent,$recursive=1)
t3lib_parsehtml::substituteMarker($content,$marker,$markContent)
t3lib_parsehtml::substituteMarkerArray($content,$markContentArray,$wrap='',$uppercase=0)

I also replaced the two function in tslib_content with wrappers.

vg  Steffen

"Steffen Kamper" <steffen at sk-typo3.de> schrieb im Newsbeitrag 
news:mailman.1.1195994542.531.typo3-team-core at lists.netfielders.de...
> Hi,
>
> this is a SVN patch request!
>
> Branches: Trunk only!
>
> BT Reference: http://bugs.typo3.org/view.php?id=68269
>
> Problem:
> Templating in BE is not supported yet. But the functions are already in
> core. Unfortunally they are in tslib_content which makes it complicate to
> use them in BE.
>
> Solution:
> I took the 4 "basic" functions from tslib_content and copied them to a new
> class: t3lib_htmltemplate. Now they are easy usable also in BE.
>
> May be later they should be removed from tslib_content with a wrapper 
> there
> calling this functions to prevent double code.
>
> Notes:
> Calling the functions is very easy
>
> require_once (PATH_t3lib.'class.t3lib_htmltemplate.php');
>
> t3lib_HTMLtemplate::getSubpart($content, $marker)
> t3lib_HTMLtemplate::substituteSubpart($content,$marker,$subpartContent,$recursive=1)
> t3lib_HTMLtemplate::substituteMarker($content,$marker,$markContent)
> t3lib_HTMLtemplate::substituteMarkerArray($content,$markContentArray,$wrap='',$uppercase=0)
>
> vg  Steffen
>
>
>
> 


begin 666 20071125_t3lib_parsehtml_templating.diff
M26YD97 at Z('0S;&EB+V-L87-S+G0S;&EB7W!A<G-E:'1M;"YP:' -"CT]/3T]
M/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]/3T]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%N9"!F;W(@96%C:"!K97D@=&AE
M(&UA<FME<B!B>2!T:&4@<V%M92!N86UE("AP;W-S:6)L>2!W<F%P<&5D(&%N
M9"!I;B!U<'!E<B!C87-E*2!W:6QL(&)E('-U8G-T:71U=&5D('=I=&@@=&AE
M(&ME>7,@=F%L=64@:6X@=&AE(&%R<F%Y+ at HK"2 J(%1H:7,@:7,@=F5R>2!U
M<V5F=6P@:68@>6]U(&AA=F4 at 82!D871A+7)E8V]R9"!T;R!S=6)S=&ET=71E
M(&EN('-O;64 at 8V]N=&5N="X at 26X@<&%R=&EC=6QA<B!W:&5N('EO=2!U<V4@
M=&AE("1W<F%P(&%N9" D=7!P97)C87-E('9A;'5E<R!T;R!P<F4M<')O8V5S
M<R!T:&4@;6%R:V5R<RX at 16<N(&$@:V5Y(&YA;64@;&EK92 B;7EF:65L9"(@
M8V]U;&0 at 969F96-T:79E;'D at 8F4@<F5P<F5S96YT960 at 8GD@=&AE(&UA<FME
M<B B(R,C35E&245,1",C(R(@:68@=&AE('=R87 @=F%L=64@=V%S("(C(R-\
M(R,C(B!A;F0@=&AE("1U<'!E<F-A<V4 at 8F]O;&5A;B!T<G5E+ at HK"2 J"BL)
M("H at 0'!A<F%M"7-T<FEN9PD)5&AE(&-O;G1E;G0@<W1R96%M+"!T>7!I8V%L
M;'D at 2%1-3"!T96UP;&%T92!C;VYT96YT+ at HK"2 J($!P87)A;0EA<G)A>0D)
M5&AE(&%R<F%Y(&]F(&ME>2]V86QU92!P86ER<R!B96EN9R!M87)K97(O8V]N
M=&5N="!V86QU97,@=7-E9"!I;B!T:&4@<W5B<W1I='5T:6]N+B!&;W(@96%C
M:"!E;&5M96YT(&EN('1H:7, at 87)R87D@=&AE(&9U;F-T:6]N('=I;&P@<W5B
M<W1I='5T92!A(&UA<FME<B!I;B!T:&4 at 8V]N=&5N="!S=')E86T@=VET:"!T
M:&4 at 8V]N=&5N="X**PD@*B! <&%R86T)<W1R:6YG"0E!('=R87 @=F%L=64@
M+2!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E
M;G0I.PHK"0ER971U<FX@=#-L:6)?<&%R<V5H=&UL.CIS=6)S=&ET=71E36%R
M:V5R*"1C;VYT96YT+"1M87)K97(L)&UA<FM#;VYT96YT*3L*( E]"B *( DO
M*BH*0$ @+3,P,C0L,38@*S,P,C0L-R! 0 T*( D@*B! <V5E('-U8G-T:71U
M=&5-87)K97(H*2P@<W5B<W1I='5T94UA<FME<DEN3V)J96-T*"DL(%1%35!,
M051%*"D*( D@*B\*( EF=6YC=&EO;B!S=6)S=&ET=71E36%R:V5R07)R87DH
M)&-O;G1E;G0L)&UA<FM#;VYT96YT07)R87DL)'=R87 ])R<L)'5P<&5R8V%S
M93TP*0E["BT)"6EF("AI<U]A<G)A>2 at D;6%R:T-O;G1E;G1!<G)A>2DI"7L*
M+0D)"7)E<V5T*"1M87)K0V]N=&5N=$%R<F%Y*3L*+0D)"21W<F%P07)R/70S
M;&EB7V1I=CHZ=')I;45X<&QO9&4H)WPG+"1W<F%P*3L*+0D)"7=H:6QE*&QI
M<W0H)&UA<FME<BPD;6%R:T-O;G1E;G0I/65A8V at H)&UA<FM#;VYT96YT07)R
M87DI*0E["BT)"0D):68H)'5P<&5R8V%S92D))&UA<FME<CUS=')T;W5P<&5R
M*"1M87)K97(I.PHM"0D)"6EF*'-T<F-M<"@D=W)A<"PG)RDI"0DD;6%R:V5R
M/21W<F%P07)R6S!=+B1M87)K97(N)'=R87!!<G);,5T["BT)"0D))&-O;G1E
M;G0]<W1R7W)E<&QA8V4H)&UA<FME<BPD;6%R:T-O;G1E;G0L)&-O;G1E;G0I
M.PHM"0D)?0HM"0E]"BT)"7)E='5R;B D8V]N=&5N=#L**PD)<F5T=7)N('0S
M;&EB7W!A<G-E:'1M;#HZ<W5B<W1I='5T94UA<FME<D%R<F%Y*"1C;VYT96YT
M+"1M87)K0V]N=&5N=$%R<F%Y+"1W<F%P+"1U<'!E<F-A<V4I.PH@"7T*( H@
%"2\J*@H`
`
end



More information about the TYPO3-team-core mailing list