Browse files

Added a callback hook "onTranslatableCreate" that can be used to crea…

…te translations of dependent objects
  • Loading branch information...
1 parent 084b22a commit 061057ca0489acc4da40449b525584470d91ac47 @bummzack bummzack committed with chillu Dec 12, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 code/model/Translatable.php
View
3 code/model/Translatable.php
@@ -1323,6 +1323,9 @@ function createTranslation($locale, $saveTranslation = true) {
$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;
}

0 comments on commit 061057c

Please sign in to comment.