[TYPO3-core] RFC: Templavoila + Core fixes

Bernhard Kraft kraftb at kraftb.at
Sun Mar 12 00:19:56 CET 2006


Hello,

This is a CVS patch request. I don't knwo if TV patches are appropriate here but there is also
a change in the core required for this to work.


Type: bugfix.

Branch: HEAD

BT reference:
http://bugs.typo3.org/view.php?id=2784
http://bugs.typo3.org/view.php?id=2609


Description:
With TV you have the possibility that when you have more languages on your site and you view the deafault language
to create translations of the content elements like it was in the traditional Page module.
Normally it should be clear that those translated records get inserted in the language which they are for but this
is not the case with current CVS version of TV.

This patch fixes this problem.


Solution:
It seems the "localize" command of TV was currently in a transition from "own-brewn" - meaning that TV handled localization
itself - to TCEmain based. This transiation was not finished but I completed it. I introduced a new argument to typo3/template.php
method "issueComand". The new argument "rUrlExtraParams" is a list of parameters which get's added to the returnUrl parameters.
In TV I add a "source=" parameter to the localize link which contains the current parentPointer (a pointer to the field containing
the concerned element) and a second parameter "localizeRecord=" which get's set to the language the record should get tranlated to.
Also the "cmd" parameter for typo3/tce_db.php is there which let's the record get localized.

When the link get's clicked tcemain localizes the record. In tcemain a change was done that information about copied/localized elements
get's collected in an array. This array get's imploded and appended to the returnUrl before outputting the "location:": header.

When the redirect via the location-header comes back to the TV main module it finds the "localizeRecord" parameter it has set for itself
and traverses the "result" parameter set from the tcemain copy-results. It then simply inserts each localized record in the correct
column by using the "source" parameter (which the script has also sent to itself using the extended returnUrl) and modifying it in
such a way that it points to the language where the localized element shall get inserted.

The patch also handles FCE's which contain Content-Areas correctly. If you translate an FCE (Check out the next patch I send) and it has
Content Element fields and then you translate the Content-Elements inside this FCE they will get properly places inside the translated
FCE on the translated page.



Files:
TVtranslate_2006-03-11.diff                | Core patch against T3 4.0 RC1
templavoila_translate_2006-03-11.diff		| Patch against TV 0.6.0 from TER



greets,
Bernhard
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TVtranslate_2006-03-11.diff
Type: text/x-patch
Size: 3986 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060312/316a9f95/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: templavoila_translate_2006-03-11.diff
Type: text/x-patch
Size: 6155 bytes
Desc: not available
Url : http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060312/316a9f95/attachment-0001.bin 


More information about the TYPO3-team-core mailing list