Merge pull request #153 from dhensby/pulls/126

Add extension hooks to blog entry form
This commit is contained in:
Damian Mooyman 2015-03-06 11:27:11 +13:00
commit bffce65543

View File

@ -285,6 +285,8 @@ class BlogHolder_Controller extends BlogTree_Controller {
$form->loadDataFrom(array("Author" => Cookie::get("BlogHolder_Name")));
}
$this->extend("updateBlogEntryForm", $form);
return $form;
}
@ -314,12 +316,16 @@ class BlogHolder_Controller extends BlogTree_Controller {
$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());
}
}