mirror of
https://github.com/silverstripe/silverstripe-blog
synced 2024-10-22 09:05:58 +00:00
Add extension hooks to blog entry form (so we can customise management form)
This commit is contained in:
parent
638b309b69
commit
4e3de4fc55
@ -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());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user