From fa324f2f2c877af17c8f6b6b64b660391b6d6624 Mon Sep 17 00:00:00 2001 From: Morven Lewis-Everley Date: Tue, 5 Aug 2014 14:28:47 +0100 Subject: [PATCH 1/2] 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 340c48a..33ff53b 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,9 +314,13 @@ class BlogHolder_Controller extends BlogTree_Controller { if(Object::has_extension($this->ClassName, 'Translatable')) { $blogentry->Locale = $this->Locale; } + + $this->extend("onBeforePostBlog", $blogentry); $blogentry->writeToStage("Stage"); $blogentry->publish("Stage", "Live"); + + $this->extend("onAfterPostBlog", $blogentry); $this->redirect($this->Link()); } From 9bea8af3252dbbea7d1703a60fbff89d03de1478 Mon Sep 17 00:00:00 2001 From: Morven Lewis-Everley Date: Wed, 6 Aug 2014 10:45:27 +0100 Subject: [PATCH 2/2] Switch to tab based indentation --- code/BlogHolder.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/code/BlogHolder.php b/code/BlogHolder.php index 33ff53b..96d5058 100644 --- a/code/BlogHolder.php +++ b/code/BlogHolder.php @@ -283,8 +283,8 @@ class BlogHolder_Controller extends BlogTree_Controller { } else { $form->loadDataFrom(array("Author" => Cookie::get("BlogHolder_Name"))); } - - $this->extend("updateBlogEntryForm", $form); + + $this->extend("updateBlogEntryForm", $form); return $form; } @@ -314,13 +314,13 @@ class BlogHolder_Controller extends BlogTree_Controller { if(Object::has_extension($this->ClassName, 'Translatable')) { $blogentry->Locale = $this->Locale; } - - $this->extend("onBeforePostBlog", $blogentry); + + $this->extend("onBeforePostBlog", $blogentry); $blogentry->writeToStage("Stage"); $blogentry->publish("Stage", "Live"); - - $this->extend("onAfterPostBlog", $blogentry); + + $this->extend("onAfterPostBlog", $blogentry); $this->redirect($this->Link()); }