1043 Posts in 379 Topics by 373 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 619 Views |
-
Translations for Userform

21 May 2010 at 7:47pm
Here is code to copy the form when creating a new language.
Add the following function in userforms/code/UserDefinedForm.php
function createTranslation($locale) {
$page = parent::createTranslation($locale);$newPage = $page->getTranslation(Translatable::default_locale());
foreach($newPage->Fields() as $field) {
$newField = $field->duplicate();
$newField->ParentID = $page->ID;
$newField->write();
}
foreach($newPage->EmailRecipients() as $recipient) {
$newER = $recipient->duplicate();
$newER->FormID = $page->ID;
$newER->write();
}return $page;
}After this has been added you can create new languages on a page and it should copy your form over.
| 619 Views | ||
|
Page:
1
|
Go to Top |

