mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Use SiteTree instead of Page class in more places
This commit is contained in:
parent
6d8defcc1e
commit
0cf477d36e
@ -1457,7 +1457,7 @@ class LeftAndMain extends Controller implements PermissionProvider
|
||||
$id = $request->requestVar('ID');
|
||||
$parentID = $request->requestVar('ParentID');
|
||||
|
||||
if ($className == 'SilverStripe\\CMS\\Model\\SiteTree' && $page = DataObject::get_by_id('Page', $id)) {
|
||||
if ($className == 'SilverStripe\\CMS\\Model\\SiteTree' && $page = DataObject::get_by_id(SiteTree::class, $id)) {
|
||||
$root = $page->getParentType();
|
||||
if (($parentID == '0' || $root == 'root') && !SiteConfig::current_site_config()->canCreateTopLevel()) {
|
||||
$this->getResponse()->setStatusCode(
|
||||
|
@ -2,9 +2,9 @@
|
||||
|
||||
namespace SilverStripe\Forms\HTMLEditor;
|
||||
|
||||
use Page;
|
||||
use SilverStripe\Assets\File;
|
||||
use SilverStripe\Assets\Upload;
|
||||
use SilverStripe\CMS\Model\SiteTree;
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Control\Director;
|
||||
use SilverStripe\Control\RequestHandler;
|
||||
@ -516,7 +516,7 @@ class HTMLEditorField_Toolbar extends RequestHandler
|
||||
$id = (int)$this->getRequest()->getVar('PageID');
|
||||
$anchors = array();
|
||||
|
||||
if (($page = Page::get()->byID($id)) && !empty($page)) {
|
||||
if (($page = SiteTree::get()->byID($id)) && !empty($page)) {
|
||||
if (!$page->canView()) {
|
||||
throw new HTTPResponse_Exception(
|
||||
_t(
|
||||
|
@ -2,14 +2,16 @@
|
||||
|
||||
namespace SilverStripe\Security;
|
||||
|
||||
use SilverStripe\CMS\Controllers\ContentController;
|
||||
use SilverStripe\CMS\Model\SiteTree;
|
||||
use SilverStripe\Control\Controller;
|
||||
use SilverStripe\Control\Director;
|
||||
use SilverStripe\Control\HTTPRequest;
|
||||
use SilverStripe\Control\HTTPResponse;
|
||||
use SilverStripe\Control\Session;
|
||||
use SilverStripe\Core\ClassInfo;
|
||||
use SilverStripe\Core\Config\Config;
|
||||
use SilverStripe\Core\Convert;
|
||||
use SilverStripe\Core\ClassInfo;
|
||||
use SilverStripe\Core\Injector\Injector;
|
||||
use SilverStripe\Dev\Deprecation;
|
||||
use SilverStripe\Dev\TestOnly;
|
||||
@ -18,16 +20,14 @@ use SilverStripe\Forms\FieldList;
|
||||
use SilverStripe\Forms\Form;
|
||||
use SilverStripe\Forms\FormAction;
|
||||
use SilverStripe\ORM\ArrayList;
|
||||
use SilverStripe\ORM\DataObject;
|
||||
use SilverStripe\ORM\DB;
|
||||
use SilverStripe\ORM\DataObject;
|
||||
use SilverStripe\ORM\FieldType\DBField;
|
||||
use SilverStripe\ORM\ValidationResult;
|
||||
use SilverStripe\View\ArrayData;
|
||||
use SilverStripe\View\SSViewer;
|
||||
use SilverStripe\View\TemplateGlobalProvider;
|
||||
use Exception;
|
||||
use Page;
|
||||
use Page_Controller;
|
||||
use Subsite;
|
||||
|
||||
/**
|
||||
@ -515,14 +515,14 @@ class Security extends Controller implements TemplateGlobalProvider
|
||||
}
|
||||
|
||||
// Use sitetree pages to render the security page
|
||||
$tmpPage = new Page();
|
||||
$tmpPage = new SiteTree();
|
||||
$tmpPage->Title = $title;
|
||||
/** @skipUpgrade */
|
||||
$tmpPage->URLSegment = "Security";
|
||||
// Disable ID-based caching of the log-in page by making it a random number
|
||||
$tmpPage->ID = -1 * rand(1, 10000000);
|
||||
|
||||
$controller = Page_Controller::create($tmpPage);
|
||||
$controller = ContentController::create($tmpPage);
|
||||
$controller->setDataModel($this->model);
|
||||
$controller->doInit();
|
||||
return $controller;
|
||||
|
Loading…
Reference in New Issue
Block a user