Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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

  • Loading branch information...
commit d66a47271d945f8675ae76c407c05341bf4e843f 1 parent ae4dcc4
@chillu chillu authored
View
9 code/controllers/CMSMain.php
@@ -125,6 +125,15 @@ public function Link($action = null) {
"$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
View
4 code/controllers/CMSPagesController.php
@@ -34,4 +34,8 @@ function Link($action = null) {
return parent::Link($action);
}
+ function PreviewLink() {
+ return false;
+ }
+
}
View
4 code/controllers/CMSSettingsController.php
@@ -10,4 +10,8 @@ function getEditForm($id = null, $fields = null) {
return $this->RootForm();
}
+ function PreviewLink() {
+ return false;
+ }
+
}
Please sign in to comment.
Something went wrong with that request. Please try again.