MINOR Implemented CMSMain->PreviewLink() (moved from LeftAndMain)

This commit is contained in:
Ingo Schommer 2011-10-29 19:13:19 +02:00
parent ae4dcc41e4
commit d66a47271d
3 changed files with 17 additions and 0 deletions

View File

@ -125,6 +125,15 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
"$action" "$action"
); );
} }
/**
* @return string
*/
public function PreviewLink() {
$record = $this->getRecord($this->currentPageID());
$baseLink = ($record && $record instanceof Page) ? $record->Link('?stage=Stage') : Director::absoluteBaseURL();
return $baseLink;
}
/** /**
* Return the entire site tree as a nested set of ULs * Return the entire site tree as a nested set of ULs

View File

@ -34,4 +34,8 @@ class CMSPagesController extends CMSMain {
return parent::Link($action); return parent::Link($action);
} }
function PreviewLink() {
return false;
}
} }

View File

@ -10,4 +10,8 @@ class CMSSettingsController extends CMSMain {
return $this->RootForm(); return $this->RootForm();
} }
function PreviewLink() {
return false;
}
} }