Added a callback hook "onTranslatableCreate" that can be used to create translations of dependent objects

This commit is contained in:
Roman 2012-12-12 16:44:18 +01:00 committed by Ingo Schommer
parent 084b22a414
commit 061057ca04

View File

@ -1323,6 +1323,9 @@ class Translatable extends DataExtension implements PermissionProvider {
$newTranslation->_TranslationGroupID = $translationGroupID ? $translationGroupID : $this->owner->ID;
if($saveTranslation) $newTranslation->write();
// run callback on page for translation related hooks
$newTranslation->invokeWithExtensions('onTranslatableCreate', $saveTranslation);
return $newTranslation;
}