mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 09:05:58 +00:00
Merge pull request #153 from dhensby/pulls/126
Add extension hooks to blog entry form
This commit is contained in:
commit
bffce65543
@ -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());
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user