mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
Use SiteTree instead of Page class in more places. Allows developers to extend SiteTree directly.
This commit is contained in:
parent
a8732efd7a
commit
2108d8ef08
@ -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