From 4e3de4fc553f4c675bcbbc4c8cefb38d102939a0 Mon Sep 17 00:00:00 2001 From: Morven Lewis-Everley Date: Tue, 5 Aug 2014 14:28:47 +0100 Subject: [PATCH] Add extension hooks to blog entry form (so we can customise management form) --- code/BlogHolder.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/BlogHolder.php b/code/BlogHolder.php index 48edefc..122bb28 100644 --- a/code/BlogHolder.php +++ b/code/BlogHolder.php @@ -283,6 +283,8 @@ class BlogHolder_Controller extends BlogTree_Controller { } else { $form->loadDataFrom(array("Author" => Cookie::get("BlogHolder_Name"))); } + + $this->extend("updateBlogEntryForm", $form); return $form; } @@ -312,12 +314,16 @@ class BlogHolder_Controller extends BlogTree_Controller { if(Object::has_extension($this->ClassName, 'Translatable')) { $blogentry->Locale = $this->Locale; } + + $this->extend("onBeforePostBlog", $blogentry); $oldMode = Versioned::get_reading_mode(); Versioned::reading_stage('Stage'); $blogentry->write(); $blogentry->publish("Stage", "Live"); Versioned::set_reading_mode($oldMode); + + $this->extend("onAfterPostBlog", $blogentry); $this->redirect($this->Link()); }