Moved NewsletterSignupForm to the object, made a link to this from the blogentry page

This commit is contained in:
Sean Harvey 2007-12-20 02:23:20 +00:00
parent 5668169744
commit 3117340cc5
2 changed files with 16 additions and 5 deletions

View File

@ -140,6 +140,14 @@ class BlogEntry extends Page {
return $this->getParent()->Link('post')."/".$this->ID."/"; return $this->getParent()->Link('post')."/".$this->ID."/";
} }
/**
* Return the NewsletterSignupForm from the parent (BlogHolder).
*/
function NewsletterSignupForm() {
if(isset($this->Parent->ID) && $this->Parent->NewsletterSignupForm()) {
return $this->Parent->NewsletterSignupForm();
}
}
/** /**
* Call this to enable WYSIWYG editing on your blog entries. * Call this to enable WYSIWYG editing on your blog entries.

View File

@ -90,6 +90,13 @@ class BlogHolder extends Page {
return isset($_GET['tag']) ? $_GET['tag'] : false; return isset($_GET['tag']) ? $_GET['tag'] : false;
} }
/**
* Return a new instance of NewsletterSignupForm.
*/
function NewsletterSignupForm() {
return new NewsletterSignupForm($this, 'NewsletterSignupForm');
}
/** /**
* A simple form for creating blog entries * A simple form for creating blog entries
*/ */
@ -234,10 +241,6 @@ class BlogHolder_Controller extends Page_Controller {
return $output; return $output;
} }
function NewsletterSignupForm() {
return new NewsletterSignupForm($this, 'NewsletterSignupForm');
}
/** /**
* Get the rss feed for this blog holder's entries * Get the rss feed for this blog holder's entries
*/ */