Apply SilverStripe\Admin namespace

This commit is contained in:
Damian Mooyman 2016-08-11 13:18:02 +12:00
parent 095ae30a3e
commit 2352127fe0
8 changed files with 40 additions and 26 deletions

View File

@ -1,5 +1,7 @@
<?php <?php
use SilverStripe\Admin\CMSMenu;
/** /**
* - CMS_DIR: Path relative to webroot, e.g. "cms" * - CMS_DIR: Path relative to webroot, e.g. "cms"
* - CMS_PATH: Absolute filepath, e.g. "/var/www/my-webroot/cms" * - CMS_PATH: Absolute filepath, e.g. "/var/www/my-webroot/cms"

View File

@ -7,7 +7,8 @@ use SilverStripe\ORM\SS_List;
use SilverStripe\ORM\ArrayList; use SilverStripe\ORM\ArrayList;
use SilverStripe\ORM\Versioning\Versioned; use SilverStripe\ORM\Versioning\Versioned;
use SilverStripe\Security\Permission; use SilverStripe\Security\Permission;
use CMSBatchAction; use SilverStripe\Admin\CMSBatchAction;
/** /**

View File

@ -9,7 +9,6 @@ use SilverStripe\ORM\DataObject;
use SilverStripe\ORM\SS_List; use SilverStripe\ORM\SS_List;
use SilverStripe\Security\Security; use SilverStripe\Security\Security;
use SilverStripe\Security\PermissionProvider; use SilverStripe\Security\PermissionProvider;
use LeftAndMain;
use Session; use Session;
use Requirements; use Requirements;
use CMSBatchActionHandler; use CMSBatchActionHandler;
@ -51,6 +50,10 @@ use Injector;
use Director; use Director;
use ArrayData; use ArrayData;
use CMSBatchAction; use CMSBatchAction;
use SilverStripe\Admin\CMSBatchActionHandler;
use SilverStripe\Admin\LeftAndMain;
use SilverStripe\Admin\CMSBatchAction;

View File

@ -3,6 +3,7 @@
namespace SilverStripe\CMS\Controllers; namespace SilverStripe\CMS\Controllers;
use ResetFormAction; use ResetFormAction;
use SilverStripe\Admin\CMSPreviewable;
use SilverStripe\ORM\FieldType\DBHTMLText; use SilverStripe\ORM\FieldType\DBHTMLText;
use SilverStripe\ORM\SS_List; use SilverStripe\ORM\SS_List;
use SilverStripe\ORM\Versioning\Versioned; use SilverStripe\ORM\Versioning\Versioned;
@ -16,7 +17,10 @@ use SilverStripe\Security\Security;
use SilverStripe\Security\SecurityToken; use SilverStripe\Security\SecurityToken;
use SilverStripe\Security\Permission; use SilverStripe\Security\Permission;
use SilverStripe\Security\PermissionProvider; use SilverStripe\Security\PermissionProvider;
use LeftAndMain; use SilverStripe\Admin\CMSBatchActionHandler;
use SilverStripe\Admin\AdminRootController;
use SilverStripe\Admin\AddToCampaignHandler;
use SilverStripe\Admin\LeftAndMain;
use SS_HTTPRequest; use SS_HTTPRequest;
@ -734,7 +738,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
$form->setValidationExemptActions(array('restore', 'revert', 'deletefromlive', 'delete', 'unpublish', 'rollback', 'doRollback')); $form->setValidationExemptActions(array('restore', 'revert', 'deletefromlive', 'delete', 'unpublish', 'rollback', 'doRollback'));
// Announce the capability so the frontend can decide whether to allow preview or not. // Announce the capability so the frontend can decide whether to allow preview or not.
if(in_array('CMSPreviewable', class_implements($record))) { if ($record instanceof CMSPreviewable) {
$form->addExtraClass('cms-previewable'); $form->addExtraClass('cms-previewable');
} }

View File

@ -7,9 +7,10 @@ use SilverStripe\ORM\DataList;
use SilverStripe\ORM\SS_List; use SilverStripe\ORM\SS_List;
use SilverStripe\ORM\Versioning\Versioned; use SilverStripe\ORM\Versioning\Versioned;
use Object; use Object;
use LeftAndMain_SearchFilter;
use ClassInfo; use ClassInfo;
use DateField; use DateField;
use SilverStripe\Admin\LeftAndMain_SearchFilter;
/** /**
* Base class for filtering the subtree for certain node statuses. * Base class for filtering the subtree for certain node statuses.

View File

@ -9,10 +9,11 @@ use SilverStripe\ORM\Versioning\Versioned;
use SilverStripe\ORM\FieldType\DBField; use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\Security\Member; use SilverStripe\Security\Member;
use ViewableData; use ViewableData;
use CMSPreviewable;
use ClassInfo; use ClassInfo;
use LeftAndMain;
use Controller; use Controller;
use SilverStripe\Admin\CMSPreviewable;
use SilverStripe\Admin\LeftAndMain;
use SiteTreeFutureState; use SiteTreeFutureState;
use SilverStripe\CMS\Model\RedirectorPage; use SilverStripe\CMS\Model\RedirectorPage;

View File

@ -19,7 +19,6 @@ use SilverStripe\Security\Permission;
use SilverStripe\Security\Group; use SilverStripe\Security\Group;
use SilverStripe\Security\PermissionProvider; use SilverStripe\Security\PermissionProvider;
use i18nEntityProvider; use i18nEntityProvider;
use CMSPreviewable;
use Director; use Director;
use SilverStripe\CMS\Controllers\RootURLController; use SilverStripe\CMS\Controllers\RootURLController;
use ClassInfo; use ClassInfo;
@ -52,9 +51,11 @@ use TreeDropdownField;
use FieldGroup; use FieldGroup;
use CheckboxField; use CheckboxField;
use ListboxField; use ListboxField;
use AddToCampaignHandler_FormAction;
use FormAction; use FormAction;
use i18n; use i18n;
use SilverStripe\Admin\AddToCampaignHandler_FormAction;
use SilverStripe\Admin\CMSPreviewable;
/** /**
* Basic data-object representing all pages within the site tree. All page types that live within the hierarchy should * Basic data-object representing all pages within the site tree. All page types that live within the hierarchy should
@ -1467,7 +1468,6 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
} }
if(Permission::check('CMS_ACCESS_CMSMain') if(Permission::check('CMS_ACCESS_CMSMain')
&& in_array('CMSPreviewable', class_implements($this))
&& !$this instanceof ErrorPage && !$this instanceof ErrorPage
&& $this->ID > 0 && $this->ID > 0
) { ) {

View File

@ -6,6 +6,8 @@ use SilverStripe\ORM\Versioning\Versioned;
use SilverStripe\ORM\HiddenClass; use SilverStripe\ORM\HiddenClass;
use SilverStripe\CMS\Controllers\CMSMain; use SilverStripe\CMS\Controllers\CMSMain;
use SilverStripe\CMS\Model\SiteTree; use SilverStripe\CMS\Model\SiteTree;
use SilverStripe\Admin\CMSBatchActionHandler;
/** /**