Don't show the NewsletterSignupForm unless there is a newsletter related to a BlogHolder that exists

This commit is contained in:
Sean Harvey 2007-12-20 03:31:38 +00:00
parent 10f5213192
commit d1c6825941

View File

@ -92,10 +92,13 @@ class BlogHolder extends Page {
/**
* Return a new instance of NewsletterSignupForm.
* If there is no related Newsletter, then don't show it.
*/
function NewsletterSignupForm() {
if($this->Newsletter() && $this->Newsletter()->ID) {
return new NewsletterSignupForm($this, 'NewsletterSignupForm');
}
}
/**
* A simple form for creating blog entries