API CHANGE: Define VirtualPage::isPublishable() so that people know not to even request publication if it's not allowed. (from r93098) (from r96751)

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@102380 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Ingo Schommer 2010-04-12 02:41:23 +00:00
parent e362790abd
commit c83e6718b7

View File

@ -62,6 +62,14 @@ class VirtualPage extends Page {
* We can only publish the page if there is a published source page
*/
public function canPublish($member = null) {
return $this->isPublishable() && parent::canPublish($member);
}
/**
* Returns true if is page is publishable by anyone at all
* Return false if the source page isn't published yet.
*/
public function isPublishable() {
// No source
if(!$this->CopyContentFrom()) {
return false;
@ -72,8 +80,8 @@ class VirtualPage extends Page {
return false;
}
// Default behaviour
return parent::canPublish($member);
// Default - publishable
return true;
}
/**