mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Merge pull request #1704 from mikenz/page-to-sitetree
ENHANCEMENT: Use SiteTree instead of Page class in more places.
This commit is contained in:
commit
f669c6a0b7
@ -59,7 +59,6 @@ use SilverStripe\Security\SecurityToken;
|
||||
use SilverStripe\View\ArrayData;
|
||||
use SilverStripe\View\Requirements;
|
||||
use Translatable;
|
||||
use Page;
|
||||
use Zend_Cache;
|
||||
use InvalidArgumentException;
|
||||
|
||||
@ -352,7 +351,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
||||
public function LinkPreview() {
|
||||
$record = $this->getRecord($this->currentPageID());
|
||||
$baseLink = Director::absoluteBaseURL();
|
||||
if ($record && $record instanceof Page) {
|
||||
if ($record && $record instanceof SiteTree) {
|
||||
// if we are an external redirector don't show a link
|
||||
if ($record instanceof RedirectorPage && $record->RedirectionType == 'External') {
|
||||
$baseLink = false;
|
||||
|
3
code/Controllers/ContentController.php
Executable file → Normal file
3
code/Controllers/ContentController.php
Executable file → Normal file
@ -28,7 +28,6 @@ use SilverStripe\SiteConfig\SiteConfig;
|
||||
use SilverStripe\View\ArrayData;
|
||||
use SilverStripe\View\Requirements;
|
||||
use SilverStripe\View\SSViewer;
|
||||
use Page;
|
||||
use Translatable;
|
||||
|
||||
/**
|
||||
@ -67,7 +66,7 @@ class ContentController extends Controller {
|
||||
*/
|
||||
public function __construct($dataRecord = null) {
|
||||
if(!$dataRecord) {
|
||||
$dataRecord = new Page();
|
||||
$dataRecord = new SiteTree();
|
||||
if($this->hasMethod("Title")) {
|
||||
$dataRecord->Title = $this->Title();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user